├── cache └── local-ga.js ├── _config.yml ├── lib ├── .DS_Store ├── class-optimisationio-upgrader-skin.php ├── class-wpperformance-view.php ├── WpPerformance │ ├── View.php │ └── Admin.php └── class-optimisationio-stats-and-addons.php ├── images ├── stars.jpg ├── addon-load.gif ├── icon-support.png ├── wp-disable.jpg ├── optimisation-1.jpg ├── optimisation-4.jpg ├── logo-optimisation.png ├── logo-optimisation-line.png └── wp-image-compression.jpg ├── lang ├── wpperformance.mo ├── wpperformance-en_US.mo └── wpperformance.pot ├── css ├── optimisationio-all.css ├── optimisationio-import-export.css ├── wp-disable-style.css ├── style.css ├── optimisationio-statistics-addons.css └── optimisationio-dashboard.css ├── includes ├── empty-comments-template.php ├── update_local_ga.php └── update-local-ga.php ├── .gitignore ├── uninstall.php ├── js ├── css-lazy-load.min.js ├── optimisationio-dashboard-wp-disable.js ├── loadcss.js ├── css-lazy-load.js ├── clipboard.min.js └── optimisationio-stats-addons.js ├── changelog.txt ├── views ├── optimisationio-dashboard.php ├── optimisationio-statistics-addons.php ├── optimisationio-import-export.php └── admin_settings.php ├── wpperformance.php └── readme.txt /cache/local-ga.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /lib/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hosting-io/wp-disable/HEAD/lib/.DS_Store -------------------------------------------------------------------------------- /images/stars.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hosting-io/wp-disable/HEAD/images/stars.jpg -------------------------------------------------------------------------------- /images/addon-load.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hosting-io/wp-disable/HEAD/images/addon-load.gif -------------------------------------------------------------------------------- /images/icon-support.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hosting-io/wp-disable/HEAD/images/icon-support.png -------------------------------------------------------------------------------- /images/wp-disable.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hosting-io/wp-disable/HEAD/images/wp-disable.jpg -------------------------------------------------------------------------------- /lang/wpperformance.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hosting-io/wp-disable/HEAD/lang/wpperformance.mo -------------------------------------------------------------------------------- /css/optimisationio-all.css: -------------------------------------------------------------------------------- 1 | #toplevel_page_optimisationio-dashboard .wp-first-item{ 2 | display:none; 3 | } -------------------------------------------------------------------------------- /images/optimisation-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hosting-io/wp-disable/HEAD/images/optimisation-1.jpg -------------------------------------------------------------------------------- /images/optimisation-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hosting-io/wp-disable/HEAD/images/optimisation-4.jpg -------------------------------------------------------------------------------- /images/logo-optimisation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hosting-io/wp-disable/HEAD/images/logo-optimisation.png -------------------------------------------------------------------------------- /lang/wpperformance-en_US.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hosting-io/wp-disable/HEAD/lang/wpperformance-en_US.mo -------------------------------------------------------------------------------- /images/logo-optimisation-line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hosting-io/wp-disable/HEAD/images/logo-optimisation-line.png -------------------------------------------------------------------------------- /images/wp-image-compression.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hosting-io/wp-disable/HEAD/images/wp-image-compression.jpg -------------------------------------------------------------------------------- /includes/empty-comments-template.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /includes/update-local-ga.php: -------------------------------------------------------------------------------- 1 | before 12 | // By default, loadCSS attempts to inject the link after the last stylesheet or script in the DOM. However, you might desire a more specific location in your document. 13 | // `media` [OPTIONAL] is the media type or query of the stylesheet. By default it will be 'all' 14 | var doc = w.document; 15 | var ss = doc.createElement( "link" ); 16 | var ref; 17 | if( before ){ 18 | ref = before; 19 | } 20 | else { 21 | var refs = ( doc.body || doc.getElementsByTagName( "head" )[ 0 ] ).childNodes; 22 | ref = refs[ refs.length - 1]; 23 | } 24 | 25 | var sheets = doc.styleSheets; 26 | ss.rel = "stylesheet"; 27 | ss.href = href; 28 | // temporarily set media to something inapplicable to ensure it'll fetch without blocking render 29 | ss.media = "only x"; 30 | 31 | // wait until body is defined before injecting link. This ensures a non-blocking load in IE11. 32 | function ready( cb ){ 33 | if( doc.body ){ 34 | return cb(); 35 | } 36 | setTimeout(function(){ 37 | ready( cb ); 38 | }); 39 | } 40 | // Inject link 41 | // Note: the ternary preserves the existing behavior of "before" argument, but we could choose to change the argument to "after" in a later release and standardize on ref.nextSibling for all refs 42 | // Note: `insertBefore` is used instead of `appendChild`, for safety re: http://www.paulirish.com/2011/surefire-dom-element-insertion/ 43 | ready( function(){ 44 | ref.parentNode.insertBefore( ss, ( before ? ref : ref.nextSibling ) ); 45 | }); 46 | // A method (exposed on return object for external use) that mimics onload by polling document.styleSheets until it includes the new sheet. 47 | var onloadcssdefined = function( cb ){ 48 | var resolvedHref = ss.href; 49 | var i = sheets.length; 50 | while( i-- ){ 51 | if( sheets[ i ].href === resolvedHref ){ 52 | return cb(); 53 | } 54 | } 55 | setTimeout(function() { 56 | onloadcssdefined( cb ); 57 | }); 58 | }; 59 | 60 | function loadCB(){ 61 | if( ss.addEventListener ){ 62 | ss.removeEventListener( "load", loadCB ); 63 | } 64 | ss.media = media || "all"; 65 | } 66 | 67 | // once loaded, set link's media back to `all` so that the stylesheet applies once it loads 68 | if( ss.addEventListener ){ 69 | ss.addEventListener( "load", loadCB); 70 | } 71 | ss.onloadcssdefined = onloadcssdefined; 72 | onloadcssdefined( loadCB ); 73 | return ss; 74 | }; 75 | // commonjs 76 | if( typeof exports !== "undefined" ){ 77 | exports.loadCSS = loadCSS; 78 | } 79 | else { 80 | w.loadCSS = loadCSS; 81 | } 82 | }( typeof global !== "undefined" ? global : this )); 83 | -------------------------------------------------------------------------------- /js/css-lazy-load.js: -------------------------------------------------------------------------------- 1 | /*! loadCSS. [c]2017 Filament Group, Inc. MIT License */ 2 | 3 | // https://github.com/filamentgroup/loadCSS/blob/master/src/loadCSS.js 4 | 5 | (function(w){ 6 | "use strict"; 7 | /* exported loadCSS */ 8 | var loadCSS = function( href, before, media ){ 9 | // Arguments explained: 10 | // `href` [REQUIRED] is the URL for your CSS file. 11 | // `before` [OPTIONAL] is the element the script should use as a reference for injecting our stylesheet before 12 | // By default, loadCSS attempts to inject the link after the last stylesheet or script in the DOM. However, you might desire a more specific location in your document. 13 | // `media` [OPTIONAL] is the media type or query of the stylesheet. By default it will be 'all' 14 | var doc = w.document; 15 | var ss = doc.createElement( "link" ); 16 | var ref; 17 | if( before ){ 18 | ref = before; 19 | } 20 | else { 21 | var refs = ( doc.body || doc.getElementsByTagName( "head" )[ 0 ] ).childNodes; 22 | ref = refs[ refs.length - 1]; 23 | } 24 | 25 | var sheets = doc.styleSheets; 26 | ss.rel = "stylesheet"; 27 | ss.href = href; 28 | // temporarily set media to something inapplicable to ensure it'll fetch without blocking render 29 | ss.media = "only x"; 30 | 31 | // wait until body is defined before injecting link. This ensures a non-blocking load in IE11. 32 | function ready( cb ){ 33 | if( doc.body ){ 34 | return cb(); 35 | } 36 | setTimeout(function(){ 37 | ready( cb ); 38 | }); 39 | } 40 | // Inject link 41 | // Note: the ternary preserves the existing behavior of "before" argument, but we could choose to change the argument to "after" in a later release and standardize on ref.nextSibling for all refs 42 | // Note: `insertBefore` is used instead of `appendChild`, for safety re: http://www.paulirish.com/2011/surefire-dom-element-insertion/ 43 | ready( function(){ 44 | ref.parentNode.insertBefore( ss, ( before ? ref : ref.nextSibling ) ); 45 | }); 46 | // A method (exposed on return object for external use) that mimics onload by polling document.styleSheets until it includes the new sheet. 47 | var onloadcssdefined = function( cb ){ 48 | var resolvedHref = ss.href; 49 | var i = sheets.length; 50 | while( i-- ){ 51 | if( sheets[ i ].href === resolvedHref ){ 52 | return cb(); 53 | } 54 | } 55 | setTimeout(function() { 56 | onloadcssdefined( cb ); 57 | }); 58 | }; 59 | 60 | function loadCB(){ 61 | if( ss.addEventListener ){ 62 | ss.removeEventListener( "load", loadCB ); 63 | } 64 | ss.media = media || "all"; 65 | } 66 | 67 | // once loaded, set link's media back to `all` so that the stylesheet applies once it loads 68 | if( ss.addEventListener ){ 69 | ss.addEventListener( "load", loadCB); 70 | } 71 | ss.onloadcssdefined = onloadcssdefined; 72 | onloadcssdefined( loadCB ); 73 | return ss; 74 | }; 75 | // commonjs 76 | if( typeof exports !== "undefined" ){ 77 | exports.loadCSS = loadCSS; 78 | } 79 | else { 80 | w.loadCSS = loadCSS; 81 | } 82 | }( typeof global !== "undefined" ? global : this )); 83 | 84 | /**/ 85 | 86 | (function ($) { 87 | "use strict"; 88 | $(function () { 89 | if( 'undefined'!== typeof WpDisableAsyncLinks && Object.keys(WpDisableAsyncLinks).length ){ 90 | var key; 91 | for(key in WpDisableAsyncLinks){ 92 | if(WpDisableAsyncLinks.hasOwnProperty(key)){ 93 | loadCSS(WpDisableAsyncLinks[key]); 94 | } 95 | } 96 | } 97 | }); 98 | }(jQuery)); -------------------------------------------------------------------------------- /css/optimisationio-import-export.css: -------------------------------------------------------------------------------- 1 | #wpadminbar{ 2 | padding:0; 3 | } 4 | 5 | .wrap-main *, 6 | .wrap-main *:before, 7 | .wrap-main *:after { 8 | box-sizing: border-box; 9 | } 10 | 11 | .wrap-main, 12 | .wrap-imp-exp-nav, 13 | .wrap-imp-exp-content{ 14 | position:relative; 15 | display:inline-block; 16 | width:100%; 17 | } 18 | 19 | .wrap-imp-exp-nav, 20 | .wrap-imp-exp-nav li{ 21 | margin:0; 22 | padding:0; 23 | } 24 | 25 | .wrap-imp-exp-nav{ 26 | float:left; 27 | margin-bottom:-1px; 28 | z-index:+1; 29 | } 30 | 31 | .wrap-imp-exp-nav li{ 32 | float:left; 33 | max-width:50%; 34 | display:inline-block; 35 | font-size: 1.1em; 36 | font-weight:500; 37 | border-width:1px; 38 | border-style:solid; 39 | border-color:#e5e5e5; 40 | border-color:transparent; 41 | } 42 | 43 | .wrap-imp-exp-nav li a{ 44 | display:block; 45 | padding:12px 20px; 46 | text-decoration: none; 47 | color:#858585; 48 | 49 | } 50 | 51 | .wrap-imp-exp-nav li a:focus{ 52 | -webkit-box-shadow:none; 53 | box-shadow:none; 54 | } 55 | 56 | .wrap-imp-exp-nav li:hover{ 57 | background:#e5e5e5; 58 | } 59 | 60 | .wrap-imp-exp-nav li:hover a{ 61 | color:#555; 62 | } 63 | 64 | .wrap-imp-exp-nav li.active{ 65 | border-color:#e5e5e5; 66 | border-bottom-color:#fff; 67 | background:#fff; 68 | -webkit-box-shadow: 0 0px 1px rgba(0,0,0,.04); 69 | box-shadow: 0 0px 1px rgba(0,0,0,.04); 70 | } 71 | 72 | .wrap-imp-exp-nav li.active a{ 73 | color:#23282d; 74 | } 75 | 76 | .wrap-imp-exp-content{ 77 | width:100%; 78 | display:inline-block; 79 | margin-bottom:5px; 80 | border:1px solid #e5e5e5; 81 | background:#fff; 82 | -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.04); 83 | box-shadow: 0 1px 1px rgba(0,0,0,.04); 84 | } 85 | 86 | .wrap-imp-exp-inner{ 87 | padding:10px; 88 | } 89 | 90 | 91 | .wrap-imp-exp-main{ 92 | display:none; 93 | width:100%; 94 | } 95 | 96 | .wrap-imp-exp-main .imp-exp-options{ 97 | float:left; 98 | width:35%; 99 | padding:10px; 100 | } 101 | 102 | .wrap-imp-exp-main .imp-exp-options label{ 103 | display:inline-block; 104 | width:100%; 105 | padding:15px 0; 106 | font-size:1.1em; 107 | font-weight: 500; 108 | line-height:1.5em; 109 | border-bottom:1px solid #e5e5e5; 110 | } 111 | 112 | .wrap-imp-exp-main .imp-exp-options label:last-child{ 113 | padding-bottom:0; 114 | border-bottom-width: 0; 115 | } 116 | 117 | .wrap-imp-exp-main .imp-exp-options label input{ 118 | margin:0 10px 0 0; 119 | } 120 | 121 | .wrap-imp-exp-main .textarea-wrap{ 122 | float:left; 123 | width:65%; 124 | padding:10px; 125 | } 126 | 127 | .wrap-imp-exp-main.c-export .textarea-wrap{ 128 | 129 | } 130 | 131 | .wrap-imp-exp-main .textarea-wrap textarea{ 132 | width:100%; 133 | padding:10px 15px; 134 | min-height:250px; 135 | display:block; 136 | margin:0; 137 | } 138 | 139 | .wrap-imp-exp-main .textarea-wrap textarea[readonly]{ 140 | color:#32373c; 141 | background:#f5f5f5; 142 | } 143 | 144 | .button.import-btn, 145 | .button.export-btn{ 146 | float:left; 147 | display:none; 148 | margin:15px 5px 0 0; 149 | } 150 | 151 | .button.copy-export-btn, 152 | .button.clear-import-btn{ 153 | float:right; 154 | display:none; 155 | margin:15px 0 0 5px; 156 | } 157 | 158 | .import-btn{ 159 | 160 | } 161 | 162 | .export-btn{ 163 | 164 | } 165 | 166 | .copy-export-btn{ 167 | 168 | } 169 | 170 | .clear-import-btn{ 171 | 172 | } 173 | 174 | .view-import .wrap-imp-exp-main.c-import, 175 | .view-import .button.clear-import-btn, 176 | .view-import .button.import-btn, 177 | .view-export .wrap-imp-exp-main.c-export, 178 | .view-export .button.copy-export-btn, 179 | .view-export .button.export-btn{ 180 | display:inline-block; 181 | } 182 | 183 | .button.copy-export-btn.hidden, 184 | .button.clear-import-btn.hidden{ 185 | display:none; 186 | } 187 | 188 | @media (max-width: 991px) { 189 | 190 | .wrap-imp-exp-main .imp-exp-options{ 191 | width:100%; 192 | } 193 | 194 | .wrap-imp-exp-main .textarea-wrap{ 195 | width:100%; 196 | } 197 | 198 | .wrap-imp-exp-main .imp-exp-options label{ 199 | line-height:2em; 200 | } 201 | } -------------------------------------------------------------------------------- /changelog.txt: -------------------------------------------------------------------------------- 1 | = 1.3.22 = 2 | Added ability to Import and Export settings between sites 3 | Removed Visual Banner Ads from inside plugin 4 | Fix - Keep Active Tab State after saving 5 | Please note *** if you use either our cache or image compression plugin, they both need to be updated to take full advantage of these changes*** 6 | 7 | = 1.3.21 = 8 | Further cleanup to Navigation 9 | Fixed Pagination 10 | Improvements based on Settings --> Discussion core features 11 | **NEW Features:** 12 | Better Stats on Dashboard 13 | Disable loading dashicons on front end if admin bar disabled 14 | Disable Author Pages 15 | One click addon for Cache, CDN paths and Image Optimisation 16 | 17 | = 1.3.20 = 18 | Added Dashboard to show stats (work in progress) - aim is to get rid of the sidebar ads 19 | Moving towards a Modular version to enable a cleaner panel for users. 20 | Improved function checks for is WooCommerce active 21 | Improved Settings layout 22 | Added better analysis to help us improve. 23 | 24 | = 1.3.12 = 25 | Fix to Some features not showing on existing installs 26 | Updated menu icon 27 | tidied up navigation 28 | Removed Admin bar navigation 29 | 30 | = 1.3.11 = 31 | Added support for Heartbeat (please remove any other heartbeat plugins) 32 | Fixed sidebar navigation 33 | Added a top navigation for easy access (to support upcoming features) 34 | Fixed Remove RSD error 35 | General code tidy up and removed unused functions 36 | 37 | = 1.3.1 = 38 | Cleaned up navigation (moved to Optimisation.io in WP menu) 39 | 40 | = 1.3.0 = 41 | Added default option to Google Analytics to make it more clear when its active 42 | Option to Remove password strength meter js on non woo pages 43 | Added option to completely disable comments 44 | Improved folder/file structure 45 | Added option to disable feed, replaced Disable RSS 46 | Added option to remove spam comments 47 | Option to combine and async Google Fonts and Font awesome fonts for better performance 48 | Removed old versions from WP Repo for better WP Compliance 49 | 50 | = 1.2.26 = 51 | * Improved visuals 52 | * Cleaner Code, fixed issue that breaks access on some installs 53 | 54 | = 1.2.25 = 55 | * Bug fix breaking css on woo checkout pages 56 | 57 | = 1.2.24 = 58 | * Added ability to remove Ajax calls for WooCommerce on home page 59 | = 1.2.23 = 60 | * Fixed bug in GA Local 61 | 62 | = 1.2.22 = 63 | * Minor text clean up 64 | 65 | = 1.2.21 = 66 | * Fixed Google Maps bug where maps not showing 67 | 68 | = 1.2.2 = 69 | * Fix for GA bug where it disables tracking completely 70 | * IMPORTANT! please ensure you Disable any other GA tracking you have active 71 | * Moved Navigation under Tools to free up the sidebar 72 | * Minor edits on WooCommerce cleanup logic 73 | 74 | = 1.2.1 = 75 | * Fix GA options not saving 76 | 77 | = 1.2.0 = 78 | * Major update: 79 | * Added the ability to Cache Google Analytics scripts 80 | * Added the ability to remove Google Maps calls if your theme has it embedded but you don't want or use it. 81 | * Small bug fixes and general tidy up 82 | * Added links to our Caching Plugin and Image Compression 83 | 84 | 85 | = 1.1.9 = 86 | Fixed bug in querystrings not disabling fully 87 | 88 | = 1.1.8 = 89 | Small bug fix where we were showing other plugin notifications inside ours 90 | 91 | = 1.1.7 = 92 | Mainly Visual changes & prep for caching integration 93 | 94 | = 1.1.6 = 95 | Remove Query string activation crash fixed 96 | 97 | = 1.1.5 = 98 | Fixed bug on saving tabs from 1.1.4 99 | 100 | = 1.1.4 = 101 | Added a tabbed navigation for easier usability. 102 | 103 | = 1.1.3 = 104 | Added support for: Disable RSS, XML-RPC, Autosave, RSD, Windows Live Writer tag, Shortlink Tag, WP API from header which in a lot of sites can shave over 1 second on page load. 105 | 106 | = 1.1.2 = 107 | Added support for disable ping/trackbacks 108 | Added the ability to close comments after 28 days 109 | Added the ability to force pagination after 20 posts 110 | Added Disable WooCommerce scripts and CSS on non WooCommerce Pages 111 | 112 | = 1.0 = 113 | * Initial commit 114 | 115 | == Upgrade Notice == 116 | 117 | = 1.0 = 118 | Nothing here yet 119 | -------------------------------------------------------------------------------- /views/optimisationio-dashboard.php: -------------------------------------------------------------------------------- 1 | 4 |
5 | 6 |
7 | 8 |
9 | 10 |
11 | 12 |
13 | 16 |
17 | 18 |
19 |
20 | 21 |
22 |
23 | 24 | 25 | 26 |
    27 |
  • 28 |
  • 29 |
  • 30 |
31 | 32 |
33 | 34 |
42 |
43 | 44 |
52 |
53 | 54 |
62 |
63 | 64 |
65 | 66 |
67 | 68 |
69 | 70 | 91 | 92 | 118 | 119 |
120 | 121 | 122 | 123 |
124 | -------------------------------------------------------------------------------- /views/optimisationio-statistics-addons.php: -------------------------------------------------------------------------------- 1 | 4 |
5 | 6 |
7 | 8 |
9 | 10 |
11 | 12 |
13 | 16 |
17 | 18 |
19 |
20 | 21 |
22 |
23 | 24 | 25 | 26 |
    27 |
  • 28 |
  • 29 |
  • 30 |
31 | 32 |
33 | 34 |
42 |
43 | 44 |
52 |
53 | 54 |
62 |
63 | 64 |
65 | 66 |
67 | 68 |
69 | 70 | 133 | 134 |
135 | 136 | 137 | 138 |
-------------------------------------------------------------------------------- /wpperformance.php: -------------------------------------------------------------------------------- 1 | Open Settings 6 | * Author: optimisation.io, hosting.io 7 | * Author URI:https://optimisation.io 8 | * Version: 1.5.14 9 | * 10 | * Copyright (C) 2017 Optimisation.io 11 | */ 12 | 13 | // If this file is called directly, abort. 14 | if ( ! defined( 'WPINC' ) ) { die; } 15 | 16 | define( 'OPTIMISATIONIO_WP_DISABLE_ADDON', true); 17 | 18 | require_once 'lib/class-wpperformance.php'; 19 | require_once 'lib/class-wpperformance-view.php'; 20 | require_once 'lib/class-wpperformance-admin.php'; 21 | 22 | /** 23 | * On plugin activation. 24 | */ 25 | function wpperformance_on_activate() { 26 | 27 | WpPerformance::check_spam_comments_delete(); 28 | 29 | wp_clear_scheduled_hook( 'update_local_ga' ); 30 | 31 | if ( ! wp_next_scheduled( 'update_local_ga' ) ) { 32 | $settings = get_option( WpPerformance::OPTION_KEY . '_settings', array() ); 33 | if( isset( $settings['caos_remove_wp_cron'] ) && $settings['caos_remove_wp_cron'] && 34 | 'on' !== esc_attr( $settings['caos_remove_wp_cron'] ) 35 | ){ 36 | wp_schedule_event( time(), 'daily', 'update_local_ga' ); 37 | } 38 | } 39 | } 40 | 41 | /** 42 | * On plugin deactivation. 43 | */ 44 | function wpperformance_on_deactivate() { 45 | 46 | WpPerformance::delete_transients(); 47 | WpPerformance::unschedule_spam_comments_delete(); 48 | 49 | if ( wp_next_scheduled( 'update_local_ga' ) ) { 50 | wp_clear_scheduled_hook( 'update_local_ga' ); 51 | } 52 | } 53 | 54 | // Register hook to schedule script in wp_cron(). 55 | register_activation_hook( __FILE__, 'wpperformance_on_activate' ); 56 | 57 | // Remove script from wp_cron upon plugin deactivation. 58 | register_deactivation_hook( __FILE__, 'wpperformance_on_deactivate' ); 59 | 60 | /** 61 | * Include file 'includes/update-local-ga.php'. 62 | */ 63 | function wpperformance_update_local_ga_script() { 64 | include( 'includes/update-local-ga.php' ); 65 | } 66 | 67 | // Load update script to schedule in wp_cron. 68 | add_action( 'update_local_ga', 'wpperformance_update_local_ga_script' ); 69 | 70 | /** 71 | * Initialize WP_Filesystem if hasn't inited yet. 72 | */ 73 | function wpperformance_init_wp_filesystem() { 74 | global $wp_filesystem; 75 | if ( null === $wp_filesystem ) { 76 | if ( ! function_exists( 'WP_Filesystem' ) ) { 77 | require_once( ABSPATH . 'wp-admin/includes/file.php' ); 78 | } 79 | WP_Filesystem(); 80 | } 81 | } 82 | 83 | /** 84 | * Disable Google maps ob_end. 85 | */ 86 | function wpperformance_disable_google_maps_ob_end( $html ) { 87 | global $post; 88 | $exclude_ids = []; 89 | $settings = get_option( WpPerformance::OPTION_KEY . '_settings', array() ); 90 | if ( isset( $settings['exclude_from_disable_google_maps'] ) && '' !== $settings['exclude_from_disable_google_maps'] ) { 91 | $exclude_ids = array_map( 'intval', explode(',', $settings['exclude_from_disable_google_maps']) ); 92 | } 93 | if( $post && ! in_array( $post->ID, $exclude_ids, true ) ){ 94 | $html = preg_replace( '/]*\/\/maps.(googleapis|google|gstatic).com\/[^<>]*><\/script>/i', '', $html ); 95 | } 96 | return $html; 97 | } 98 | 99 | /** 100 | * Generate tracking code and add to header/footer (default is header). 101 | */ 102 | function wpperformance_add_ga_header_script() { 103 | 104 | $settings = get_option( WpPerformance::OPTION_KEY . '_settings', array() ); 105 | 106 | $ds_track_admin = isset( $settings['ds_track_admin'] ) && $settings['ds_track_admin'] ? esc_attr( $settings['ds_track_admin'] ) : false; 107 | 108 | // If user is admin we don't want to render the tracking code, when option is disabled. 109 | if ( current_user_can( 'manage_options' ) && ( ! $ds_track_admin) ) { return; } 110 | 111 | $ds_tracking_id = isset( $settings['ds_tracking_id'] ) && $settings['ds_tracking_id'] ? esc_attr( $settings['ds_tracking_id'] ) : ''; 112 | 113 | $ds_adjusted_bounce_rate = isset( $settings['ds_adjusted_bounce_rate'] ) && $settings['ds_adjusted_bounce_rate'] ? esc_attr( $settings['ds_adjusted_bounce_rate'] ) : 0; 114 | 115 | $ds_anonymize_ip = isset( $settings['ds_anonymize_ip'] ) && $settings['ds_anonymize_ip'] ? esc_attr( $settings['ds_anonymize_ip'] ) : null; 116 | 117 | $caos_disable_display_features = isset( $settings['caos_disable_display_features'] ) && $settings['caos_disable_display_features'] ? esc_attr( $settings['caos_disable_display_features'] ) : 'off'; 118 | 119 | echo ''; 120 | 121 | echo "'; 138 | } 139 | 140 | function wpperformance_cron_additions( $schedules ) { 141 | 142 | $schedules['weekly'] = array( 143 | 'interval' => 86400 * 7, 144 | 'display' => __( 'Once Weekly' ), 145 | ); 146 | 147 | $schedules['twicemonthly'] = array( 148 | 'interval' => 86400 * 14, 149 | 'display' => __( 'Twice Monthly' ), 150 | ); 151 | 152 | $schedules['monthly'] = array( 153 | 'interval' => 86400 * 30, 154 | 'display' => __( 'Once Monthly' ), 155 | ); 156 | 157 | return $schedules; 158 | } 159 | 160 | add_filter( 'cron_schedules', 'wpperformance_cron_additions' ); 161 | 162 | add_action( 'plugins_loaded', array( 'WpPerformance', 'get_instance' ) ); 163 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === Reduce HTTP Requests, Disable Emojis & Disable Embeds, Speedup WooCommerce === 2 | Contributors: optimisation.io, hosting.io 3 | Tags: Disable Emoji, Disable Embeds, Disable Gravatars, Remove Querystrings, Reduce HTTP Requests, speedup WooCommerce, Close comments, Optimization 4 | Requires at least: 4.5 5 | Tested up to: 4.9 6 | Stable tag: 1.5.14 7 | License: GPLv2 or later 8 | License URI: https://www.gnu.org/licenses/gpl-2.0.html 9 | 10 | Reduce HTTP requests - Disable Emojis, Disable Gravatars, Disable Embeds and Remove Querystrings. SpeedUp WooCommerce, Added support to disable pingbacks, disable trackbacks, close comments after 28 days, Added the ability to force pagingation after 20 posts, 11 | Disable WooCommerce scripts and CSS on non WooCommerce Pages, Disable RSS, Disable XML-RPC, Disable Autosave, Remove Windows Live Writer tag, Remove Shortlink Tag, Remove WP API from header and 12 | many more features to help speed and SEO gains. 13 | 14 | == Description == 15 | Reduce HTTP requests - Disable Emojis, Disable Gravatars, Disable Embeds and Remove Querystrings. SpeedUp WooCommerce, Added support to disable pingbacks, disable trackbacks, close comments after 28 days, Added the ability to force pagingation after 20 posts, 16 | Disable WooCommerce scripts and CSS on non WooCommerce Pages, Disable RSS, Disable XML-RPC, Disable Autosave, Remove Windows Live Writer tag, Remove Shortlink Tag, Remove WP API from header and 17 | many more features to help speed and SEO gains. Now includes Disable Comments, Heartbeat Control, Selective Disable 18 | 19 | **NEW Features:** 20 | Better Stats on Dashboard 21 | Disable loading dashicons on front end if admin bar disabled 22 | Disable Author Pages 23 | 24 | Disabling Emojis does not disable emoticons, it disables the support for Emojis added since WP 4.2 and removes 1 HTTP request.
25 | 26 | Disabling Embeds - script that auto formats pasted content in the visual editor, eg videos, etc. Big issue with this script is it loads on every 27 | single page. You can still use the default embed code from YouTube, Twitter etc to included content. 28 | 29 | Remove Query Strings: If you look at the waterfall view of your page load, you will see your query strings end in something like ver=1.12.4. 30 | These are called query strings and help determine the version of the script. The problem with query strings like these is that it isn't very efficient for caching purposes and sometimes prevents caching those assets altogether. If you are using a CDN already, you can ignore this. 31 | 32 | Disabling Gravatars is completely optional, advise, if you don't use them, disable as it gets rid of one more useless HTTP request. 33 | 34 | General Performance improvements: Added support for : disable ping/trackbacks, close comments after 28 days, force pagingation after 20 posts, Disable WooCommerce scripts and CSS on non WooCommerce Pages. 35 | 36 | Have an idea ?
37 | Public repo on GitHub if you would like to contribute or have any ideas to add. 38 | 39 | == Installation == 40 | 41 | This section describes how to install the plugin and get it working. 42 | 43 | 1. Upload the plugin files to the `/wp-content/plugins/plugin-name` directory, or install the plugin through the WordPress plugins screen directly. 44 | 2. Activate the plugin through the 'Plugins' screen in WordPress 45 | 3. Use the Settings->WP Disable screen to configure the plugin 46 | 47 | 48 | == Frequently Asked Questions == 49 | 50 | = I would like to contribute/I have an idea = 51 | 52 | Public repo on GitHub if you would like to contribute or have any ideas to add. 53 | 54 | = Do I still need caching ? = 55 | 56 | Yes, We have just release a WordPress Caching plugin which is really easy to setup and includes a built in CD-rewrite rule system.
57 | 58 | = What about Minification, do I still need it? = 59 | 60 | Yes, you absolutely do, and none come close to the awesome Autoptimize by Frank Goossens. 61 | 62 | = Do I still need a CDN ? = 63 | 64 | Yes, WarpCache is our recommended choice for the ultimate in flexibility and performance.
65 | We will soon be adding a free CDN for css/js for all users that is integrated with just an "on/off" switch in the plugin and no setup. 66 | 67 | = What about my Image Compression = 68 | 69 | You can try our Free Image Compression plugin which has really good compression ratios with little to no loss of image quality. 70 | 71 | == Screenshots == 72 | 1. Plugin Interface 73 | 2. Pingdom Report 74 | 4. Fast Hosting Servers make a difference to overall performance 75 | 4. Because Speed Matters (tm) 76 | 77 | 78 | == Changelog == 79 | = 1.5.14 = 80 | * Started on Documentation 81 | * Added donation button - help us make this the best optimisation suite available on the repo. Every $ donated helps. 82 | * Added SEO Tab 83 | * Added ability to remove Duplicate names in breadcrumbs 84 | * Added Remove Yoast SEO comments 85 | * Tested on Gutenberg 86 | * Tested on WP 4.9 87 | * Remove Dequeue from some functions 88 | * Disabled Dashicons in Customizer 89 | * Minor bug fixes as per support forum 90 | 91 | 92 | = 1.5.13 = 93 | * Added Settings link on main Installed Plugin view 94 | * General code tidy up 95 | * PHP 7.1 compatabile 96 | * WP 4.8.2 tested 97 | 98 | = 1.5.12 = 99 | * WooCommerce bugs fixed 100 | * Syntax error fixed 101 | * General improvements to GA Offload (Some cases GA code may still not work, does not appear to be a fix for this, if this happens on yours, please ignore the feature) 102 | 103 | = 1.5.11 = 104 | * WooCommerce tab not displaying fixed 105 | 106 | = 1.5.1 = 107 | * More visual cleanups 108 | * Removed all webfonts 109 | * Minor bug fix on reporting on dashboard 110 | * Plugin is now under 240kb 111 | 112 | = 1.5.0 = 113 | * Finished redesign of plugin 114 | * All stats now in one central dashboard 115 | * Removed sidebar navigation completely 116 | * Remobed Freemius 117 | * Added check for WooCommerce, so Woo related stuff only shows if Woo is installed 118 | * Much tighter integration between the 3 optimisation plugins 119 | * Removed old/excess files 120 | 121 | 122 | = 1.4.5 = 123 | * More visual fixes/general tidy up 124 | * Added exception to Google Maps so can be enabled per page 125 | * Minor code fixes 126 | * Moved Google Analytics to sidebar/addons 127 | 128 | = 1.4.4 = 129 | * Added ability to stop (disable) admin notices from showing 130 | * removed the stats sub menu item, so everything is now at the top level 131 | * "local-ga.js" file was created on activation, changed the way this works so it will work now independent of when adding the GA code 132 | 133 | = 1.4.3 = 134 | More dashboard visual tweaks. 135 | No new features, but this is a stepping stone. 136 | 137 | = 1.4.2 = 138 | * General tidy up on dashboard 139 | 140 | = 1.4.1 = 141 | * removed third party errors out of our dashboard to the top of the page where they belong 142 | * cleaned out redundant data in GA cache file 143 | 144 | = 1.4.0 = 145 | * New Dashboard Design (Work in progress) 146 | * Added Average load time of pages to stats 147 | * Remove Comments navigation when comments disabled 148 | * Added the ability to block referrer spam (using Piwik Database) 149 | * Updated Import/Export settings to now include settings for Image Compression and Cache plugins (if active) 150 | * General code improvements 151 | -------------------------------------------------------------------------------- /views/optimisationio-import-export.php: -------------------------------------------------------------------------------- 1 | __( '%1$s Optimisation.io - Import/Export add-ons settings %2$s', 'optimisationio' ) ); 4 | $base_curr_url = admin_url('admin.php?page=optimisationio-import-export'); 5 | $addons = Optimisationio_Stats_And_Addons::$addons; 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 | $val) { 32 | if( $val['activated'] ){ ?> 33 | 34 | 36 |
37 |
38 |
39 |
40 |
41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
49 | 50 | 51 |
52 | 53 | -------------------------------------------------------------------------------- /css/wp-disable-style.css: -------------------------------------------------------------------------------- 1 | /* line 1, ../sass/wp-disable-style.scss */ 2 | .wp-disable { 3 | /* The switch - the box around the slider */ 4 | /* Hide default HTML checkbox */ 5 | /* The slider */ 6 | /* Rounded sliders */ 7 | } 8 | /* line 2, ../sass/wp-disable-style.scss */ 9 | .wp-disable header { 10 | background: #c5ccce; 11 | color: #66666b; 12 | padding: 35px; 13 | border-radius: 10px 10px 0 0; 14 | } 15 | /* line 8, ../sass/wp-disable-style.scss */ 16 | .wp-disable header .col-left { 17 | display: inline-block; 18 | width: 59%; 19 | } 20 | /* line 12, ../sass/wp-disable-style.scss */ 21 | .wp-disable header .col-left h2 { 22 | color: #66666b; 23 | font-size: 22px; 24 | font-weight: 400; 25 | margin: 0; 26 | margin-bottom: 10px; 27 | } 28 | /* line 20, ../sass/wp-disable-style.scss */ 29 | .wp-disable header .col-left small { 30 | font-size: 14px; 31 | font-weight: 100; 32 | color: #66666b; 33 | } 34 | /* line 27, ../sass/wp-disable-style.scss */ 35 | .wp-disable header .col-right { 36 | display: inline-block; 37 | text-align: right; 38 | width: 40%; 39 | } 40 | /* line 31, ../sass/wp-disable-style.scss */ 41 | .wp-disable header .col-right a { 42 | background: #fff885 none repeat scroll 0 0; 43 | color: #928a07; 44 | font-size: 12px; 45 | text-decoration: none; 46 | padding: 5px 15px; 47 | border-radius: 20px; 48 | } 49 | /* line 39, ../sass/wp-disable-style.scss */ 50 | .wp-disable header .col-right > p { 51 | margin: 5px auto; 52 | } 53 | /* line 43, ../sass/wp-disable-style.scss */ 54 | .wp-disable header .col-right small { 55 | background: #f65428 none repeat scroll 0 0; 56 | border-radius: 1px; 57 | font-size: 13px; 58 | padding: 2px 13px 3px; 59 | } 60 | /* line 52, ../sass/wp-disable-style.scss */ 61 | .wp-disable .container { 62 | /*background: #fff;*/ 63 | padding: 35px 20px; 64 | display: block; 65 | } 66 | /* line 59, ../sass/wp-disable-style.scss */ 67 | .wp-disable .container .tab-wrap { 68 | float: left; 69 | padding: 0 15px 0 0; 70 | width: 100%; 71 | } 72 | /* line 64, ../sass/wp-disable-style.scss */ 73 | .wp-disable .container .tab-wrap ul.tabs { 74 | margin: 0px; 75 | padding: 0px; 76 | list-style: none; 77 | } 78 | /* line 68, ../sass/wp-disable-style.scss */ 79 | .wp-disable .container .tab-wrap ul.tabs li { 80 | background: #c5ccce; 81 | border-radius: 5px 5px 0 0; 82 | color: #797979; 83 | cursor: pointer; 84 | display: inline-block; 85 | float: left; 86 | margin: 0 3px 0 0; 87 | padding: 15px 25px; 88 | font-size: 16px; 89 | } 90 | /* line 79, ../sass/wp-disable-style.scss */ 91 | .wp-disable .container .tab-wrap ul.tabs li.current { 92 | background: #f5f5f5; 93 | color: #797979; 94 | } 95 | /* line 87, ../sass/wp-disable-style.scss */ 96 | .wp-disable .container .tab-wrap .tab-content { 97 | display: none; 98 | background: #f5f5f5; 99 | clear: both; 100 | padding: 15px; 101 | border-radius: 0 5px 5px 5px; 102 | } 103 | /* line 94, ../sass/wp-disable-style.scss */ 104 | .wp-disable .container .tab-wrap .tab-content.current { 105 | display: inherit; 106 | } 107 | /* line 99, ../sass/wp-disable-style.scss */ 108 | .wp-disable .container .tab-wrap .panel { 109 | margin: 20px auto; 110 | padding: 20px; 111 | background: #f7b66d; 112 | border-radius: 5px; 113 | } 114 | /* line 105, ../sass/wp-disable-style.scss */ 115 | .wp-disable .container .tab-wrap .panel h3 { 116 | color: white; 117 | font-size: 20px; 118 | text-align: center; 119 | } 120 | /* line 111, ../sass/wp-disable-style.scss */ 121 | .wp-disable .container .tab-wrap .panel.featured-panel.stye-1 { 122 | background: #23458b none repeat scroll 0 0; 123 | } 124 | /* line 115, ../sass/wp-disable-style.scss */ 125 | .wp-disable .container .tab-wrap .panel .pane-head { 126 | display: block; 127 | width: 100%; 128 | } 129 | /* line 118, ../sass/wp-disable-style.scss */ 130 | .wp-disable .container .tab-wrap .panel .pane-head a { 131 | display: block; 132 | } 133 | /* line 121, ../sass/wp-disable-style.scss */ 134 | .wp-disable .container .tab-wrap .panel .pane-head a.just-link { 135 | text-decoration: none; 136 | background: #d4d4d4; 137 | padding: 10px 15px; 138 | font-size: 16px; 139 | color: #585858; 140 | border-radius: 0 0 5px 5px; 141 | } 142 | /* line 129, ../sass/wp-disable-style.scss */ 143 | .wp-disable .container .tab-wrap .panel .pane-head a.just-link:hover { 144 | background: #c7c6c6; 145 | } 146 | /* line 134, ../sass/wp-disable-style.scss */ 147 | .wp-disable .container .tab-wrap .panel .pane-head img { 148 | display: block; 149 | width: 100%; 150 | } 151 | /* line 140, ../sass/wp-disable-style.scss */ 152 | .wp-disable .container .tab-wrap .panel.featured-panel { 153 | background: #f65428 none repeat scroll 0 0; 154 | margin-bottom: 13px; 155 | padding: 1px; 156 | } 157 | /* line 147, ../sass/wp-disable-style.scss */ 158 | .wp-disable .container .btn-submit { 159 | background: #00CDBF; 160 | color: #05867d; 161 | height: auto; 162 | padding: 10px 30px; 163 | text-decoration: none; 164 | text-shadow: unset; 165 | box-shadow: none; 166 | border: none; 167 | margin-top: 20px; 168 | font-size: 18px; 169 | text-transform: uppercase; 170 | border-radius: 100px; 171 | } 172 | /* line 161, ../sass/wp-disable-style.scss */ 173 | .wp-disable .container .btn-submit:hover { 174 | background: #12c7bb; 175 | color: #05867d; 176 | } 177 | /* line 167, ../sass/wp-disable-style.scss */ 178 | .wp-disable .container .disable-form .form-group { 179 | display: block; 180 | padding: 15px 10px; 181 | border-bottom: 1px solid #ccc; 182 | min-height: 34px; 183 | line-height: 34px; 184 | } 185 | /* line 174, ../sass/wp-disable-style.scss */ 186 | .wp-disable .container .disable-form .form-group:last-child { 187 | border: none; 188 | } 189 | /* line 178, ../sass/wp-disable-style.scss */ 190 | .wp-disable .container .disable-form .form-group span { 191 | font-size: 16px; 192 | color: #797979; 193 | } 194 | /* line 188, ../sass/wp-disable-style.scss */ 195 | .wp-disable .side-bar { 196 | padding: 0 0 0 18px; 197 | width: 39%; 198 | display: inline-block; 199 | } 200 | /* line 193, ../sass/wp-disable-style.scss */ 201 | .wp-disable .side-bar h3 { 202 | background: #c5ccce; 203 | border-radius: 5px 5px 0 0; 204 | color: #797979; 205 | margin: 0; 206 | padding: 10px 25px; 207 | line-height: 25px; 208 | font-weight: 400; 209 | } 210 | /* line 282, ../sass/wp-disable-style.scss */ 211 | .wp-disable .side-bar .pane-head a img { 212 | display: block; 213 | width: 100%; 214 | border-radius: 5px; 215 | margin-bottom: 20px; 216 | } 217 | /* line 290, ../sass/wp-disable-style.scss */ 218 | .wp-disable .side-bar .pane-head h2 { 219 | color: white; 220 | line-height: 22px; 221 | text-align: center; 222 | } 223 | /* line 296, ../sass/wp-disable-style.scss */ 224 | .wp-disable .side-bar .pane-head h3 { 225 | background: #bfbfbf; 226 | color: #737373; 227 | margin: 0 auto; 228 | text-align: center; 229 | } 230 | /* line 307, ../sass/wp-disable-style.scss */ 231 | .wp-disable .check_options { 232 | font-weight: bold; 233 | } 234 | /* line 312, ../sass/wp-disable-style.scss */ 235 | .wp-disable .stars { 236 | float: right; 237 | height: 19px; 238 | background: transparent url("/wp-content/plugins/wp-disable/images/stars.jpg") repeat scroll 0 0; 239 | width: 100px; 240 | } 241 | @media (max-width: 768px) { 242 | /* line 320, ../sass/wp-disable-style.scss */ 243 | .wp-disable .tab-wrap { 244 | width: 96%; 245 | } 246 | /* line 323, ../sass/wp-disable-style.scss */ 247 | .wp-disable .col-left, .wp-disable .col-right, .wp-disable .side-bar { 248 | width: 100%; 249 | } 250 | /* line 326, ../sass/wp-disable-style.scss */ 251 | .wp-disable .col-right a { 252 | display: block; 253 | } 254 | } 255 | /* line 332, ../sass/wp-disable-style.scss */ 256 | .wp-disable .switch { 257 | position: relative; 258 | display: inline-block; 259 | width: 60px; 260 | height: 34px; 261 | float: right; 262 | } 263 | /* line 341, ../sass/wp-disable-style.scss */ 264 | .wp-disable .switch input { 265 | display: none; 266 | } 267 | /* line 344, ../sass/wp-disable-style.scss */ 268 | .wp-disable .slider { 269 | position: absolute; 270 | cursor: pointer; 271 | top: 0; 272 | left: 0; 273 | right: 0; 274 | bottom: 0; 275 | background-color: #F37E67; 276 | -webkit-transition: .4s; 277 | transition: .4s; 278 | } 279 | /* line 356, ../sass/wp-disable-style.scss */ 280 | .wp-disable .slider:before { 281 | position: absolute; 282 | content: ""; 283 | height: 26px; 284 | width: 26px; 285 | left: 4px; 286 | bottom: 4px; 287 | background-color: white; 288 | -webkit-transition: .4s; 289 | transition: .4s; 290 | } 291 | /* line 368, ../sass/wp-disable-style.scss */ 292 | .wp-disable input:checked + .slider { 293 | background-color: #00CDBF; 294 | } 295 | /* line 372, ../sass/wp-disable-style.scss */ 296 | .wp-disable input:focus + .slider { 297 | box-shadow: 0 0 1px #2196F3; 298 | } 299 | /* line 376, ../sass/wp-disable-style.scss */ 300 | .wp-disable input:checked + .slider:before { 301 | -webkit-transform: translateX(26px); 302 | -ms-transform: translateX(26px); 303 | transform: translateX(26px); 304 | } 305 | /* line 383, ../sass/wp-disable-style.scss */ 306 | .wp-disable .slider.round { 307 | border-radius: 34px; 308 | } 309 | /* line 387, ../sass/wp-disable-style.scss */ 310 | .wp-disable .slider.round:before { 311 | border-radius: 50%; 312 | } 313 | -------------------------------------------------------------------------------- /js/clipboard.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * clipboard.js v1.7.1 3 | * https://zenorocha.github.io/clipboard.js 4 | * 5 | * Licensed MIT © Zeno Rocha 6 | */ 7 | !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Clipboard=t()}}(function(){var t,e,n;return function t(e,n,o){function i(a,c){if(!n[a]){if(!e[a]){var l="function"==typeof require&&require;if(!c&&l)return l(a,!0);if(r)return r(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){var n=e[a][1][t];return i(n||t)},u,u.exports,t,e,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function t(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function t(){var e=this,n="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[n?"right":"left"]="-9999px";var o=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=o+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,i.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function t(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function t(){this.selectedText=(0,i.default)(this.target),this.copyText()}},{key:"copyText",value:function t(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function t(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function t(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function t(){this.removeFake()}},{key:"action",set:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function t(){return this._action}},{key:"target",set:function t(e){if(void 0!==e){if(!e||"object"!==(void 0===e?"undefined":r(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function t(){return this._target}}]),t}();t.exports=c})},{select:5}],8:[function(e,n,o){!function(i,r){if("function"==typeof t&&t.amd)t(["module","./clipboard-action","tiny-emitter","good-listener"],r);else if(void 0!==o)r(n,e("./clipboard-action"),e("tiny-emitter"),e("good-listener"));else{var a={exports:{}};r(a,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=a.exports}}(this,function(t,e,n,o){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function l(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}var s=i(e),u=i(n),f=i(o),d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===d(e.container)?e.container:document.body}},{key:"listenClick",value:function t(e){var n=this;this.listener=(0,f.default)(e,"click",function(t){return n.onClick(t)})}},{key:"onClick",value:function t(e){var n=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new s.default({action:this.action(n),target:this.target(n),text:this.text(n),container:this.container,trigger:n,emitter:this})}},{key:"defaultAction",value:function t(e){return l("action",e)}},{key:"defaultTarget",value:function t(e){var n=l("target",e);if(n)return document.querySelector(n)}},{key:"defaultText",value:function t(e){return l("text",e)}},{key:"destroy",value:function t(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],n="string"==typeof e?[e]:e,o=!!document.queryCommandSupported;return n.forEach(function(t){o=o&&!!document.queryCommandSupported(t)}),o}}]),e}(u.default);t.exports=p})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)}); -------------------------------------------------------------------------------- /css/style.css: -------------------------------------------------------------------------------- 1 | /* line 2, ../sass/style.scss */ 2 | .wp-disable header { 3 | background: #c5ccce; 4 | color: #66666b; 5 | padding: 35px; 6 | border-radius: 10px 10px 0 0; 7 | } 8 | /* line 8, ../sass/style.scss */ 9 | .wp-disable header .col-left { 10 | display: inline-block; 11 | width: 59%; 12 | } 13 | /* line 12, ../sass/style.scss */ 14 | .wp-disable header .col-left h2 { 15 | color: #66666b; 16 | font-size: 22px; 17 | font-weight: 400; 18 | margin: 0; 19 | margin-bottom: 10px; 20 | } 21 | /* line 20, ../sass/style.scss */ 22 | .wp-disable header .col-left small { 23 | font-size: 14px; 24 | font-weight: 100; 25 | color: #66666b; 26 | } 27 | /* line 27, ../sass/style.scss */ 28 | .wp-disable header .col-right { 29 | display: inline-block; 30 | text-align: right; 31 | width: 40%; 32 | } 33 | /* line 31, ../sass/style.scss */ 34 | .wp-disable header .col-right a { 35 | background: #fff885 none repeat scroll 0 0; 36 | color: #928a07; 37 | font-size: 12px; 38 | text-decoration: none; 39 | padding: 5px 15px; 40 | border-radius: 20px; 41 | } 42 | /* line 39, ../sass/style.scss */ 43 | .wp-disable header .col-right > p { 44 | margin: 5px auto; 45 | } 46 | /* line 43, ../sass/style.scss */ 47 | .wp-disable header .col-right small { 48 | background: #f65428 none repeat scroll 0 0; 49 | border-radius: 1px; 50 | font-size: 13px; 51 | padding: 2px 13px 3px; 52 | } 53 | /* line 52, ../sass/style.scss */ 54 | .wp-disable .container { 55 | background: #fff; 56 | padding: 35px 20px; 57 | display: block; 58 | } 59 | /* line 59, ../sass/style.scss */ 60 | .wp-disable .container .tab-wrap { 61 | float: left; 62 | padding: 0 15px; 63 | width: 57%; 64 | } 65 | /* line 64, ../sass/style.scss */ 66 | .wp-disable .container .tab-wrap ul.tabs { 67 | margin: 0px; 68 | padding: 0px; 69 | list-style: none; 70 | } 71 | /* line 68, ../sass/style.scss */ 72 | .wp-disable .container .tab-wrap ul.tabs li { 73 | background: #c5ccce; 74 | border-radius: 5px 5px 0 0; 75 | color: #797979; 76 | cursor: pointer; 77 | display: inline-block; 78 | float: left; 79 | margin: 0 3px 0 0; 80 | padding: 15px 25px; 81 | font-size: 16px; 82 | } 83 | /* line 79, ../sass/style.scss */ 84 | .wp-disable .container .tab-wrap ul.tabs li.current { 85 | background: #efefef; 86 | color: #797979; 87 | } 88 | /* line 87, ../sass/style.scss */ 89 | .wp-disable .container .tab-wrap .tab-content { 90 | display: none; 91 | background: #efefef; 92 | clear: both; 93 | padding: 15px; 94 | border-radius: 0 5px 5px 5px; 95 | } 96 | /* line 94, ../sass/style.scss */ 97 | .wp-disable .container .tab-wrap .tab-content.current { 98 | display: inherit; 99 | } 100 | /* line 99, ../sass/style.scss */ 101 | .wp-disable .container .tab-wrap .panel { 102 | margin: 20px auto; 103 | padding: 20px; 104 | background: #f7b66d; 105 | border-radius: 5px; 106 | } 107 | /* line 105, ../sass/style.scss */ 108 | .wp-disable .container .tab-wrap .panel h3 { 109 | color: white; 110 | font-size: 20px; 111 | text-align: center; 112 | } 113 | /* line 111, ../sass/style.scss */ 114 | .wp-disable .container .tab-wrap .panel.featured-panel.stye-1 { 115 | background: #23458b none repeat scroll 0 0; 116 | } 117 | /* line 115, ../sass/style.scss */ 118 | .wp-disable .container .tab-wrap .panel .pane-head { 119 | display: block; 120 | width: 100%; 121 | } 122 | /* line 118, ../sass/style.scss */ 123 | .wp-disable .container .tab-wrap .panel .pane-head a { 124 | display: block; 125 | } 126 | /* line 121, ../sass/style.scss */ 127 | .wp-disable .container .tab-wrap .panel .pane-head a.just-link { 128 | text-decoration: none; 129 | background: #d4d4d4; 130 | padding: 10px 15px; 131 | font-size: 16px; 132 | color: #585858; 133 | border-radius: 0 0 5px 5px; 134 | } 135 | /* line 129, ../sass/style.scss */ 136 | .wp-disable .container .tab-wrap .panel .pane-head a.just-link:hover { 137 | background: #c7c6c6; 138 | } 139 | /* line 134, ../sass/style.scss */ 140 | .wp-disable .container .tab-wrap .panel .pane-head img { 141 | display: block; 142 | width: 100%; 143 | } 144 | /* line 140, ../sass/style.scss */ 145 | .wp-disable .container .tab-wrap .panel.featured-panel { 146 | background: #f65428 none repeat scroll 0 0; 147 | margin-bottom: 13px; 148 | padding: 1px; 149 | } 150 | /* line 147, ../sass/style.scss */ 151 | .wp-disable .container .btn-submit { 152 | background: #00CDBF; 153 | color: #05867d; 154 | height: auto; 155 | padding: 10px 30px; 156 | text-decoration: none; 157 | text-shadow: unset; 158 | box-shadow: none; 159 | border: none; 160 | margin-top: 20px; 161 | font-size: 18px; 162 | text-transform: uppercase; 163 | border-radius: 100px; 164 | } 165 | /* line 161, ../sass/style.scss */ 166 | .wp-disable .container .btn-submit:hover { 167 | background: #12c7bb; 168 | color: #05867d; 169 | } 170 | /* line 167, ../sass/style.scss */ 171 | .wp-disable .container .disable-form .form-group { 172 | display: block; 173 | padding: 15px 10px; 174 | border-bottom: 1px solid #ccc; 175 | min-height: 34px; 176 | line-height: 34px; 177 | } 178 | /* line 174, ../sass/style.scss */ 179 | .wp-disable .container .disable-form .form-group:last-child { 180 | border: none; 181 | } 182 | /* line 178, ../sass/style.scss */ 183 | .wp-disable .container .disable-form .form-group span { 184 | font-size: 16px; 185 | color: #797979; 186 | } 187 | 188 | /* line 187, ../sass/style.scss */ 189 | .side-bar { 190 | padding: 0 15px; 191 | width: 39%; 192 | display: inline-block; 193 | } 194 | /* line 192, ../sass/style.scss */ 195 | .side-bar h3 { 196 | background: #c5ccce; 197 | border-radius: 5px 5px 0 0; 198 | color: #797979; 199 | margin: 0; 200 | padding: 10px 25px; 201 | line-height: 25px; 202 | font-weight: 400; 203 | } 204 | /* line 202, ../sass/style.scss */ 205 | .side-bar .offload-form { 206 | background: #efefef; 207 | padding: 25px; 208 | color: #797984; 209 | border-radius: 0 0 5px 5px; 210 | margin-bottom: 20px; 211 | } 212 | /* line 209, ../sass/style.scss */ 213 | .side-bar .offload-form .form-group { 214 | margin-bottom: 25px; 215 | } 216 | /* line 212, ../sass/style.scss */ 217 | .side-bar .offload-form .form-group label { 218 | font-size: 14px; 219 | clear: both; 220 | margin-bottom: 8px; 221 | display: block; 222 | color: #797984; 223 | } 224 | /* line 221, ../sass/style.scss */ 225 | .side-bar .offload-form .form-group input[type=text] { 226 | min-width: 300px; 227 | height: 36px; 228 | border: 1px solid #dedede; 229 | background: #fff; 230 | padding: 0 10px; 231 | border-radius: 3px; 232 | color: #0a6f68; 233 | font-weight: 100; 234 | box-shadow: none; 235 | } 236 | /* line 233, ../sass/style.scss */ 237 | .side-bar .offload-form .form-group input[type=number] { 238 | height: 30px; 239 | border-radius: 3px; 240 | border: 1px solid #dedede; 241 | width: 60px; 242 | box-shadow: none; 243 | } 244 | /* line 241, ../sass/style.scss */ 245 | .side-bar .offload-form .form-group input[type=checkbox] { 246 | border: 1px solid #dedede; 247 | border-radius: 3px; 248 | box-shadow: none; 249 | } 250 | /* line 246, ../sass/style.scss */ 251 | .side-bar .offload-form .form-group input[type=checkbox]:checked:before { 252 | color: #797984; 253 | } 254 | /* line 251, ../sass/style.scss */ 255 | .side-bar .offload-form .form-group input[type=radio] { 256 | -webkit-border-radius: 50%; 257 | border-radius: 50%; 258 | margin-right: 5px; 259 | line-height: 10px; 260 | background: #fff; 261 | border: 1px solid #dedede; 262 | box-shadow: none; 263 | } 264 | /* line 260, ../sass/style.scss */ 265 | .side-bar .offload-form .form-group input[type=radio]:checked:before { 266 | width: 8px; 267 | height: 8px; 268 | margin: 3px; 269 | line-height: 16px; 270 | background-color: #797984; 271 | } 272 | /* line 269, ../sass/style.scss */ 273 | .side-bar .offload-form .form-group span { 274 | margin-right: 40px; 275 | font-size: 14px; 276 | color: #797984; 277 | } 278 | /* line 281, ../sass/style.scss */ 279 | .side-bar .pane-head a img { 280 | display: block; 281 | width: 100%; 282 | border-radius: 5px; 283 | margin-bottom: 20px; 284 | } 285 | /* line 289, ../sass/style.scss */ 286 | .side-bar .pane-head h2 { 287 | color: white; 288 | line-height: 22px; 289 | text-align: center; 290 | } 291 | /* line 295, ../sass/style.scss */ 292 | .side-bar .pane-head h3 { 293 | background: #bfbfbf; 294 | color: #737373; 295 | margin: 0 auto; 296 | text-align: center; 297 | } 298 | 299 | /* line 304, ../sass/style.scss */ 300 | .check_options { 301 | font-weight: bold; 302 | } 303 | 304 | /* line 309, ../sass/style.scss */ 305 | .stars { 306 | float: right; 307 | height: 19px; 308 | background: transparent url("/wp-content/plugins/wp-disable/images/stars.jpg") repeat scroll 0 0; 309 | width: 100px; 310 | } 311 | 312 | @media (max-width: 768px) { 313 | /* line 317, ../sass/style.scss */ 314 | .tab-wrap { 315 | width: 96%; 316 | } 317 | 318 | /* line 320, ../sass/style.scss */ 319 | .col-left, .col-right, .side-bar { 320 | width: 100%; 321 | } 322 | 323 | /* line 323, ../sass/style.scss */ 324 | .col-right a { 325 | display: block; 326 | } 327 | } 328 | /* The switch - the box around the slider */ 329 | /* line 329, ../sass/style.scss */ 330 | .switch { 331 | position: relative; 332 | display: inline-block; 333 | width: 60px; 334 | height: 34px; 335 | float: right; 336 | } 337 | 338 | /* Hide default HTML checkbox */ 339 | /* line 338, ../sass/style.scss */ 340 | .switch input { 341 | display: none; 342 | } 343 | 344 | /* The slider */ 345 | /* line 341, ../sass/style.scss */ 346 | .slider { 347 | position: absolute; 348 | cursor: pointer; 349 | top: 0; 350 | left: 0; 351 | right: 0; 352 | bottom: 0; 353 | background-color: #F37E67; 354 | -webkit-transition: .4s; 355 | transition: .4s; 356 | } 357 | 358 | /* line 353, ../sass/style.scss */ 359 | .slider:before { 360 | position: absolute; 361 | content: ""; 362 | height: 26px; 363 | width: 26px; 364 | left: 4px; 365 | bottom: 4px; 366 | background-color: white; 367 | -webkit-transition: .4s; 368 | transition: .4s; 369 | } 370 | 371 | /* line 365, ../sass/style.scss */ 372 | input:checked + .slider { 373 | background-color: #00CDBF; 374 | } 375 | 376 | /* line 369, ../sass/style.scss */ 377 | input:focus + .slider { 378 | box-shadow: 0 0 1px #2196F3; 379 | } 380 | 381 | /* line 373, ../sass/style.scss */ 382 | input:checked + .slider:before { 383 | -webkit-transform: translateX(26px); 384 | -ms-transform: translateX(26px); 385 | transform: translateX(26px); 386 | } 387 | 388 | /* Rounded sliders */ 389 | /* line 380, ../sass/style.scss */ 390 | .slider.round { 391 | border-radius: 34px; 392 | } 393 | 394 | /* line 384, ../sass/style.scss */ 395 | .slider.round:before { 396 | border-radius: 50%; 397 | } 398 | -------------------------------------------------------------------------------- /js/optimisationio-stats-addons.js: -------------------------------------------------------------------------------- 1 | var OptimisationioAddons = (function($){ 2 | 3 | "use strict"; 4 | 5 | var settings_import_export = function(){ 6 | 7 | var export_clipboard, 8 | $el = { 9 | import: { 10 | textarea: null, 11 | btn: null, 12 | clear_btn: null, 13 | }, 14 | export: { 15 | addons_fields: null, 16 | textarea: null, 17 | btn: null, 18 | copy_btn: null, 19 | }, 20 | }; 21 | 22 | function imp_exp_ajax_request(action, data){ 23 | $.ajax({ 24 | type: 'post', 25 | url: ajaxurl, 26 | data:{ 27 | action: action, 28 | data: data, 29 | nonce: $('#optimisationio_import_export_nonce').val(), 30 | }, 31 | dataType: 'json', 32 | success: function (data, textStatus, XMLHttpRequest) { 33 | if( 0 === data.error ){ 34 | if( 'optimisationio_export_addons_settings' === action ){ 35 | $el.export.textarea.val(data.export); 36 | $el.export.copy_btn.removeClass('hidden'); 37 | } 38 | else{ 39 | $el.import.textarea.val(''); 40 | $el.import.clear_btn.addClass('hidden'); 41 | alert(data.msg); 42 | } 43 | } 44 | else if( 'undefined' !== typeof data.msg ) { 45 | alert( data.msg ); 46 | } 47 | }, 48 | error: function (data, textStatus, XMLHttpRequest) { 49 | console.log(data); 50 | } 51 | }); 52 | } 53 | 54 | function on_addon_field_click(ev) { 55 | var checked_addons = []; 56 | $el.export.addons_fields.each(function(i, input){ 57 | if( input.checked ){ checked_addons.push(input.value); } 58 | }); 59 | $el.export.btn.prop("disabled", checked_addons.length ? false : true); 60 | } 61 | 62 | function on_import_textarea_change(ev) { 63 | if( '' === $el.import.textarea.val().trim() ){ 64 | $el.import.clear_btn.addClass('hidden'); 65 | $el.import.btn.prop("disabled", true); 66 | } 67 | else{ 68 | $el.import.clear_btn.removeClass('hidden'); 69 | $el.import.btn.prop("disabled", false); 70 | } 71 | } 72 | 73 | function on_import_btn_click() { 74 | var imported = $el.import.textarea.val().trim(); 75 | if( '' !== imported ){ 76 | imp_exp_ajax_request('optimisationio_import_addons_settings', imported); 77 | } 78 | } 79 | 80 | function on_export_btn_click() { 81 | var export_slugs = []; 82 | $el.export.addons_fields.each(function(i, input){ 83 | if( input.checked ){ export_slugs.push(input.value); } 84 | }); 85 | if( export_slugs.length ){ 86 | imp_exp_ajax_request('optimisationio_export_addons_settings', export_slugs); 87 | } 88 | } 89 | 90 | function on_clear_import_btn_click() { 91 | $el.import.textarea.val(''); 92 | } 93 | 94 | $(function () { 95 | 96 | $el = { 97 | import: { 98 | textarea: $('#import_settings_tarea'), 99 | btn: $('.import-btn'), 100 | clear_btn: $('.clear-import-btn'), 101 | }, 102 | export: { 103 | addons_fields: $('input[name="export_addons[]"]'), 104 | textarea: $('#export_settings_tarea'), 105 | btn: $('.export-btn'), 106 | copy_btn: $('.copy-export-btn'), 107 | }, 108 | }; 109 | 110 | export_clipboard = new Clipboard('.copy-export-btn', { 111 | text: function(trigger) { 112 | return $el.export.textarea.val(); 113 | } 114 | }); 115 | 116 | $el.export.addons_fields.on('click', on_addon_field_click); 117 | $el.import.textarea.on('change, keyup', on_import_textarea_change); 118 | $el.import.btn.on('click', function(e){ e.preventDefault(); on_import_btn_click(); }); 119 | $el.export.btn.on('click', function(e){ e.preventDefault(); on_export_btn_click(); }); 120 | $el.import.clear_btn.on('click', function(e){ e.preventDefault(); on_clear_import_btn_click(); }); 121 | 122 | export_clipboard.on('success', function(e){ alert("Exported settings copied to clipboard"); }); 123 | }); 124 | }; 125 | 126 | var install_activate_deactivate = function(){ 127 | 128 | var running_processes = 0; 129 | var on_deactivate_process = false; 130 | var deactivates_queue = []; 131 | 132 | function confirm_page_leave(ev){ 133 | var msg; 134 | if (0 !== running_processes) { 135 | msg = "Changes you made may not be saved."; 136 | ev.returnValue = msg; 137 | return msg; 138 | } 139 | } 140 | 141 | function on_action_click( $btn, action ){ 142 | 143 | var slug, file, link, $parent; 144 | 145 | if( ! $btn.hasClass("disabled") ){ 146 | $btn.addClass("disabled"); 147 | 148 | $parent = $btn.parent('.addon-buttons'); 149 | slug = $parent.data('slug'); 150 | file = $parent.data('file'); 151 | link = $parent.data('link'); 152 | 153 | if( on_deactivate_process ){ 154 | deactivates_queue.push({ 155 | action: action, 156 | slug: slug, 157 | file: file, 158 | link: link, 159 | '$btn': $btn 160 | }); 161 | } 162 | else{ 163 | addons_ajax_request( action, slug, file, link, $btn ); 164 | } 165 | } 166 | } 167 | 168 | function addons_ajax_request(action, slug, file, link, $btn){ 169 | 170 | running_processes++; 171 | 172 | on_deactivate_process = 'deactivate' === action; 173 | 174 | $.ajax({ 175 | type: 'post', 176 | url: ajaxurl, 177 | data:{ 178 | action: 'optimisationio_' + action + '_addon', 179 | slug: slug, 180 | file: file, 181 | link: link, 182 | nonce: $('#optimisationio_addons_nonce').val(), 183 | }, 184 | dataType: 'json', 185 | success: function (data, textStatus, XMLHttpRequest) { 186 | 187 | var to_activate, next; 188 | 189 | if( 0 !== data.error ){ 190 | if("undefined" !== typeof data.type && "deny-disable" === data.type ){ 191 | alert(data.msg); 192 | on_deactivate_process = false; 193 | running_processes--; 194 | $btn.removeClass("disabled"); 195 | } 196 | else{ 197 | console.error(data.msg); 198 | } 199 | } 200 | else{ 201 | switch(action){ 202 | case 'install': 203 | to_activate = 'activate'; 204 | break; 205 | case 'activate': 206 | to_activate = 'deactivate'; 207 | break; 208 | case 'deactivate': 209 | 210 | on_deactivate_process = false; 211 | 212 | if( deactivates_queue.length ){ 213 | next = deactivates_queue.pop(); 214 | addons_ajax_request(next.action, next.slug, next.file, next.link, next['$btn']); 215 | } 216 | 217 | to_activate = 'activate'; 218 | break; 219 | } 220 | 221 | if( to_activate ){ 222 | $btn.parent('.addon-buttons').find('.' + to_activate + '-addon').removeClass('hidden').removeClass("disabled"); 223 | $btn.addClass("hidden"); 224 | running_processes--; 225 | } 226 | 227 | if( 'undefined' !== typeof data.measurements_content_replace ){ 228 | // @note: Used on addon activation. 229 | 230 | $('.statistics-measurements').replaceWith( data.measurements_content_replace ); 231 | } 232 | } 233 | }, 234 | error: function (data, textStatus, XMLHttpRequest) { 235 | console.error("ERROR: ", slug, action); 236 | $btn.text("ERROR"); 237 | running_processes--; 238 | } 239 | }); 240 | } 241 | 242 | $(function () { 243 | $('.install-addon').on('click', function(){ on_action_click( $(this), 'install' ); }); 244 | $('.activate-addon').on('click', function(){ on_action_click( $(this), 'activate' ); }); 245 | $('.deactivate-addon').on('click', function(){ on_action_click( $(this), 'deactivate' ); }); 246 | 247 | $(window).bind('beforeunload', confirm_page_leave); 248 | }); 249 | }; 250 | 251 | var main_tabs = function(){ 252 | 253 | var active_tab_id = localStorage.getItem( 'optimisationio_stats_tab' ); 254 | 255 | active_tab_id = active_tab_id ? active_tab_id : 'disable'; 256 | 257 | function on_tabs_nav_li_click($tab){ 258 | var tab_id = $tab.data('tab'); 259 | if( ! $tab.hasClass('active') ){ 260 | update_active_tab( tab_id ); 261 | $tab.addClass('active'); 262 | localStorage.setItem( 'optimisationio_stats_tab', tab_id ); 263 | } 264 | } 265 | 266 | function update_active_tab(tab_id){ 267 | $('.statistics-tabs-nav li, .statistics-tab-content').removeClass('active'); 268 | $('.statistics-tab-content[data-tab="' + tab_id + '"]').addClass('active'); 269 | } 270 | 271 | $(function () { 272 | if( active_tab_id ){ 273 | update_active_tab( active_tab_id ); 274 | $('.statistics-tabs-nav li[data-tab="' + active_tab_id + '"]').addClass('active'); 275 | } 276 | $('.statistics-tabs-nav li').on('click', function(){ on_tabs_nav_li_click( $(this) ); }); 277 | }); 278 | }; 279 | 280 | var sidebar_tabs = function(){ 281 | 282 | var active_side_tab_id = localStorage.getItem( 'optimisationio_sidebar_tab' ); 283 | 284 | function on_sidebar_tab_click($tab){ 285 | var tab_id = $tab.data('tab-id'); 286 | if( ! $tab.hasClass('active') ){ 287 | update_active_sidebar_tab( tab_id ); 288 | $tab.addClass('active'); 289 | localStorage.setItem( 'optimisationio_sidebar_tab', tab_id ); 290 | } 291 | } 292 | 293 | function update_active_sidebar_tab(tab_id){ 294 | $('.sidebar-tabs-section ul li, .sidebar-tabs-content ul li').removeClass('active'); 295 | $('.sidebar-tabs-content ul li[data-tab-id="' + tab_id + '"]').addClass('active'); 296 | } 297 | 298 | $(function () { 299 | 300 | var $activeEl; 301 | 302 | active_side_tab_id = active_side_tab_id ? active_side_tab_id : ( $('.sidebar-tabs-section ul li[data-tab-id="ga"]').length ? "ga" : "imp" ); 303 | 304 | if( active_side_tab_id ){ 305 | 306 | $activeEl = $('.sidebar-tabs-section ul li[data-tab-id="' + active_side_tab_id + '"]'); 307 | 308 | if( ! $activeEl.length ){ 309 | active_side_tab_id = "imp" 310 | $activeEl = $('.sidebar-tabs-section ul li[data-tab-id="' + active_side_tab_id + '"]'); 311 | } 312 | update_active_sidebar_tab( active_side_tab_id ); 313 | $activeEl.addClass('active'); 314 | } 315 | 316 | $('.sidebar-tabs-section ul li').on('click', function(){ on_sidebar_tab_click( $(this) ); }); 317 | }); 318 | }; 319 | 320 | var plugin_settings_tabs = function(){ 321 | 322 | function on_tab_click(ev){ 323 | var id = $(this).data('tab-setting'); 324 | ev.data.$wrap.find('.addon-settings-tabs ul li.active, .addon-settings-content.active').removeClass('active'); 325 | ev.data.$wrap.find('.addon-settings-tabs ul li[data-tab-setting="'+id+'"], .addon-settings-content[data-tab-setting="'+id+'"]').addClass('active'); 326 | } 327 | 328 | function bind_plugin_events($wrap){ 329 | var $tabs = $wrap.find('.addon-settings-tabs ul li'); 330 | if( $tabs.length ){ $tabs.on('click', { '$wrap' : $wrap }, on_tab_click); } 331 | } 332 | 333 | $(function () { 334 | var $addon_settings = $('.addon-settings'); 335 | if( $addon_settings.length ){ 336 | $addon_settings.each(function(i, el){ 337 | bind_plugin_events($(el)); 338 | }); 339 | } 340 | }); 341 | }; 342 | 343 | main_tabs(); 344 | sidebar_tabs(); 345 | plugin_settings_tabs(); 346 | settings_import_export(); 347 | install_activate_deactivate(); 348 | 349 | }(jQuery)); -------------------------------------------------------------------------------- /lang/wpperformance.pot: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: WP Disable\n" 4 | "Report-Msgid-Bugs-To: http://flexiblemegamenu.com\n" 5 | "POT-Creation-Date: 2017-10-11 04:58+0200\n" 6 | "PO-Revision-Date: 2017-10-11 04:58+0200\n" 7 | "Last-Translator: _Language-Team:\n" 8 | "Language-Team: \n" 9 | "Language: en\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Generator: Poedit 1.7.5\n" 14 | "X-Poedit-KeywordsList: __;_e;_n;_x;esc_html_e;esc_html__;esc_attr_e;" 15 | "esc_attr__;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_x:1,2c;_n:1,2\n" 16 | "X-Poedit-Basepath: ../\n" 17 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 18 | "X-Poedit-SourceCharset: UTF-8\n" 19 | "X-Poedit-SearchPath-0: .\n" 20 | "X-Poedit-SearchPathExcluded-0: cache/local-ga.js\n" 21 | 22 | #: lib/class-optimisationio-dashboard.php:15 23 | #: lib/class-optimisationio-dashboard.php:579 24 | msgid "n/a" 25 | msgstr "" 26 | 27 | #: lib/class-optimisationio-dashboard.php:16 28 | msgid "Install" 29 | msgstr "" 30 | 31 | #: lib/class-optimisationio-dashboard.php:17 32 | msgid "Activate" 33 | msgstr "" 34 | 35 | #: lib/class-optimisationio-dashboard.php:18 36 | msgid "Deactivate" 37 | msgstr "" 38 | 39 | #: lib/class-optimisationio-dashboard.php:19 40 | msgid "Changes you made may not be saved." 41 | msgstr "" 42 | 43 | #: lib/class-optimisationio-dashboard.php:39 44 | msgid "Optimisation.io" 45 | msgstr "" 46 | 47 | #: lib/class-optimisationio-dashboard.php:282 48 | msgid "Invalid import arguments" 49 | msgstr "" 50 | 51 | #: lib/class-optimisationio-dashboard.php:375 52 | msgid "Settings imported successfully" 53 | msgstr "" 54 | 55 | #: lib/class-optimisationio-dashboard.php:379 56 | msgid "Imported invalid data" 57 | msgstr "" 58 | 59 | #: lib/class-optimisationio-dashboard.php:397 60 | msgid "Invalid export arguments" 61 | msgstr "" 62 | 63 | #: lib/class-optimisationio-dashboard.php:446 64 | msgid "Can't find saved data to export" 65 | msgstr "" 66 | 67 | #: lib/class-optimisationio-dashboard.php:452 68 | msgid "Failed data verification" 69 | msgstr "" 70 | 71 | #: lib/class-optimisationio-dashboard.php:480 72 | msgid "Improve WordPress performance by disabling unused items." 73 | msgstr "" 74 | 75 | #: lib/class-optimisationio-dashboard.php:481 76 | msgid "Simple efficient WordPress caching." 77 | msgstr "" 78 | 79 | #: lib/class-optimisationio-dashboard.php:482 80 | msgid "Image Compression and resizing - Setup under the Tools menu" 81 | msgstr "" 82 | 83 | #: lib/class-optimisationio-dashboard.php:610 84 | msgid "Saved" 85 | msgstr "" 86 | 87 | #: lib/class-optimisationio-dashboard.php:629 88 | msgid "Original DB" 89 | msgstr "" 90 | 91 | #: lib/class-optimisationio-dashboard.php:630 92 | msgid "New DB" 93 | msgstr "" 94 | 95 | #: lib/class-optimisationio-dashboard.php:631 96 | msgid "Savings" 97 | msgstr "" 98 | 99 | #: lib/class-optimisationio-dashboard.php:634 100 | msgid "Pages average load time" 101 | msgstr "" 102 | 103 | #: lib/class-optimisationio-dashboard.php:637 104 | msgid "Cache" 105 | msgstr "" 106 | 107 | #: lib/class-optimisationio-dashboard.php:638 108 | msgid "Gravatars Cache" 109 | msgstr "" 110 | 111 | #: lib/class-optimisationio-dashboard.php:731 112 | msgid "Offload Google Analytics" 113 | msgstr "" 114 | 115 | #: lib/class-optimisationio-dashboard.php:733 116 | msgid "Import" 117 | msgstr "" 118 | 119 | #: lib/class-optimisationio-dashboard.php:734 120 | msgid "Export" 121 | msgstr "" 122 | 123 | #: lib/class-optimisationio-dashboard.php:746 124 | msgid "" 125 | "Copy into textarea the encoded string of add-ons settings you have exported" 126 | msgstr "" 127 | 128 | #: lib/class-optimisationio-dashboard.php:751 129 | msgid "Import settings" 130 | msgstr "" 131 | 132 | #: lib/class-optimisationio-dashboard.php:753 133 | msgid "Clear" 134 | msgstr "" 135 | 136 | #: lib/class-optimisationio-dashboard.php:757 137 | msgid "" 138 | "Select the add-οns whose settings you want to include in the exported data" 139 | msgstr "" 140 | 141 | #: lib/class-optimisationio-dashboard.php:771 142 | msgid "Export current settings" 143 | msgstr "" 144 | 145 | #: lib/class-optimisationio-dashboard.php:773 146 | msgid "Copy to clipboard" 147 | msgstr "" 148 | 149 | #: lib/class-wpperformance-admin.php:465 150 | msgid "GA Code" 151 | msgstr "" 152 | 153 | #: lib/class-wpperformance-admin.php:469 154 | msgid "Save GA in (please ensure you remove any other GA tracking)" 155 | msgstr "" 156 | 157 | #: lib/class-wpperformance-admin.php:480 158 | msgid "Use adjusted bounce rate?" 159 | msgstr "" 160 | 161 | #: lib/class-wpperformance-admin.php:484 162 | msgid "Change enqueue order? (Default = 0)" 163 | msgstr "" 164 | 165 | #: lib/class-wpperformance-admin.php:494 166 | msgid "Track logged in Administrators?" 167 | msgstr "" 168 | 169 | #: lib/class-wpperformance-admin.php:497 170 | msgid "Remove script from wp-cron?" 171 | msgstr "" 172 | 173 | #: lib/class-wpperformance-admin.php:569 174 | msgid "Requests" 175 | msgstr "" 176 | 177 | #: lib/class-wpperformance-admin.php:571 178 | msgid "WooCommerce" 179 | msgstr "" 180 | 181 | #: lib/class-wpperformance-admin.php:573 182 | msgid "Tags" 183 | msgstr "" 184 | 185 | #: lib/class-wpperformance-admin.php:574 186 | msgid "Admin" 187 | msgstr "" 188 | 189 | #: lib/class-wpperformance-admin.php:575 190 | msgid "Others" 191 | msgstr "" 192 | 193 | #: lib/class-wpperformance-admin.php:583 194 | msgid "Disable Emojis" 195 | msgstr "" 196 | 197 | #: lib/class-wpperformance-admin.php:587 198 | msgid "Remove Querystrings" 199 | msgstr "" 200 | 201 | #: lib/class-wpperformance-admin.php:591 202 | msgid "Disable Embeds" 203 | msgstr "" 204 | 205 | #: lib/class-wpperformance-admin.php:595 206 | msgid "Disable Google Maps" 207 | msgstr "" 208 | 209 | #: lib/class-wpperformance-admin.php:599 210 | #, php-format 211 | msgid "Exclude pages from %1$s Disable Google Maps %2$s filter" 212 | msgstr "" 213 | 214 | #: lib/class-wpperformance-admin.php:606 215 | msgid "Disable Referral Spam" 216 | msgstr "" 217 | 218 | #: lib/class-wpperformance-admin.php:610 219 | msgid "DNS prefetch" 220 | msgstr "" 221 | 222 | #: lib/class-wpperformance-admin.php:615 223 | msgid "Prefetch host list" 224 | msgstr "" 225 | 226 | #: lib/class-wpperformance-admin.php:618 227 | msgid "One domain by line" 228 | msgstr "" 229 | 230 | #: lib/class-wpperformance-admin.php:623 231 | #, php-format 232 | msgid "Minimize requests and load %1$sGoogle Fonts%2$s asynchronous" 233 | msgstr "" 234 | 235 | #: lib/class-wpperformance-admin.php:627 236 | #, php-format 237 | msgid "Minimize requests and load %1$sFont Awesome%2$s asynchronous" 238 | msgstr "" 239 | 240 | #: lib/class-wpperformance-admin.php:631 241 | msgid "Disable WordPress password strength meter js on non related pages" 242 | msgstr "" 243 | 244 | #: lib/class-wpperformance-admin.php:635 245 | msgid "Disable Dashicons when user disables admin toolbar when viewing site" 246 | msgstr "" 247 | 248 | #: lib/class-wpperformance-admin.php:643 249 | msgid "Disable WooCommerce scripts and CSS on non WooCommerce pages" 250 | msgstr "" 251 | 252 | #: lib/class-wpperformance-admin.php:648 253 | msgid "Disable WooCommerce Reviews" 254 | msgstr "" 255 | 256 | #: lib/class-wpperformance-admin.php:653 257 | msgid "Defer WooCommerce Cart Fragments" 258 | msgstr "" 259 | 260 | #: lib/class-wpperformance-admin.php:658 261 | msgid "Disable WooCommerce password strength meter js on non related pages" 262 | msgstr "" 263 | 264 | #: lib/class-wpperformance-admin.php:666 265 | msgid "Remove RSD (Really Simple Discovery) tag" 266 | msgstr "" 267 | 268 | #: lib/class-wpperformance-admin.php:670 269 | msgid "Remove Shortlink Tag" 270 | msgstr "" 271 | 272 | #: lib/class-wpperformance-admin.php:674 273 | msgid "Remove Wordpress API from header" 274 | msgstr "" 275 | 276 | #: lib/class-wpperformance-admin.php:678 277 | msgid "Remove Windows Live Writer tag" 278 | msgstr "" 279 | 280 | #: lib/class-wpperformance-admin.php:682 281 | msgid "Remove Wordpress Generator Tag" 282 | msgstr "" 283 | 284 | #: lib/class-wpperformance-admin.php:689 285 | msgid "Posts revisions number" 286 | msgstr "" 287 | 288 | #: lib/class-wpperformance-admin.php:694 289 | #: lib/class-wpperformance-admin.php:782 290 | #: lib/class-wpperformance-admin.php:818 291 | msgid "WordPress default" 292 | msgstr "" 293 | 294 | #: lib/class-wpperformance-admin.php:735 295 | msgid "Disable Autosave" 296 | msgstr "" 297 | 298 | #: lib/class-wpperformance-admin.php:739 299 | msgid "Disable admin notices" 300 | msgstr "" 301 | 302 | #: lib/class-wpperformance-admin.php:743 303 | msgid "Disable author pages" 304 | msgstr "" 305 | 306 | #: lib/class-wpperformance-admin.php:747 307 | msgid "Disable all comments" 308 | msgstr "" 309 | 310 | #: lib/class-wpperformance-admin.php:751 311 | msgid "Disable comments on certain post types" 312 | msgstr "" 313 | 314 | #: lib/class-wpperformance-admin.php:758 315 | #, php-format 316 | msgid "Disable comments on post type \"%1$s%2$s%3$s\"" 317 | msgstr "" 318 | 319 | #: lib/class-wpperformance-admin.php:765 320 | msgid "Close comments after 28 days" 321 | msgstr "" 322 | 323 | #: lib/class-wpperformance-admin.php:769 324 | msgid "Paginate comments at 20" 325 | msgstr "" 326 | 327 | #: lib/class-wpperformance-admin.php:773 328 | msgid "Remove links from comments" 329 | msgstr "" 330 | 331 | #: lib/class-wpperformance-admin.php:777 332 | msgid "Heartbeat frequency" 333 | msgstr "" 334 | 335 | #: lib/class-wpperformance-admin.php:780 336 | msgid "seconds" 337 | msgstr "" 338 | 339 | #: lib/class-wpperformance-admin.php:814 340 | msgid "Heartbeat locations" 341 | msgstr "" 342 | 343 | #: lib/class-wpperformance-admin.php:819 344 | msgid "Disable everywhere" 345 | msgstr "" 346 | 347 | #: lib/class-wpperformance-admin.php:820 348 | msgid "Disable on dashboard page" 349 | msgstr "" 350 | 351 | #: lib/class-wpperformance-admin.php:821 352 | msgid "Allow only on post edit pages" 353 | msgstr "" 354 | 355 | #: lib/class-wpperformance-admin.php:842 356 | msgid "Disable pingbacks and trackbacks" 357 | msgstr "" 358 | 359 | #: lib/class-wpperformance-admin.php:846 360 | msgid "Disable feeds" 361 | msgstr "" 362 | 363 | #: lib/class-wpperformance-admin.php:852 364 | msgid "Redirect feed requests to corresponding HTML content" 365 | msgstr "" 366 | 367 | #: lib/class-wpperformance-admin.php:857 368 | msgid "Issue a \"Page Not Found (404)\" error for feed requests" 369 | msgstr "" 370 | 371 | #: lib/class-wpperformance-admin.php:863 372 | msgid "Disable XML-RPC" 373 | msgstr "" 374 | 375 | #: lib/class-wpperformance-admin.php:867 376 | msgid "Disable Gravatars" 377 | msgstr "" 378 | 379 | #: lib/class-wpperformance-admin.php:871 380 | msgid "Enable spam comments cleaner" 381 | msgstr "" 382 | 383 | #: lib/class-wpperformance-admin.php:875 384 | msgid "Delete spam comments" 385 | msgstr "" 386 | 387 | #: lib/class-wpperformance-admin.php:879 388 | msgid "Once Hourly" 389 | msgstr "" 390 | 391 | #: lib/class-wpperformance-admin.php:880 392 | msgid "Twice Daily" 393 | msgstr "" 394 | 395 | #: lib/class-wpperformance-admin.php:881 396 | msgid "Once Daily" 397 | msgstr "" 398 | 399 | #: lib/class-wpperformance-admin.php:882 wpperformance.php:144 400 | msgid "Once Weekly" 401 | msgstr "" 402 | 403 | #: lib/class-wpperformance-admin.php:883 wpperformance.php:149 404 | msgid "Twice Monthly" 405 | msgstr "" 406 | 407 | #: lib/class-wpperformance-admin.php:884 wpperformance.php:154 408 | msgid "Once Monthly" 409 | msgstr "" 410 | 411 | #: lib/class-wpperformance-admin.php:904 412 | #, php-format 413 | msgid "Next spam delete: %s" 414 | msgstr "" 415 | 416 | #: lib/class-wpperformance-admin.php:908 417 | msgid "Delete spam comments now" 418 | msgstr "" 419 | 420 | #: views/optimisationio-dashboard.php:17 421 | msgid "Request manual optimisation" 422 | msgstr "" 423 | 424 | #: views/optimisationio-dashboard.php:20 425 | msgid "Support" 426 | msgstr "" 427 | 428 | #: views/optimisationio-dashboard.php:27 429 | msgid "Remove Excess Bloat" 430 | msgstr "" 431 | 432 | #: views/optimisationio-dashboard.php:28 433 | msgid "Compress Images" 434 | msgstr "" 435 | 436 | #: views/optimisationio-dashboard.php:29 437 | msgid "Cache & Database" 438 | msgstr "" 439 | 440 | #: views/optimisationio-dashboard.php:75 441 | msgid "Coming Soon" 442 | msgstr "" 443 | -------------------------------------------------------------------------------- /views/admin_settings.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |

6 |

7 |
8 |
9 |

WordPress Disable - Improve Performances

10 | Improve performance and reduce HTTP requests. 11 |
12 | 13 |
Help us build a better product 14 |

Rate us on WordPress.org

15 | 18 |
19 |
20 |
21 |
22 |
    23 | 24 | 25 | 26 | 27 | 28 |
29 |
30 |
31 |
32 |
33 |
34 | Disable Emojis 35 | 42 |
43 | 44 |
45 | Remove Querystrings 46 | 53 |
54 | 55 |
56 | Disable Embeds 57 | 64 |
65 | 66 |
67 | Disable Google Maps 68 | 75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 | Disable WooCommerce scripts and CSS on non WooCommerce pages 84 | 91 |
92 | 93 |
94 | Disable WooCommerce Reviews 95 | 102 | 103 |
104 | 105 |
106 | Defer Woocommerce Cart Fragments 107 | 114 | 115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 | 123 |
124 | Remove RSD (Really Simple Discovery) tag 125 | 132 | 133 |
134 | 135 |
136 | Remove Shortlink Tag 137 | 144 | 145 |
146 | 147 |
148 | Remove Wordpress API from header 149 | 156 | 157 |
158 | 159 |
160 | Remove Windows Live Writer tag 161 | 168 | 169 |
170 | 171 |
172 | Remove Wordpress Generator Tag 173 | 180 | 181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 | Disable Revisions 190 | 197 | 198 |
199 |
200 | Disable Autosave 201 | 208 | 209 |
210 | 211 |
212 | Close comments after 28 days 213 | 220 | 221 |
222 | 223 |
224 | Paginate comments at 20 225 | 232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 | Disable Gravatars 241 | 248 |
249 | 250 |
251 | Disable pingbacks and trackbacks 252 | 259 |
260 | 261 |
262 | Disable RSS 263 | 270 |
271 | 272 |
273 | Disable XML-RPC 274 | 281 |
282 | 283 |
284 |
285 |
286 |
287 | 288 |
289 | 290 | 291 | 297 |
298 | 358 |
359 | 360 | 388 | -------------------------------------------------------------------------------- /lib/WpPerformance/Admin.php: -------------------------------------------------------------------------------- 1 | 0, 36 | 'disable_emoji'=>0, 37 | 'disable_embeds'=>0, 38 | 'remove_querystrings'=>0, 39 | 'lazyload'=>0, 40 | 'default_ping_status'=>0, 41 | 'close_comments'=>0, 42 | 'paginate_comments'=>0, 43 | 'disable_woocommerce_non_pages'=>0, 44 | 'disable_woocommerce_cart_fragments'=>0, 45 | 'remove_rsd'=>0, 46 | 'remove_windows_live_writer'=>0, 47 | 'remove_wordpress_generator_tag'=>0, 48 | 'remove_shortlink_tag'=>0, 49 | 'remove_wordpress_api_from_header'=>0, 50 | 'disable_rss'=>0, 51 | 'disable_xmlrpc'=>0, 52 | 'disable_autosave'=>0, 53 | 'disable_revisions'=>0, 54 | 'disable_woocommerce_reviews'=>0, 55 | 'disable_google_maps'=>0, 56 | 'ds_tracking_id'=>null, 57 | 'ds_anonymize_ip'=>'off', 58 | 'ds_script_position'=>null, 59 | 'caos_disable_display_features'=>'off', 60 | 'ds_track_admin'=>'off', 61 | 'caos_remove_wp_cron'=>'off', 62 | ); 63 | $settings = get_option(WpPerformance::OPTION_KEY . '_settings', $defaultArray); 64 | $data = array('settings' => $settings); 65 | echo WpPerformance_View::render('admin_settings', $data); 66 | } 67 | 68 | public function updatesettings() 69 | { 70 | $array = array( 71 | 'disable_gravatars' => isset($_POST['disable_gravatars']) ? 1 : 0, 72 | 'disable_emoji' => isset($_POST['disable_emoji']) ? 1 : 0, 73 | 'disable_embeds' => isset($_POST['disable_embeds']) ? 1 : 0, 74 | 'remove_querystrings' => isset($_POST['remove_querystrings']) ? 1 : 0, 75 | 'lazyload' => isset($_POST['lazyload']) ? 1 : 0, 76 | 'default_ping_status' => isset($_POST['default_ping_status']) ? 1 : 0, 77 | 'close_comments' => isset($_POST['close_comments']) ? 1 : 0, 78 | 'paginate_comments' => isset($_POST['paginate_comments']) ? 1 : 0, 79 | 'disable_woocommerce_non_pages' => isset($_POST['disable_woocommerce_non_pages']) ? 1 : 0, 80 | 'disable_woocommerce_cart_fragments' => isset($_POST['disable_woocommerce_cart_fragments']) ? 1 : 0, 81 | 'remove_rsd' => isset($_POST['remove_rsd']) ? 1 : 0, 82 | 'remove_windows_live_writer' => isset($_POST['remove_windows_live_writer']) ? 1 : 0, 83 | 'remove_wordpress_generator_tag' => isset($_POST['remove_wordpress_generator_tag']) ? 1 : 0, 84 | 'remove_shortlink_tag' => isset($_POST['remove_shortlink_tag']) ? 1 : 0, 85 | 'remove_wordpress_api_from_header' => isset($_POST['remove_wordpress_api_from_header']) ? 1 : 0, 86 | 'disable_rss' => isset($_POST['disable_rss']) ? 1 : 0, 87 | 'disable_xmlrpc' => isset($_POST['disable_xmlrpc']) ? 1 : 0, 88 | 'disable_autosave' => isset($_POST['disable_autosave']) ? 1 : 0, 89 | 'disable_revisions' => isset($_POST['disable_revisions']) ? 1 : 0, 90 | 'disable_woocommerce_reviews' => isset($_POST['disable_woocommerce_reviews']) ? 1 : 0, 91 | 'disable_google_maps' => isset($_POST['disable_google_maps']) ? 1 : 0, 92 | 'ds_tracking_id' => sanitize_text_field( (isset($_POST['ds_tracking_id']) && $_POST['ds_tracking_id']) ?$_POST['ds_tracking_id']:null ), 93 | 'ds_adjusted_bounce_rate' => sanitize_text_field( (isset($_POST['ds_adjusted_bounce_rate']) && $_POST['ds_adjusted_bounce_rate'])?$_POST['ds_adjusted_bounce_rate']:0), 94 | 'ds_enqueue_order' => sanitize_text_field((isset($_POST['ds_enqueue_order']) && $_POST['ds_enqueue_order'])?$_POST['ds_enqueue_order']:0), 95 | 'ds_anonymize_ip' => sanitize_text_field((isset($_POST['ds_anonymize_ip']) && $_POST['ds_anonymize_ip'])?$_POST['ds_anonymize_ip']:null), 96 | 'ds_script_position' => sanitize_text_field((isset($_POST['ds_script_position']) && $_POST['ds_script_position'])?$_POST['ds_script_position']:null), 97 | 'caos_disable_display_features' => sanitize_text_field((isset($_POST['caos_disable_display_features'])&& $_POST['caos_disable_display_features'])?$_POST['caos_disable_display_features']:null), 98 | 'ds_track_admin' => sanitize_text_field((isset($_POST['ds_track_admin']) && $_POST['ds_track_admin'])?$_POST['ds_track_admin']:null), 99 | 'caos_remove_wp_cron' => sanitize_text_field((isset($_POST['caos_remove_wp_cron']) && $_POST['caos_remove_wp_cron'])?$_POST['caos_remove_wp_cron']:null), 100 | 101 | ); 102 | if (isset($_POST['disable_gravatars']) && $_POST['disable_gravatars'] == 1) { 103 | update_option('show_avatars', false); 104 | } else { 105 | update_option('show_avatars', true); 106 | } 107 | 108 | if (isset($_POST['default_ping_status']) && $_POST['default_ping_status'] == 1) { 109 | update_option('default_ping_status', 'close'); 110 | } else { 111 | update_option('default_ping_status', 'open'); 112 | } 113 | 114 | if (isset($_POST['close_comments']) && $_POST['close_comments'] == 1) { 115 | update_option('close_comments_for_old_posts', true); 116 | update_option('close_comments_days_old', 28); 117 | } else { 118 | update_option('close_comments_for_old_posts', false); 119 | update_option('close_comments_days_old', 14); 120 | } 121 | 122 | if (isset($_POST['paginate_comments']) && $_POST['paginate_comments'] == 1) { 123 | update_option('page_comments', true); 124 | update_option('comments_per_page', 20); 125 | } else { 126 | update_option('page_comments', false); 127 | update_option('comments_per_page', 50); 128 | } 129 | 130 | $options = $array; 131 | $settings = update_option(WpPerformance::OPTION_KEY . '_settings', $options); 132 | $this->addMessage('Settings updated successfully'); 133 | 134 | $this->redirectUrl(admin_url('tools.php?page=wpperformance')); 135 | } 136 | 137 | private function sendemail($to, $subject, $message, $from) 138 | { 139 | $headers = "From: " . strip_tags($from) . "\r\n"; 140 | $headers .= "MIME-Version: 1.0\r\n"; 141 | $headers .= "Content-Type: text/html; charset=UTF-8\r\n"; 142 | @mail($to, $subject, $message, $headers); 143 | } 144 | 145 | private function addMessage($msg, $type = 'success') 146 | { 147 | if ($type == 'success') { 148 | printf( 149 | "

%s

", 150 | $msg 151 | ); 152 | } else { 153 | printf( 154 | "

%s

", 155 | $msg 156 | ); 157 | } 158 | } 159 | private function redirectUrl($url) 160 | { 161 | //header('Location:'.$url); 162 | echo ''; 165 | } 166 | 167 | public function disable_emojis_tinymce($plugins) 168 | { 169 | if (is_array($plugins)) { 170 | return array_diff($plugins, array('wpemoji')); 171 | } else { 172 | return array(); 173 | } 174 | } 175 | 176 | public function wp_performance_disable_emojis() 177 | { 178 | 179 | $settings = get_option(WpPerformance::OPTION_KEY . '_settings', array()); 180 | if (isset($settings['disable_emoji']) && $settings['disable_emoji'] == 1) { 181 | remove_action('wp_head', 'print_emoji_detection_script', 7); 182 | remove_action('admin_print_scripts', 'print_emoji_detection_script'); 183 | remove_action('wp_print_styles', 'print_emoji_styles'); 184 | remove_action('admin_print_styles', 'print_emoji_styles'); 185 | remove_filter('the_content_feed', 'wp_staticize_emoji'); 186 | remove_filter('comment_text_rss', 'wp_staticize_emoji'); 187 | remove_filter('wp_mail', 'wp_staticize_emoji_for_email'); 188 | add_filter('tiny_mce_plugins', array($this, 'disable_emojis_tinymce')); 189 | } 190 | } 191 | 192 | public function wp_performance_speed_stop_loading_wp_embed() 193 | { 194 | $settings = get_option(WpPerformance::OPTION_KEY . '_settings', array()); 195 | if (isset($settings['disable_embeds']) && $settings['disable_embeds'] == 1) { 196 | if (!is_admin()) { 197 | wp_deregister_script('wp-embed'); 198 | } 199 | } 200 | 201 | } 202 | 203 | public function wp_performance_remove_script_version($src) 204 | { 205 | $settings = get_option(WpPerformance::OPTION_KEY . '_settings', array()); 206 | if (isset($settings['remove_querystrings']) && $settings['remove_querystrings'] == 1) { 207 | $parts = explode('?ver', $src); 208 | return $parts[0]; 209 | } else { 210 | return $src; 211 | } 212 | } 213 | 214 | public function wp_performace_disable_woo_stuffs() 215 | { 216 | $settings = get_option(WpPerformance::OPTION_KEY . '_settings', array()); 217 | if (isset($settings['disable_woocommerce_non_pages']) && $settings['disable_woocommerce_non_pages'] == 1) { 218 | add_action('wp_print_scripts', array($this, 'wp_performance_woocommerce_de_script'), 100); 219 | add_action('wp_enqueue_scripts', array($this, 'wp_performance_remove_woocommerce_generator'), 99); 220 | add_action('wp_enqueue_scripts', array($this, 'child_manage_woocommerce_css')); 221 | } 222 | } 223 | 224 | public function wp_performance_remove_woocommerce_generator() 225 | { 226 | if (function_exists('is_woocommerce')) { 227 | if (!is_woocommerce()) { 228 | // if we're not on a woo page, remove the generator tag 229 | remove_action('wp_head', array($GLOBALS['woocommerce'], 'generator')); 230 | } 231 | } 232 | } 233 | 234 | public function child_manage_woocommerce_css() 235 | { 236 | if (function_exists('is_woocommerce')) { 237 | if (!is_woocommerce() && !is_cart() && !is_checkout() && !is_account_page()) { 238 | // this adds the styles back on woocommerce pages. If you're using a custom script, you could remove these and enter in the path to your own CSS file (if different from your basic style.css file) 239 | wp_dequeue_style('woocommerce-layout'); 240 | wp_dequeue_style('woocommerce-smallscreen'); 241 | wp_dequeue_style('woocommerce-general'); 242 | } 243 | } 244 | } 245 | 246 | public function wp_performance_woocommerce_de_script() 247 | { 248 | if (function_exists('is_woocommerce')) { 249 | if (!is_woocommerce() && !is_cart() && !is_checkout() && !is_account_page()) { 250 | // if we're not on a Woocommerce page, dequeue all of these scripts 251 | wp_dequeue_script('wc-add-to-cart'); 252 | wp_dequeue_script('jquery-blockui'); 253 | wp_dequeue_script('jquery-placeholder'); 254 | wp_dequeue_script('woocommerce'); 255 | wp_dequeue_script('jquery-cookie'); 256 | wp_dequeue_script('wc-cart-fragments'); 257 | } 258 | } 259 | } 260 | public function disabler_kill_rss() 261 | { 262 | wp_die(_e("No feeds available.", 'ippy_dis')); 263 | } 264 | 265 | public function disabler_kill_autosave() 266 | { 267 | wp_deregister_script('autosave'); 268 | } 269 | 270 | public function wcs_woo_remove_reviews_tab($tabs) 271 | { 272 | unset($tabs['reviews']); 273 | return $tabs; 274 | } 275 | 276 | public function wp_performance_optimize_cleanups() 277 | { 278 | $settings = get_option(WpPerformance::OPTION_KEY . '_settings', array()); 279 | if (isset($settings['rsd_clean']) && $settings['rsd_clean']) { 280 | remove_action('wp_head', 'rsd_link'); 281 | } 282 | if (isset($settings['remove_windows_live_writer']) && $settings['remove_windows_live_writer']) { 283 | remove_action('wp_head', 'wlwmanifest_link'); 284 | } 285 | if (isset($settings['remove_wordpress_generator_tag']) && $settings['remove_wordpress_generator_tag']) { 286 | remove_action('wp_head', 'wp_generator'); 287 | } 288 | if (isset($settings['remove_shortlink_tag']) && $settings['remove_shortlink_tag']) { 289 | remove_action('wp_head', 'wp_shortlink_wp_head'); 290 | } 291 | if (isset($settings['remove_wordpress_api_from_header']) && $settings['remove_wordpress_api_from_header']) { 292 | remove_action('wp_head', 'rest_output_link_wp_head'); 293 | } 294 | 295 | if (isset($settings['disable_revisions']) && $settings['disable_revisions']) { 296 | remove_action('pre_post_update', 'wp_save_post_revision'); 297 | } 298 | 299 | if (isset($settings['disable_rss']) && $settings['disable_rss']) { 300 | add_action('do_feed', array($this, 'disabler_kill_rss'), 1); 301 | add_action('do_feed_rdf', array($this, 'disabler_kill_rss'), 1); 302 | add_action('do_feed_rss', array($this, 'disabler_kill_rss'), 1); 303 | add_action('do_feed_rss2', array($this, 'disabler_kill_rss'), 1); 304 | add_action('do_feed_atom', array($this, 'disabler_kill_rss'), 1); 305 | } 306 | if (isset($settings['disable_xmlrpc']) && $settings['disable_xmlrpc']) { 307 | add_filter('xmlrpc_enabled', '__return_false'); 308 | } 309 | if (isset($settings['disable_autosave']) && $settings['disable_autosave']) { 310 | add_action('wp_print_scripts', array($this, 'disabler_kill_autosave')); 311 | } 312 | if (isset($settings['disable_woocommerce_reviews']) && $settings['disable_woocommerce_reviews']) { 313 | add_filter('woocommerce_product_tabs', array($this, 'wcs_woo_remove_reviews_tab'), 98); 314 | } 315 | 316 | } 317 | 318 | public function wp_performance_disable_google_maps() 319 | { 320 | $settings = get_option(WpPerformance::OPTION_KEY . '_settings', array()); 321 | if (isset($settings['disable_google_maps']) && $settings['disable_google_maps'] == 1) { 322 | ob_start('disable_google_maps_ob_end'); 323 | } 324 | 325 | } 326 | 327 | public function wp_performance_dequeue_woocommerce_cart_fragments() 328 | { 329 | $settings = get_option(WpPerformance::OPTION_KEY.'_settings',array()); 330 | if (isset($settings['disable_woocommerce_cart_fragments']) && $settings['disable_woocommerce_cart_fragments'] == 1) { 331 | if (is_front_page()) { 332 | wp_dequeue_script('wc-cart-fragments'); 333 | } 334 | } 335 | } 336 | 337 | } 338 | 339 | function disable_google_maps_ob_end($html) 340 | { 341 | $html = preg_replace('/]*\/\/maps.(googleapis|google|gstatic).com\/[^<>]*><\/script>/i', '', $html); 342 | return $html; 343 | } 344 | -------------------------------------------------------------------------------- /css/optimisationio-statistics-addons.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i"); 2 | 3 | /* ------------------------------------------------*/ 4 | /* AFFOGATO FONT FILES */ 5 | /* BASIC @FONT-FACE STUFF HERE */ 6 | /* ------------------------------------------------*/ 7 | @font-face { 8 | font-family: 'Affogato-Black'; 9 | src: url("../webfont/Affogato-Black.eot"); 10 | src: url("../webfont/Affogato-Black.eot?#iefix") format("embedded-opentype"), url("../webfont/Affogato-Black.woff") format("woff"), url("../webfont/Affogato-Black.woff2") format("woff2"), url("../webfont/Affogato-Black.ttf") format("truetype"), url("../webfont/Affogato-Black.svg") format("svg"); 11 | font-weight: normal; 12 | font-style: normal; 13 | } 14 | @font-face { 15 | font-family: 'Affogato-Bold'; 16 | src: url("../webfont/Affogato-Bold.eot"); 17 | src: url("../webfont/Affogato-Bold.eot?#iefix") format("embedded-opentype"), url("../webfont/Affogato-Bold.woff") format("woff"), url("../webfont/Affogato-Bold.woff2") format("woff2"), url("../webfont/Affogato-Bold.ttf") format("truetype"), url("../webfont/Affogato-Bold.svg") format("svg"); 18 | font-weight: normal; 19 | font-style: normal; 20 | } 21 | @font-face { 22 | font-family: 'Affogato-Medium'; 23 | src: url("../webfont/Affogato-Medium.eot"); 24 | src: url("../webfont/Affogato-Medium.eot?#iefix") format("embedded-opentype"), url("../webfont/Affogato-Medium.woff") format("woff"), url("../webfont/Affogato-Medium.woff2") format("woff2"), url("../webfont/Affogato-Medium.ttf") format("truetype"), url("../webfont/Affogato-Medium.svg") format("svg"); 25 | font-weight: normal; 26 | font-style: normal; 27 | } 28 | @font-face { 29 | font-family: 'Affogato-Regular'; 30 | src: url("../webfont/Affogato-Regular.eot"); 31 | src: url("../webfont/Affogato-Regular.eot?#iefix") format("embedded-opentype"), url("../webfont/Affogato-Regular.woff") format("woff"), url("../webfont/Affogato-Regular.woff2") format("woff2"), url("../webfont/Affogato-Regular.ttf") format("truetype"), url("../webfont/Affogato-Regular.svg") format("svg"); 32 | } 33 | @font-face { 34 | font-family: 'Affogato-Light'; 35 | src: url("../webfont/Affogato-Light.eot"); 36 | src: url("../webfont/Affogato-Light.eot?#iefix") format("embedded-opentype"), url("../webfont/Affogato-Light.woff") format("woff"), url("../webfont/Affogato-Light.woff2") format("woff2"), url("../webfont/Affogato-Light.ttf") format("truetype"), url("../webfont/Affogato-Light.svg") format("svg"); 37 | font-weight: normal; 38 | font-style: normal; 39 | } 40 | 41 | #wpadminbar{ 42 | padding:0; 43 | } 44 | 45 | .wrap{ 46 | font-family: "Affogato-Regular", "Open Sans", Helvetica, Arial; 47 | } 48 | 49 | .wrap-main{ 50 | position:relative; 51 | display:inline-block; 52 | width:100%; 53 | } 54 | 55 | .wrap-main *, 56 | .wrap-main *:before, 57 | .wrap-main *:after { 58 | box-sizing: border-box; 59 | } 60 | 61 | .statistics-wrap{ 62 | position:relative; 63 | float:left; 64 | width:100%; 65 | margin-bottom:20px; 66 | } 67 | 68 | .statistics-wrap-inner{ 69 | position:relative; 70 | width:100%; 71 | display:inline-block; 72 | color:#fff; 73 | color:rgba(255,255,255,0.7); 74 | background-color:#14263a; 75 | } 76 | 77 | .statistics-top{ 78 | display:table; 79 | width:100%; 80 | padding:20px 20px 20px 15px; 81 | background-color:#1b334d; 82 | } 83 | 84 | .statistics-top-cell{ 85 | display:table-cell; 86 | width:33%; 87 | padding:5px; 88 | vertical-align: middle; 89 | font-size: 17px; 90 | text-transform: uppercase; 91 | } 92 | 93 | .statistics-top-cell a{ 94 | white-space: nowrap; 95 | display:inline-block; 96 | text-decoration:none; 97 | border-radius: 46px; 98 | transition: 0.3s; 99 | } 100 | 101 | .statistics-top-cell img{ 102 | display:inline; 103 | vertical-align:middle; 104 | } 105 | 106 | .statistics-top-cell.logo{ 107 | } 108 | 109 | .statistics-top-cell.logo img{ 110 | max-height:46px; 111 | max-width:100%; 112 | } 113 | 114 | .statistics-top-cell.manual-optimisation{ 115 | text-align: center; 116 | } 117 | 118 | .statistics-top-cell.manual-optimisation a, 119 | .addon-activation button{ 120 | padding: 12px 15px; 121 | color: #000000; 122 | background: #ffcc26; 123 | } 124 | 125 | .statistics-top-cell.manual-optimisation a:hover, 126 | .addon-activation button:hover{ 127 | background: #ffd859; 128 | } 129 | 130 | .statistics-top-cell.manual-optimisation a img{ 131 | margin-right:10px; 132 | margin-top:-4px; 133 | } 134 | 135 | .statistics-top-cell.support{ 136 | width:auto; 137 | text-align: right; 138 | } 139 | 140 | .statistics-top-cell.support a{ 141 | color: #ffcc26; 142 | padding: 8px 20px 8px 15px; 143 | } 144 | 145 | .statistics-top-cell.support a:hover{ 146 | background: #fff6d9; 147 | color: #bf9200; 148 | } 149 | 150 | .statistics-top-cell.support a img{ 151 | margin-right:15px; 152 | } 153 | 154 | .statistics-measurements{ 155 | position:relative; 156 | display:inline-block; 157 | width:100%; 158 | float:left; 159 | } 160 | 161 | .statistics-tab-content{ 162 | position:relative; 163 | display:inline-block; 164 | width:100%; 165 | /*padding:4px 5px 5px;*/ 166 | } 167 | 168 | .statistics-tabs-nav{ 169 | display:table; 170 | width:100%; 171 | margin:0; 172 | padding:0; 173 | background-color:#1b334d; 174 | } 175 | 176 | .statistics-tabs-nav li{ 177 | display:table-cell; 178 | vertical-align: middle; 179 | text-align: center; 180 | width:33.3333%; 181 | font-size: 15px; 182 | text-transform: uppercase; 183 | color: #ffcc26; 184 | padding:25px 10px; 185 | transition: 0.3s; 186 | cursor:pointer; 187 | } 188 | 189 | .statistics-tabs-nav li.active, 190 | .statistics-tabs-nav li:hover{ 191 | background-color:#14263a; 192 | } 193 | 194 | .statistics-tab-content{ 195 | position:relative; 196 | width:100%; 197 | float:left; 198 | display:none; 199 | } 200 | 201 | .statistics-tab-content.active{ 202 | display:inline-block; 203 | } 204 | 205 | 206 | 207 | 208 | .stats-section{ 209 | position:relative; 210 | display:table; 211 | width:100%; 212 | font-size:0.75rem; 213 | font-weight:300; 214 | text-align: center; 215 | border-bottom:1px solid rgba(255,255,255,0.03); 216 | } 217 | 218 | .stats-part{ 219 | display:table-cell; 220 | vertical-align: middle; 221 | padding:0 1rem; 222 | border-right:1px solid rgba(255,255,255,0.03); 223 | } 224 | 225 | .stats-section a, 226 | .stats-part .addon-stats .compress-image-saved span, 227 | .stats-part .total-image-compress span, 228 | .stats-part ul.cache-and-database-list li span{ 229 | color:#fff; 230 | } 231 | 232 | .stats-part .addon-stats .compress-image-saved span, 233 | .stats-part .total-image-compress span, 234 | .stats-part ul.cache-and-database-list li span{ 235 | font-size:1.7em; 236 | font-weight:600; 237 | } 238 | 239 | .stats-part .addon-stats i.n_a{ 240 | font-weight:100; 241 | font-size:0.9em; 242 | color:#fff; 243 | color:rgba(255,255,255,0.3); 244 | } 245 | 246 | .stats-part:first-child{ 247 | width:33.4%; 248 | } 249 | 250 | .stats-part:last-child{ 251 | border-right:0; 252 | } 253 | 254 | @media screen and (max-width:776px){ 255 | .stats-section{ 256 | display:inline-block; 257 | float:left; 258 | } 259 | 260 | .stats-part{ 261 | display:inline-block; 262 | width:100% !important; 263 | float:left; 264 | padding:1rem 2rem; 265 | border-right:0; 266 | border-bottom:1px solid rgba(255,255,255,0.03); 267 | } 268 | 269 | .stats-part:last-child{ 270 | border:0; 271 | } 272 | } 273 | 274 | .stats-part .addon-stats{ 275 | position:relative; 276 | width:100%; 277 | display:inline-block; 278 | } 279 | 280 | .stats-part .addon-stats .compress-image-saved{ 281 | position:relative; 282 | display:inline-block; 283 | width:7rem; 284 | margin:0 auto; 285 | border:1px solid rgba(255,255,255,0.2); 286 | border-radius:9999px; 287 | } 288 | 289 | .stats-part .addon-stats .compress-image-saved > div { 290 | position:relative; 291 | height:0; 292 | padding-bottom:100%; 293 | } 294 | 295 | .stats-part .addon-stats .compress-image-saved > div > div{ 296 | position:absolute; 297 | display:table; 298 | top:0; 299 | right:0; 300 | bottom:0; 301 | left:0; 302 | width:100%; 303 | height:100%; 304 | } 305 | 306 | .stats-part .addon-stats .compress-image-saved > div > div > div { 307 | display:table-cell; 308 | vertical-align:middle; 309 | text-align:center; 310 | } 311 | 312 | .stats-part .addon-stats .compress-image-saved span{ 313 | display:inline-block; 314 | width:100%; 315 | padding-top:10px; 316 | } 317 | 318 | .stats-part .total-image-compress{ 319 | display:inline-block; 320 | width:100%; 321 | text-align:center; 322 | } 323 | 324 | .stats-part .total-image-compress span{ 325 | 326 | } 327 | 328 | .stats-part ul.cache-and-database-list{ 329 | display:table; 330 | width:100%; 331 | padding:7px; 332 | margin:10px 0; 333 | border:1px solid rgba(255,255,255,0.05); 334 | border-radius:1px; 335 | } 336 | 337 | .stats-part ul.cache-and-database-list li{ 338 | display:table-cell; 339 | width:33%; 340 | padding:0 5px; 341 | vertical-align:middle; 342 | border-right:1px solid rgba(255,255,255,0.03); 343 | } 344 | 345 | .stats-part ul.cache-and-database-list li:last-child{ 346 | border-right:0; 347 | } 348 | 349 | .stats-part ul.cache-and-database-list li span{ 350 | display:inline-block; 351 | width:100%; 352 | padding-top:5px; 353 | } 354 | 355 | .statistics-tab-content .addon-activation{ 356 | position:relative; 357 | width:100%; 358 | display:inline-block; 359 | text-align:center; 360 | } 361 | 362 | .statistics-tab-content .addon-activation{ 363 | padding-top:2rem; 364 | padding-bottom:2rem; 365 | } 366 | 367 | .statistics-tab-content .addon-activation a{ 368 | display:inline-block; 369 | margin-top:10px; 370 | font-size:1.3em; 371 | text-transform:uppercase; 372 | text-decoration:none; 373 | color:#fff; 374 | } 375 | 376 | .statistics-tab-content .addon-activation a:hover{ 377 | text-decoration:underline; 378 | } 379 | 380 | .statistics-tab-content .addon-activation button{ 381 | position:relative; 382 | min-width: 120px; 383 | padding: 13px 25px; 384 | text-transform:uppercase; 385 | border:0; 386 | border-radius: 46px; 387 | cursor:pointer; 388 | overflow:hidden; 389 | } 390 | 391 | .statistics-tab-content .addon-activation button.disabled:after{ 392 | content: ""; 393 | position:absolute; 394 | top:0; 395 | left:0; 396 | width:100%; 397 | height:100%; 398 | display:block; 399 | background:#ffcc26 url(../images/addon-load.gif) no-repeat center; 400 | } 401 | 402 | .wrap-main .sidebar-section{ 403 | position:relative; 404 | float:left; 405 | width:100%; 406 | } 407 | 408 | .cdn-comming-soon{ 409 | position:relative; 410 | display:table; 411 | width:100%; 412 | margin-bottom:20px; 413 | margin-bottom:1.25rem; 414 | font-size:1.5em; 415 | line-height:1.2; 416 | color:rgba(0,0,0,0.3); 417 | background:rgba(0,0,0,0.1); 418 | } 419 | 420 | .cdn-comming-soon > div{ 421 | display:table-cell; 422 | vertical-align:middle; 423 | font-weight:700; 424 | text-align:center; 425 | text-transform: uppercase; 426 | padding:75px 10px 80px; 427 | } 428 | 429 | .cdn-comming-soon strong{ 430 | font-size:1.3em; 431 | font-weight:inherit; 432 | display:inline-block; 433 | width:100%; 434 | } 435 | 436 | .sidebar-tabs-section{ 437 | position:relative; 438 | display:inline-block; 439 | width:100%; 440 | margin-bottom:1.25rem; 441 | background:#fff; 442 | border:1px solid #e6e6e6; 443 | } 444 | 445 | .sidebar-tabs-nav, 446 | .sidebar-tabs-content{ 447 | position:relative; 448 | display:inline-block; 449 | width:100%; 450 | float:left; 451 | } 452 | 453 | .sidebar-tabs-nav ul{ 454 | position:relative; 455 | display:table; 456 | width:100%; 457 | padding:0; 458 | margin:0; 459 | font-size: 14px; 460 | font-weight: 700; 461 | line-height:1; 462 | text-transform:uppercase; 463 | color:#14263a; 464 | color:#1b334d; 465 | background-color:#f5f5f5; 466 | } 467 | 468 | .sidebar-tabs-nav ul li{ 469 | display:table-cell; 470 | vertical-align:middle; 471 | padding:15px 10px; 472 | text-align:center; 473 | cursor:pointer; 474 | border-right:1px solid #e6e6e6; 475 | border-bottom:1px solid #e6e6e6; 476 | } 477 | 478 | .sidebar-tabs-nav ul li.active{ 479 | border-bottom-color:#fff; 480 | background:#fff; 481 | } 482 | 483 | .sidebar-tabs-nav ul li:last-child{ 484 | border-right:0; 485 | } 486 | 487 | .sidebar-tabs-content{ 488 | } 489 | 490 | .sidebar-tabs-content ul{ 491 | padding:0; 492 | margin:0; 493 | } 494 | 495 | .sidebar-tabs-content ul li{ 496 | position:relative; 497 | width:100%; 498 | float:left; 499 | display:none; 500 | padding:5px 20px 15px; 501 | } 502 | 503 | .sidebar-tabs-content ul li.active{ 504 | display:inline-block; 505 | } 506 | 507 | .sidebar-tabs-content ul li textarea{ 508 | display:inline-block; 509 | width:100%; 510 | min-height:150px; 511 | margin:5px 0 10px; 512 | } 513 | 514 | .export-addons-list-options label{ 515 | position:relative; 516 | display:inline-block; 517 | width:100%; 518 | font-weight: 700; 519 | margin-bottom:15px; 520 | } 521 | 522 | .clear-import-btn, 523 | .copy-export-btn{ 524 | float:right; 525 | } 526 | 527 | .offload-g-analytics-form{ 528 | position:relative; 529 | display:inline-block; 530 | width:100%; 531 | float:left; 532 | padding-top:10px; 533 | } 534 | 535 | .offload-g-analytics-form .form-group{ 536 | position:relative; 537 | width:100%; 538 | float:left; 539 | display:inline-block; 540 | margin-bottom:20px; 541 | } 542 | 543 | .offload-g-analytics-form label{ 544 | display:inline-block; 545 | width:100%; 546 | padding-bottom:10px; 547 | font-weight:600; 548 | } 549 | 550 | @media screen and (min-width:1141px){ 551 | .statistics-wrap{ 552 | width:67%; 553 | } 554 | 555 | .statistics-wrap-inner{ 556 | margin-right:15px; 557 | } 558 | 559 | .wrap-main .sidebar-section{ 560 | width:33%; 561 | } 562 | 563 | .sidebar-section-inner{ 564 | padding-left:15px; 565 | } 566 | } 567 | 568 | @media screen and (max-width:990px){ 569 | .statistics-top-cell{ 570 | font-size: 16px; 571 | } 572 | } 573 | @media screen and (max-width:776px){ 574 | .statistics-top{ 575 | display:inline-block; 576 | padding:25px 0; 577 | } 578 | 579 | .statistics-top-cell{ 580 | position:relative; 581 | display:inline-block; 582 | float:left; 583 | padding:5px; 584 | padding:0 20px; 585 | vertical-align: initial; 586 | text-align: center; 587 | } 588 | 589 | .statistics-top-cell.manual-optimisation{ 590 | width:60%; 591 | 592 | } 593 | 594 | .statistics-top-cell.support{ 595 | width:40%; 596 | text-align:center; 597 | } 598 | 599 | .statistics-top-cell.logo{ 600 | width:100%; 601 | padding-bottom:30px; 602 | } 603 | } 604 | 605 | @media screen and (max-width:580px){ 606 | .statistics-top{ 607 | padding:30px 0 0 0; 608 | } 609 | 610 | .statistics-top-cell.manual-optimisation, 611 | .statistics-top-cell.support, 612 | .statistics-top-cell.logo{ 613 | width:100%; 614 | padding:0 20px 20px; 615 | text-align:center; 616 | } 617 | .statistics-top-cell.logo{ 618 | padding-bottom:30px; 619 | } 620 | 621 | .statistics-top-cell a{ 622 | white-space: normal; 623 | } 624 | } 625 | 626 | 627 | /* ========== Addons(Plugin) Settings ========== */ 628 | 629 | .addon-settings, 630 | .addon-settings-tabs, 631 | .addon-settings-tabs ul, 632 | .addon-settings-section, 633 | .addon-settings-actions-section { 634 | position:relative; 635 | display:inline-block; 636 | width:100%; 637 | } 638 | 639 | .addon-settings{ 640 | padding:1.5rem; 641 | font-size: 1.1em; 642 | } 643 | 644 | .addon-settings-tabs{ 645 | float:left; 646 | } 647 | 648 | .addon-settings-tabs ul{ 649 | float:left; 650 | margin:0; 651 | padding:0; 652 | } 653 | 654 | .addon-settings-tabs ul li{ 655 | position:relative; 656 | width:auto; 657 | float:left; 658 | min-width:15%; 659 | padding:15px 1rem; 660 | margin:0; 661 | font-size: 15px; 662 | font-weight:500; 663 | text-align:center; 664 | text-transform:uppercase; 665 | cursor:pointer; 666 | } 667 | 668 | .addon-settings-tabs ul li:hover{ 669 | color:#fff; 670 | } 671 | 672 | .addon-settings-tabs ul li.active, 673 | .addon-settings-section{ 674 | color:#1b334d; 675 | background-color:#fff; 676 | } 677 | 678 | .addon-settings-section{ 679 | float:left; 680 | } 681 | 682 | .addon-settings-content{ 683 | position:relative; 684 | float:left; 685 | width:100%; 686 | padding:1rem; 687 | display:none; 688 | } 689 | 690 | .addon-settings-content.active{ 691 | display:inline-block; 692 | } 693 | 694 | .addon-settings-content .field{ 695 | display:table; 696 | width:100%; 697 | padding:1rem; 698 | border-bottom:1px solid #e6e6e6; 699 | transition: 0.3s; 700 | } 701 | 702 | .addon-settings-content .field:last-child{ 703 | border:0; 704 | } 705 | 706 | .addon-settings-content .field:nth-child(2n){ 707 | background:#f8f8f8; 708 | } 709 | 710 | .addon-settings-content .field:hover{ 711 | background:#f5f5f5; 712 | } 713 | 714 | .addon-settings-content .field .field-left, 715 | .addon-settings-content .field .field-right{ 716 | display:table-cell; 717 | vertical-align:middle; 718 | } 719 | 720 | .addon-settings-content .field .field-left{ 721 | font-size: 1.05em; 722 | } 723 | 724 | .addon-settings-content .field .field-right{ 725 | text-align: right; 726 | } 727 | 728 | .optio-check-component{ 729 | position:relative; 730 | display:inline-block; 731 | padding-top:4px; 732 | } 733 | 734 | .optio-check { 735 | display: none !important; 736 | } 737 | 738 | .optio-check::-moz-selection, .optio-check:after::-moz-selection, .optio-check:before::-moz-selection, .optio-check *::-moz-selection, .optio-check *:after::-moz-selection, .optio-check *:before::-moz-selection, .optio-check + .optio-check-btn::-moz-selection { 739 | background: none; 740 | } 741 | 742 | .optio-check::selection, .optio-check:after::selection, .optio-check:before::selection, .optio-check *::selection, .optio-check *:after::selection, .optio-check *:before::selection, .optio-check + .optio-check-btn::selection { 743 | background: none; 744 | } 745 | 746 | .optio-check + .optio-check-btn { 747 | outline: 0; 748 | display: block; 749 | width: 4em; 750 | height: 2em; 751 | position: relative; 752 | cursor: pointer; 753 | -webkit-user-select: none; 754 | -moz-user-select: none; 755 | -ms-user-select: none; 756 | user-select: none; 757 | } 758 | 759 | .optio-check + .optio-check-btn:after, 760 | .optio-check + .optio-check-btn:before { 761 | position: relative; 762 | display: block; 763 | content: ""; 764 | width: 50%; 765 | height: 100%; 766 | } 767 | 768 | .optio-check + .optio-check-btn:after { 769 | left: 0; 770 | } 771 | 772 | .optio-check + .optio-check-btn:before { 773 | display: none; 774 | } 775 | 776 | .optio-check:checked + .optio-check-btn:after { 777 | left: 50%; 778 | } 779 | 780 | .optio-check-light + .optio-check-btn { 781 | background: #ddd; 782 | border-radius: 2em; 783 | padding: 2px; 784 | -webkit-transition: all .4s ease; 785 | transition: all .4s ease; 786 | } 787 | 788 | .optio-check-light + .optio-check-btn:after { 789 | border-radius: 50%; 790 | background: #fff; 791 | -webkit-transition: all .2s ease; 792 | transition: all .2s ease; 793 | } 794 | 795 | .optio-check-light:checked + .optio-check-btn { 796 | background: #ffcc26; 797 | } 798 | 799 | .addon-settings-actions-section{ 800 | position:relative; 801 | float:left; 802 | padding:1rem; 803 | border-top:1px solid #e6e6e6; 804 | background-color:#f6f6f6; 805 | } -------------------------------------------------------------------------------- /css/optimisationio-dashboard.css: -------------------------------------------------------------------------------- 1 | .dis-ib{ 2 | display:inline-block; 3 | } 4 | 5 | .ma-0{ 6 | margin:0; 7 | } 8 | 9 | .va-mid{ 10 | vertical-align:middle; 11 | } 12 | 13 | .va-top{ 14 | vertical-align:top; 15 | } 16 | 17 | .va-bottom{ 18 | vertical-align:bottom; 19 | } 20 | 21 | #wpadminbar{ 22 | padding:0; 23 | } 24 | 25 | .wrap-main{ 26 | position:relative; 27 | display:inline-block; 28 | width:100%; 29 | } 30 | 31 | .wrap-main *, 32 | .wrap-main *:before, 33 | .wrap-main *:after { 34 | box-sizing: border-box; 35 | } 36 | 37 | .statistics-wrap{ 38 | position:relative; 39 | float:left; 40 | width:100%; 41 | margin-bottom:20px; 42 | } 43 | 44 | .statistics-wrap-inner{ 45 | position:relative; 46 | width:100%; 47 | display:inline-block; 48 | color:#fff; 49 | color:rgba(255,255,255,0.7); 50 | background-color:#14263a; 51 | } 52 | 53 | .statistics-top{ 54 | display:table; 55 | width:100%; 56 | padding:20px 20px 20px 15px; 57 | background-color:#1b334d; 58 | } 59 | 60 | .statistics-top-cell{ 61 | display:table-cell; 62 | width:33%; 63 | padding:5px; 64 | vertical-align: middle; 65 | font-size: 14px; 66 | text-transform: uppercase; 67 | } 68 | 69 | .statistics-top-cell a{ 70 | /* white-space: nowrap; */ 71 | display:inline-block; 72 | text-decoration:none; 73 | -moz-border-radius: 46px; 74 | -webkit-border-radius: 46px; 75 | border-radius: 46px; 76 | transition: 0.3s; 77 | } 78 | 79 | .statistics-top-cell img{ 80 | display:inline; 81 | vertical-align:middle; 82 | } 83 | 84 | .statistics-top-cell.logo{ 85 | width:25%; 86 | } 87 | 88 | .statistics-top-cell.logo img{ 89 | max-height:42px; 90 | max-width:100%; 91 | } 92 | 93 | .statistics-top-cell.manual-optimisation{ 94 | text-align: center; 95 | } 96 | 97 | .statistics-top-cell.manual-optimisation a, 98 | .addon-activation button{ 99 | padding: 16px 15px 11px; 100 | color: #000000; 101 | background: #ffcc26; 102 | } 103 | 104 | .statistics-top-cell.manual-optimisation a:hover, 105 | .addon-activation button:hover{ 106 | background: #ffd859; 107 | } 108 | 109 | .statistics-top-cell.manual-optimisation a img{ 110 | margin-right:10px; 111 | margin-top:-6px; 112 | } 113 | 114 | .statistics-top-cell.support{ 115 | width:45%; 116 | text-align: right; 117 | } 118 | 119 | .statistics-top-cell.support a{ 120 | display:table; 121 | text-align:center; 122 | color: #ffcc26; 123 | padding: 7px 20px 5px 15px; 124 | } 125 | 126 | .statistics-top-cell.support a:hover { 127 | background: #fff6d9; 128 | color: #bf9200; 129 | } 130 | 131 | .statistics-top-cell.support a img, 132 | .statistics-top-cell.support a span{ 133 | display:table-cell; 134 | vertical-align:middle; 135 | } 136 | 137 | .statistics-top-cell.support a img{ 138 | /*margin-right:15px;*/ 139 | margin-top: 5px; 140 | } 141 | 142 | .statistics-top-cell.support a span{ 143 | padding:0 0 0 5px; 144 | } 145 | 146 | .statistics-measurements{ 147 | position:relative; 148 | display:inline-block; 149 | width:100%; 150 | float:left; 151 | } 152 | 153 | .statistics-tab-content{ 154 | position:relative; 155 | display:inline-block; 156 | width:100%; 157 | /*padding:4px 5px 5px;*/ 158 | } 159 | 160 | .statistics-tabs-nav{ 161 | display:table; 162 | width:100%; 163 | margin:0; 164 | padding:0; 165 | background-color:#1b334d; 166 | } 167 | 168 | .statistics-tabs-nav li{ 169 | display:table-cell; 170 | vertical-align: middle; 171 | text-align: center; 172 | width:33.3333%; 173 | font-size: 15px; 174 | text-transform: uppercase; 175 | color: #ffcc26; 176 | padding:25px 10px; 177 | transition: 0.3s; 178 | cursor:pointer; 179 | } 180 | 181 | .statistics-tabs-nav li.active, 182 | .statistics-tabs-nav li:hover{ 183 | background-color:#14263a; 184 | } 185 | 186 | .statistics-tab-content{ 187 | position:relative; 188 | width:100%; 189 | float:left; 190 | display:none; 191 | } 192 | 193 | .statistics-tab-content.active{ 194 | display:inline-block; 195 | } 196 | 197 | .stats-section{ 198 | position:relative; 199 | display:table; 200 | width:100%; 201 | font-size:0.8rem; 202 | text-align: center; 203 | border-bottom:1px solid rgba(255,255,255,0.03); 204 | } 205 | 206 | .stats-part{ 207 | display:table-cell; 208 | vertical-align: middle; 209 | padding:0 1rem; 210 | border-right:1px solid rgba(255,255,255,0.03); 211 | } 212 | 213 | .stats-section a, 214 | .stats-part .addon-stats .compress-image-saved span, 215 | .stats-part .total-image-compress span, 216 | .stats-part ul.cache-and-database-list li span{ 217 | color:#fff; 218 | } 219 | 220 | .stats-part .addon-stats .compress-image-saved span, 221 | .stats-part .total-image-compress span, 222 | .stats-part ul.cache-and-database-list li span{ 223 | font-size:1.5em; 224 | font-weight:600; 225 | } 226 | 227 | .stats-part .addon-stats i.n_a{ 228 | font-weight:100; 229 | font-size:0.9em; 230 | color:#fff; 231 | color:rgba(255,255,255,0.3); 232 | } 233 | 234 | .stats-part:first-child{ 235 | width:33.4%; 236 | } 237 | 238 | .stats-part:last-child{ 239 | border-right:0; 240 | } 241 | 242 | @media screen and (max-width:776px){ 243 | .stats-section{ 244 | display:inline-block; 245 | float:left; 246 | } 247 | 248 | .stats-part{ 249 | display:inline-block; 250 | width:100% !important; 251 | float:left; 252 | padding:1rem 2rem; 253 | border-right:0; 254 | border-bottom:1px solid rgba(255,255,255,0.03); 255 | } 256 | 257 | .stats-part:last-child{ 258 | border:0; 259 | } 260 | } 261 | 262 | .stats-part .addon-stats{ 263 | position:relative; 264 | width:100%; 265 | display:inline-block; 266 | } 267 | 268 | .stats-part .addon-stats .compress-image-saved{ 269 | position:relative; 270 | display:inline-block; 271 | width:7rem; 272 | margin:0 auto; 273 | border:1px solid rgba(255,255,255,0.2); 274 | -moz-border-radius: 9999px; 275 | -webkit-border-radius: 9999px; 276 | border-radius: 9999px; 277 | } 278 | 279 | .stats-part .addon-stats .compress-image-saved > div { 280 | position:relative; 281 | height:0; 282 | padding-bottom:100%; 283 | } 284 | 285 | .stats-part .addon-stats .compress-image-saved > div > div{ 286 | position:absolute; 287 | display:table; 288 | top:0; 289 | right:0; 290 | bottom:0; 291 | left:0; 292 | width:100%; 293 | height:100%; 294 | } 295 | 296 | .stats-part .addon-stats .compress-image-saved > div > div > div { 297 | display:table-cell; 298 | vertical-align:middle; 299 | text-align:center; 300 | } 301 | 302 | .stats-part .addon-stats .compress-image-saved span{ 303 | display:inline-block; 304 | width:100%; 305 | padding-top:10px; 306 | } 307 | 308 | .stats-part .total-image-compress{ 309 | display:inline-block; 310 | width:100%; 311 | text-align:center; 312 | } 313 | 314 | .stats-part .total-image-compress span{ 315 | 316 | } 317 | 318 | .stats-part ul.cache-and-database-list{ 319 | display:table; 320 | width:100%; 321 | padding:7px; 322 | margin:10px 0; 323 | border:1px solid rgba(255,255,255,0.05); 324 | -moz-border-radius: 1px; 325 | -webkit-border-radius: 1px; 326 | border-radius: 1px; 327 | } 328 | 329 | .stats-part ul.cache-and-database-list li{ 330 | display:table-cell; 331 | width:33%; 332 | padding:0 5px; 333 | vertical-align:middle; 334 | border-right:1px solid rgba(255,255,255,0.03); 335 | } 336 | 337 | .stats-part ul.cache-and-database-list li:last-child{ 338 | border-right:0; 339 | } 340 | 341 | .stats-part ul.cache-and-database-list li span{ 342 | display:inline-block; 343 | width:100%; 344 | padding-top:5px; 345 | } 346 | 347 | .statistics-tab-content .addon-activation{ 348 | position:relative; 349 | width:100%; 350 | display:inline-block; 351 | text-align:center; 352 | } 353 | 354 | .statistics-tab-content .addon-activation{ 355 | padding-top:3rem; 356 | padding-bottom:3rem; 357 | } 358 | 359 | .statistics-tab-content .addon-activation a{ 360 | display:inline-block; 361 | margin-top:10px; 362 | font-size:1.3em; 363 | text-transform:uppercase; 364 | text-decoration:none; 365 | color:#fff; 366 | } 367 | 368 | .statistics-tab-content .addon-activation a:hover{ 369 | text-decoration:underline; 370 | } 371 | 372 | .statistics-tab-content .addon-activation button{ 373 | position:relative; 374 | min-width: 120px; 375 | padding: 13px 25px; 376 | text-transform:uppercase; 377 | border:0; 378 | -moz-border-radius: 46px; 379 | -webkit-border-radius: 46px; 380 | border-radius: 46px; 381 | cursor:pointer; 382 | overflow:hidden; 383 | } 384 | 385 | .statistics-tab-content .addon-activation button.disabled:after{ 386 | content: ""; 387 | position:absolute; 388 | top:0; 389 | left:0; 390 | width:100%; 391 | height:100%; 392 | display:block; 393 | background:#ffcc26 url(../images/addon-load.gif) no-repeat center; 394 | } 395 | 396 | .wrap-main .sidebar-section{ 397 | position:relative; 398 | float:left; 399 | width:100%; 400 | } 401 | 402 | .cdn-comming-soon{ 403 | position:relative; 404 | display:table; 405 | width:100%; 406 | margin-bottom:20px; 407 | margin-bottom:1.25rem; 408 | font-size:1.5em; 409 | line-height:1.2; 410 | color:rgba(0,0,0,0.3); 411 | background:rgba(0,0,0,0.1); 412 | } 413 | 414 | .cdn-comming-soon > div{ 415 | display:table-cell; 416 | vertical-align:middle; 417 | font-weight:500; 418 | text-align:center; 419 | text-transform: uppercase; 420 | padding:75px 10px 80px; 421 | } 422 | 423 | .cdn-comming-soon strong{ 424 | font-size:1.3em; 425 | font-weight:inherit; 426 | display:inline-block; 427 | width:100%; 428 | } 429 | 430 | .sidebar-cloudinary-api, 431 | .sidebar-tabs-section{ 432 | position:relative; 433 | display:inline-block; 434 | width:100%; 435 | margin-bottom:1.25rem; 436 | background:#fff; 437 | border:1px solid #e6e6e6; 438 | } 439 | 440 | .free-api-stats, 441 | .sidebar-title-wrap, 442 | .sidebar-content-wrap, 443 | .sidebar-tabs-nav, 444 | .sidebar-tabs-content{ 445 | position:relative; 446 | display:inline-block; 447 | width:100%; 448 | float:left; 449 | } 450 | 451 | .free-api-stats{ 452 | display:table; 453 | table-layout:fixed; 454 | text-transform:uppercase; 455 | font-size:12px; 456 | font-weight:500; 457 | border-bottom:1px solid #e6e6e6; 458 | background-color:#f5f5f5; 459 | } 460 | 461 | .free-api-stats div{ 462 | display:table-cell; 463 | vertical-align:middle; 464 | padding:15px; 465 | } 466 | 467 | .free-api-stats div span{ 468 | font-weight:500; 469 | font-size:1.4em; 470 | } 471 | 472 | .close-cloudinary-api-msg{ 473 | position:absolute; 474 | display:inline-block; 475 | top:10px; 476 | right:10px; 477 | padding:2px 5px; 478 | line-height:1; 479 | font-size:10px; 480 | font-weight:100; 481 | text-transform: uppercase; 482 | -moz-border-radius: 2px; 483 | -webkit-border-radius: 2px; 484 | border-radius: 2px; 485 | background: rgba(255,255,255,0.1); 486 | cursor:pointer; 487 | } 488 | 489 | .sidebar-title-wrap, 490 | .sidebar-tabs-nav ul{ 491 | font-size: 13px; 492 | font-weight: 500; 493 | line-height:1; 494 | text-transform:uppercase; 495 | color:#1b334d; 496 | background-color:#f5f5f5; 497 | } 498 | 499 | .sidebar-tabs-nav ul{ 500 | position:relative; 501 | display:table; 502 | width:100%; 503 | padding:0; 504 | margin:0; 505 | } 506 | 507 | .sidebar-tabs-nav ul li{ 508 | display:table-cell; 509 | vertical-align:middle; 510 | padding:15px 10px; 511 | text-align:center; 512 | cursor:pointer; 513 | border-right:1px solid #e6e6e6; 514 | border-bottom:1px solid #e6e6e6; 515 | } 516 | 517 | .sidebar-tabs-nav ul li.active{ 518 | border-bottom-color:#fff; 519 | background:#fff; 520 | } 521 | 522 | .sidebar-tabs-nav ul li:last-child{ 523 | border-right:0; 524 | } 525 | 526 | .sidebar-tabs-content{ 527 | } 528 | 529 | .sidebar-tabs-content ul{ 530 | padding:0; 531 | margin:0; 532 | } 533 | 534 | .sidebar-tabs-content ul li{ 535 | position:relative; 536 | width:100%; 537 | float:left; 538 | display:none; 539 | padding:5px 20px 15px; 540 | } 541 | 542 | .sidebar-tabs-content ul li.active{ 543 | display:inline-block; 544 | } 545 | 546 | .sidebar-tabs-content ul li textarea{ 547 | display:inline-block; 548 | width:100%; 549 | min-height:150px; 550 | margin:5px 0 10px; 551 | } 552 | 553 | .export-addons-list-options label{ 554 | position:relative; 555 | display:inline-block; 556 | width:100%; 557 | font-weight: 500; 558 | margin-bottom:15px; 559 | } 560 | 561 | .clear-import-btn, 562 | .copy-export-btn{ 563 | float:right; 564 | } 565 | 566 | .offload-g-analytics-form{ 567 | position:relative; 568 | display:inline-block; 569 | width:100%; 570 | float:left; 571 | padding-top:10px; 572 | } 573 | 574 | .offload-g-analytics-form .form-group{ 575 | position:relative; 576 | width:100%; 577 | float:left; 578 | display:inline-block; 579 | margin-bottom:20px; 580 | } 581 | 582 | .offload-g-analytics-form label{ 583 | display:inline-block; 584 | width:100%; 585 | padding-bottom:10px; 586 | font-weight:600; 587 | } 588 | 589 | @media screen and (min-width:1141px){ 590 | .statistics-wrap{ 591 | width:67%; 592 | } 593 | 594 | .statistics-wrap-inner{ 595 | margin-right:15px; 596 | } 597 | 598 | .wrap-main .sidebar-section{ 599 | width:33%; 600 | } 601 | 602 | .sidebar-section-inner{ 603 | padding-left:15px; 604 | } 605 | } 606 | 607 | @media screen and (max-width:990px){ 608 | .statistics-top-cell{ 609 | font-size: 16px; 610 | } 611 | } 612 | @media screen and (max-width:776px){ 613 | .statistics-top{ 614 | display:inline-block; 615 | padding:25px 0; 616 | } 617 | 618 | .statistics-top-cell{ 619 | position:relative; 620 | display:inline-block; 621 | float:left; 622 | padding:5px; 623 | padding:0 20px; 624 | vertical-align: initial; 625 | text-align: center; 626 | } 627 | 628 | .statistics-top-cell.manual-optimisation{ 629 | width:60%; 630 | 631 | } 632 | 633 | .statistics-top-cell.support{ 634 | width:40%; 635 | text-align:center; 636 | } 637 | 638 | .statistics-top-cell.logo{ 639 | width:100%; 640 | padding-bottom:30px; 641 | } 642 | } 643 | 644 | @media screen and (max-width:580px){ 645 | .statistics-top{ 646 | padding:30px 0 0 0; 647 | } 648 | 649 | .statistics-top-cell.manual-optimisation, 650 | .statistics-top-cell.support, 651 | .statistics-top-cell.logo{ 652 | width:100%; 653 | padding:0 20px 20px; 654 | text-align:center; 655 | } 656 | .statistics-top-cell.logo{ 657 | padding-bottom:30px; 658 | } 659 | 660 | .statistics-top-cell a{ 661 | white-space: normal; 662 | } 663 | } 664 | 665 | 666 | /* ========== Addons(Plugin) Settings ========== */ 667 | 668 | .addon-settings, 669 | .addon-settings-tabs, 670 | .addon-settings-tabs ul, 671 | .addon-settings-section, 672 | .addon-settings-actions-section { 673 | position:relative; 674 | display:inline-block; 675 | width:100%; 676 | } 677 | 678 | .addon-settings{ 679 | padding:1.5rem; 680 | } 681 | 682 | .addon-settings-tabs{ 683 | float:left; 684 | } 685 | 686 | .addon-settings-tabs ul{ 687 | float:left; 688 | margin:0; 689 | padding:0; 690 | } 691 | 692 | .addon-settings-tabs ul li{ 693 | position:relative; 694 | width:auto; 695 | float:left; 696 | min-width:15%; 697 | padding:15px 1rem; 698 | margin:0; 699 | font-size:13px; 700 | font-weight:500; 701 | text-align:center; 702 | text-transform:uppercase; 703 | cursor:pointer; 704 | } 705 | 706 | .addon-settings-tabs ul li:hover{ 707 | color:#fff; 708 | } 709 | 710 | .addon-settings-tabs ul li.active, 711 | .addon-settings-section{ 712 | color:#1b334d; 713 | background-color:#fff; 714 | } 715 | 716 | .addon-settings-section{ 717 | float:left; 718 | } 719 | 720 | .addon-settings-content{ 721 | position:relative; 722 | float:left; 723 | width:100%; 724 | padding:1rem; 725 | display:none; 726 | } 727 | 728 | .addon-settings-content.active{ 729 | display:inline-block; 730 | } 731 | 732 | .addon-settings-content .field{ 733 | position:relative; 734 | display:table; 735 | table-layout:fixed; 736 | width:100%; 737 | padding:1rem; 738 | border-top:1px solid #e6e6e6; 739 | transition: 0.3s; 740 | } 741 | 742 | .addon-settings-content.auto-table-layout .field{ 743 | table-layout: auto; 744 | } 745 | 746 | .addon-settings-content > .field:first-child{ 747 | border-top-width:0; 748 | } 749 | 750 | .addon-settings-content > .field:first-child.brd-top{ 751 | border-top-width:1px; 752 | } 753 | 754 | .addon-settings-content .field:nth-child(2n){ 755 | background:#f8f8f8; 756 | } 757 | 758 | .addon-settings-content .field:hover{ 759 | background:#f5f5f5; 760 | } 761 | 762 | .addon-settings-content .field .field-left, 763 | .addon-settings-content .field .field-right{ 764 | display:table-cell; 765 | vertical-align:middle; 766 | } 767 | 768 | .addon-settings-content .field .field-left{ 769 | padding:0.5rem 0; 770 | font-size: 1.05em; 771 | } 772 | 773 | .addon-settings-content .field .field-right{ 774 | text-align: right; 775 | } 776 | 777 | .addon-settings-content .field.sub-field{ 778 | padding:1rem 1rem 1rem 2rem; 779 | } 780 | 781 | .addon-settings-content .field.sub-sub-field{ 782 | padding:1rem 1rem 1rem 4rem; 783 | } 784 | 785 | /* .addon-settings-content .field.sub-field:after{ 786 | content:""; 787 | position:absolute; 788 | top:2rem; 789 | margin-top:2px; 790 | left:1rem; 791 | height:1px; 792 | width:0.5rem; 793 | background-color:#e6e6e6; 794 | } */ 795 | 796 | /* .addon-settings-content .field.sub-sub-field:after{ 797 | content:""; 798 | position:absolute; 799 | top:2rem; 800 | margin-top:2px; 801 | left:1rem; 802 | height:1px; 803 | width:2.5rem; 804 | background-color:#e6e6e6; 805 | } */ 806 | 807 | .addon-settings-content .field input[type="text"]{ 808 | width:100%; 809 | } 810 | 811 | .addon-settings-content .field select, 812 | .addon-settings-content .field input[type="text"], 813 | .addon-settings-content .field input[type="number"]{ 814 | height:auto; 815 | padding:0.5rem 0.5rem; 816 | } 817 | 818 | .addon-settings-content .field input[type="number"]{ 819 | /*width:100%;*/ 820 | max-width: 100px; 821 | } 822 | 823 | .addon-settings-content .field textarea{ 824 | width:100%; 825 | min-height:100px; 826 | } 827 | 828 | .sidebar-title-wrap{ 829 | padding:15px; 830 | border-bottom:1px solid #e6e6e6; 831 | } 832 | 833 | .sidebar-content-wrap{ 834 | /*padding:15px 20px;*/ 835 | } 836 | 837 | .sidebar-content-wrap .addon-settings-content{ 838 | display:inline-block; 839 | padding:0; 840 | } 841 | 842 | .sidebar-content-wrap .addon-settings-content .field{ 843 | 844 | } 845 | 846 | .optio-check-component{ 847 | position:relative; 848 | display:inline-block; 849 | padding-top:4px; 850 | } 851 | 852 | .checkbox-text{ 853 | display:inline-block; 854 | margin:0; 855 | padding:0.5rem 1rem 0; 856 | vertical-align:top; 857 | } 858 | 859 | .optio-check { 860 | display: none !important; 861 | } 862 | 863 | .optio-check::-moz-selection, .optio-check:after::-moz-selection, .optio-check:before::-moz-selection, .optio-check *::-moz-selection, .optio-check *:after::-moz-selection, .optio-check *:before::-moz-selection, .optio-check + .optio-check-btn::-moz-selection { 864 | background: none; 865 | } 866 | 867 | .optio-check::selection, .optio-check:after::selection, .optio-check:before::selection, .optio-check *::selection, .optio-check *:after::selection, .optio-check *:before::selection, .optio-check + .optio-check-btn::selection { 868 | background: none; 869 | } 870 | 871 | .optio-check + .optio-check-btn { 872 | outline: 0; 873 | display: block; 874 | width: 4em; 875 | height: 2em; 876 | position: relative; 877 | cursor: pointer; 878 | -webkit-user-select: none; 879 | -moz-user-select: none; 880 | -ms-user-select: none; 881 | user-select: none; 882 | } 883 | 884 | .optio-check + .optio-check-btn:after, 885 | .optio-check + .optio-check-btn:before { 886 | position: relative; 887 | display: block; 888 | content: ""; 889 | width: 50%; 890 | height: 100%; 891 | } 892 | 893 | .optio-check + .optio-check-btn:after { 894 | left: 0; 895 | } 896 | 897 | .optio-check + .optio-check-btn:before { 898 | display: none; 899 | } 900 | 901 | .optio-check:checked + .optio-check-btn:after { 902 | left: 50%; 903 | } 904 | 905 | .optio-check-light + .optio-check-btn { 906 | background: #ddd; 907 | -moz-border-radius: 2em; 908 | -webkit-border-radius: 2em; 909 | border-radius: 2em; 910 | padding: 2px; 911 | -webkit-transition: all .4s ease; 912 | transition: all .4s ease; 913 | } 914 | 915 | .optio-check-light + .optio-check-btn:after { 916 | -moz-border-radius: 50%; 917 | -webkit-border-radius: 50%; 918 | border-radius: 50%; 919 | background: #fff; 920 | -webkit-transition: all .2s ease; 921 | transition: all .2s ease; 922 | } 923 | 924 | .optio-check-light:checked + .optio-check-btn { 925 | background: #ffcc26; 926 | } 927 | 928 | .addon-settings-actions-section{ 929 | position:relative; 930 | float:left; 931 | padding:1rem; 932 | border-top:1px solid #e6e6e6; 933 | background-color:#f6f6f6; 934 | } 935 | 936 | .optimising-db-overlay, 937 | .clearing-gravatars-cache-overlay{ 938 | position:absolute; 939 | top:0; 940 | left:0; 941 | right:0; 942 | bottom:0; 943 | width:100%; 944 | height:100%; 945 | display:none; 946 | background:rgba(255,255,255, 0.75); 947 | z-index:+1; 948 | } 949 | 950 | .optimising-db-overlay > div, 951 | .clearing-gravatars-cache-overlay > div{ 952 | position:absolute; 953 | display:table; 954 | top:100%; 955 | right:0; 956 | width:auto; 957 | padding:1.4rem 1rem 0 0; 958 | font-size:0.85rem; 959 | font-weight:500; 960 | overflow:visible; 961 | } 962 | 963 | .optimising-db-overlay > div > div, 964 | .clearing-gravatars-cache-overlay > div > div{ 965 | display:table-cell; 966 | vertical-align:middle; 967 | } 968 | 969 | .optimising-db-overlay > div img, 970 | .clearing-gravatars-cache-overlay > div img{ 971 | margin:0 0 2px 1rem; 972 | vertical-align:inherit; 973 | } 974 | 975 | .donation-overlay-wrap{ 976 | position:absolute; 977 | top:0; 978 | left:0; 979 | bottom:24px; 980 | right:0; 981 | padding-top:30px; 982 | display:block; 983 | background-color:rgba(20,38,58,0.3); 984 | } 985 | 986 | .donation-overlay-wrap.hidden{ 987 | display:none; 988 | } 989 | 990 | .donation-overlay-outer{ 991 | width:100%; 992 | height:100%; 993 | display:table; 994 | } 995 | 996 | .donation-overlay-main{ 997 | display:table-cell; 998 | vertical-align:top; 999 | } 1000 | 1001 | .donation-overlay-inner{ 1002 | position:relative; 1003 | display:block; 1004 | width:94%; 1005 | max-width:450px; 1006 | margin:0 auto; 1007 | border:1px solid #f1f1f1; 1008 | border-color:rgba(20,38,58,0.3); 1009 | -moz-border-radius: 3px; 1010 | -webkit-border-radius: 3px; 1011 | border-radius: 3px; 1012 | overflow:hidden; 1013 | -moz-box-shadow: 0 3px 10px 0 rgba(0,0,0, 0.5); 1014 | -webkit-box-shadow: 0 3px 10px 0 rgba(0,0,0, 0.5); 1015 | box-shadow: 0 3px 10px 0 rgba(0,0,0, 0.5); 1016 | } 1017 | 1018 | .donation-overlay-top{ 1019 | position:relative; 1020 | padding:25px 25px 5px; 1021 | text-align:center; 1022 | background-color:#1b334d; 1023 | color: #ffcc26; 1024 | font-size:13px; 1025 | font-weight:300; 1026 | } 1027 | 1028 | .donation-overlay-top img{ 1029 | max-height:42px; 1030 | margin:0; 1031 | } 1032 | 1033 | .donation-overlay-top span{ 1034 | display:block; 1035 | padding:15px 0; 1036 | text-transform:uppercase; 1037 | } 1038 | 1039 | .donation-overlay-bottom{ 1040 | text-align:center; 1041 | padding:35px 0; 1042 | background-color:#fff; 1043 | background-color:#e6e6e6; 1044 | } 1045 | .donation-overlay-bottom select{ 1046 | margin-bottom:30px; 1047 | } 1048 | 1049 | .donation-overlay-inner button.close{ 1050 | position: absolute; 1051 | top: 10px; 1052 | right: 10px; 1053 | padding: 0; 1054 | display: inline-block; 1055 | text-align: center; 1056 | font-family:sans-serif; 1057 | color: #5dbfd5; 1058 | border-width: 1px; 1059 | border-style: solid; 1060 | border-color: rgba(27,51,77, 0.9); 1061 | background: rgba(255, 255, 255, 0.1); 1062 | -moz-border-radius: 2px; 1063 | -webkit-border-radius: 2px; 1064 | border-radius: 2px; 1065 | cursor: pointer; 1066 | } 1067 | 1068 | .donation-overlay-inner button.close span { 1069 | display:block; 1070 | width: 25px; 1071 | height: 24px; 1072 | line-height: 23px; 1073 | color: #fff; 1074 | color: rgba(255, 255, 255, 0.7); 1075 | } 1076 | 1077 | .donation-overlay-inner button.close:hover span { 1078 | color: rgba(255, 255, 255, 0.9); 1079 | } -------------------------------------------------------------------------------- /lib/class-optimisationio-stats-and-addons.php: -------------------------------------------------------------------------------- 1 | __( "n/a", "optimisationio" ), 15 | "install" => __( "Install", "optimisationio" ), 16 | "activate" => __( "Activate", "optimisationio" ), 17 | "deactivate" => __( "Deactivate", "optimisationio" ), 18 | "changes_may_not_saved" => __("Changes you made may not be saved.", "optimisationio") 19 | ); 20 | add_action( 'admin_menu', array( $this, 'statistics_menu' ), 8 ); 21 | add_action( 'admin_enqueue_scripts', array( $this, 'addons_pages_styles' ) ); 22 | add_action( 'admin_enqueue_scripts', array( $this, 'addons_pages_scripts' ) ); 23 | add_action( 'wp_ajax_optimisationio_install_addon', array( $this, 'ajax_install_addon' ) ); 24 | add_action( 'wp_ajax_optimisationio_deactivate_addon', array( $this, 'ajax_deactivate_addon' ) ); 25 | add_action( 'wp_ajax_optimisationio_activate_addon', array( $this, 'ajax_activate_addon' ) ); 26 | add_action( 'wp_ajax_optimisationio_import_addons_settings', array( $this, 'ajax_import_addons_settings' ) ); 27 | add_action( 'wp_ajax_optimisationio_export_addons_settings', array( $this, 'ajax_export_addons_settings' ) ); 28 | } 29 | 30 | public static function init(){ 31 | if( null === self::$instance ){ 32 | self::$instance = new self(); 33 | } 34 | } 35 | 36 | public function statistics_menu() { 37 | 38 | add_menu_page( __( 'Optimisation.io', 'optimisationio' ), __( 'Optimisation.io', 'optimisationio' ), 'manage_options', 'optimisationio-statistics-and-addons', array( $this, 'statistics_page' ), 'dashicons-dashboard' ); 39 | 40 | add_submenu_page( 'optimisationio-statistics-and-addons', __( 'Statistics', 'optimisationio' ), __( 'Statistics', 'optimisationio' ), 'manage_options', 'optimisationio-statistics-and-addons' ); 41 | } 42 | 43 | public function statistics_page() { 44 | if( null === self::$addons ){ 45 | self::init_addons(); 46 | } 47 | require_once( plugin_dir_path( dirname( __FILE__ ) ) . 'views/optimisationio-statistics-addons.php' ); 48 | } 49 | 50 | public function import_export_page(){ 51 | if( null === self::$addons ){ 52 | self::init_addons(); 53 | } 54 | require_once( plugin_dir_path( dirname( __FILE__ ) ) . 'views/optimisationio-import-export.php' ); 55 | } 56 | 57 | public function addons_pages_styles($hook){ 58 | wp_enqueue_style( 'optimisationio-all', plugin_dir_url( dirname( __FILE__ ) ) . 'css/optimisationio-all.css' ); 59 | if ( 'toplevel_page_optimisationio-statistics-and-addons' === $hook ) { 60 | wp_enqueue_style( 'optimisationio-stats-addons-page', plugin_dir_url( dirname( __FILE__ ) ) . 'css/optimisationio-statistics-addons.css' ); 61 | } 62 | } 63 | 64 | public function addons_pages_scripts($hook){ 65 | if ( 'toplevel_page_optimisationio-statistics-and-addons' === $hook ) { 66 | wp_enqueue_script( 'optimisationio-import-export', plugin_dir_url( dirname( __FILE__ ) ) . 'js/clipboard.min.js' ); 67 | 68 | 69 | wp_enqueue_script( 'optimisationio-stats-addons', plugin_dir_url( dirname( __FILE__ ) ) . 'js/optimisationio-stats-addons.js' ); 70 | } 71 | } 72 | 73 | private function wp_verify_nonce($nonce, $type){ 74 | return wp_verify_nonce( $nonce, $type ); 75 | } 76 | 77 | public function ajax_install_addon(){ 78 | 79 | $post_req = $_POST; // Input var okay. 80 | 81 | $ret = array( 'error' => 1 ); 82 | 83 | if( $this->wp_verify_nonce( $post_req['nonce'], 'optimisationio-addons-nonce' ) ){ 84 | 85 | if( isset( $post_req['link'] ) && $post_req['link'] ){ 86 | 87 | global $wp_filesystem; 88 | 89 | if ( ! $wp_filesystem ) { 90 | if ( ! function_exists( 'WP_Filesystem' ) ) { 91 | require_once( ABSPATH . 'wp-admin/includes/file.php' ); 92 | } 93 | WP_Filesystem(); 94 | } 95 | 96 | // @note: Check if plugins root folder is writable. 97 | if ( ! WP_Filesystem( false, WP_PLUGIN_DIR ) || 'direct' !== $wp_filesystem->method ) { 98 | $ret['msg'] = 'You are not allowed to edt folders/files on this site'; 99 | } 100 | else { 101 | 102 | ob_start(); 103 | require_once( ABSPATH . 'wp-admin/includes/file.php' ); 104 | require_once( ABSPATH . 'wp-admin/includes/misc.php' ); 105 | require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); 106 | require_once( 'class-optimisationio-upgrader-skin.php' ); 107 | $upgrader = new Plugin_Upgrader( new Optimisationio_Upgrader_Skin() ); 108 | $install = $upgrader->install( $post_req['link'] ); 109 | ob_end_clean(); 110 | 111 | if( null === $install ){ 112 | $ret['msg'] = 'Could not complete add-on installation'; 113 | } 114 | else{ 115 | $ret['error'] = 0; 116 | } 117 | 118 | } 119 | 120 | } 121 | else{ 122 | $ret['msg'] = "Invalid addon"; 123 | } 124 | } 125 | else{ 126 | $ret['msg'] = "Invalid user"; 127 | } 128 | 129 | wp_send_json( $ret ); 130 | } 131 | 132 | public function ajax_activate_addon(){ 133 | 134 | $post_req = $_POST; // Input var okay. 135 | 136 | $ret = array( 'error' => 1 ); 137 | 138 | if( $this->wp_verify_nonce( $post_req['nonce'], 'optimisationio-addons-nonce' ) ){ 139 | 140 | if( isset( $post_req['file'] ) && $post_req['file'] ){ 141 | 142 | self::$addons = null; 143 | 144 | $ret['addons_number'] = self::active_addons_number(); 145 | 146 | $result = activate_plugin( $post_req['file'] ); 147 | 148 | if ( ! is_wp_error( $result ) ) { 149 | $ret['error'] = 0; 150 | $ret['msg'] = "Successful activation"; 151 | switch( $post_req['slug'] ){ 152 | case 'wp-disable': 153 | case 'wp-image-compression': 154 | case 'cache-performance': 155 | ob_start(); 156 | self::display_stats__measurements(); 157 | $ret['measurements_content_replace'] = ob_get_contents(); 158 | ob_end_clean(); 159 | } 160 | } 161 | else{ 162 | $ret['msg'] = "Activation error"; 163 | } 164 | } 165 | else{ 166 | $ret['msg'] = "Invalid addon"; 167 | } 168 | } 169 | else{ 170 | $ret['msg'] = "Invalid user"; 171 | } 172 | 173 | wp_send_json( $ret ); 174 | } 175 | 176 | public function ajax_deactivate_addon(){ 177 | 178 | $post_req = $_POST; // Input var okay. 179 | 180 | $ret = array( 'error' => 1 ); 181 | 182 | if( $this->wp_verify_nonce( $post_req['nonce'], 'optimisationio-addons-nonce' ) ){ 183 | 184 | if( isset( $post_req['file'] ) && $post_req['file'] ){ 185 | 186 | self::$addons = null; 187 | 188 | $ret['addons_number'] = self::active_addons_number(); 189 | 190 | if( 1 < self::active_addons_number() ){ 191 | 192 | $result = deactivate_plugins( $post_req['file'] ); 193 | 194 | if ( ! is_wp_error( $result ) ) { 195 | $ret['error'] = 0; 196 | $ret['msg'] = "Successful deactivation"; 197 | 198 | switch( $post_req['slug'] ){ 199 | case 'wp-disable': 200 | case 'wp-image-compression': 201 | case 'cache-performance': 202 | ob_start(); 203 | self::display_stats__measurements(); 204 | $ret['measurements_content_replace'] = ob_get_contents(); 205 | ob_end_clean(); 206 | } 207 | } 208 | else{ 209 | $ret['msg'] = "Dectivation error"; 210 | } 211 | } 212 | else{ 213 | $ret['type'] = "deny-disable"; 214 | $ret['msg'] = "Can not disable all addons."; 215 | } 216 | } 217 | else{ 218 | $ret['msg'] = "Invalid addon"; 219 | } 220 | } 221 | else{ 222 | $ret['msg'] = "Invalid user"; 223 | } 224 | 225 | wp_send_json( $ret ); 226 | } 227 | 228 | public function ajax_import_addons_settings(){ 229 | 230 | $post_req = $_POST; // Input var okay. 231 | 232 | $ret = array( 'error' => 1 ); 233 | 234 | if( $this->wp_verify_nonce( $post_req['nonce'], 'optimisationio-import-export-nonce' ) ){ 235 | 236 | if( ! isset( $post_req['data'] ) || ! is_string( $post_req['data'] ) ){ 237 | $ret['msg'] = __("Invalid import arguments", "optimisationio"); 238 | $ret['type'] = 'invalid_arguments'; 239 | } 240 | else{ 241 | 242 | $decoded_data = json_decode( base64_decode( $post_req['data'] ), true ); 243 | 244 | if( $decoded_data ){ 245 | foreach( self::$addons_slug as $key => $slug ){ 246 | if( isset( $decoded_data[$slug] ) ){ 247 | switch( $slug ){ 248 | case self::$addons_slug[0]: // 'wp-disable'. 249 | update_option( 'wpperformance_rev3a_settings', $decoded_data[$slug] ); 250 | if( self::addon_activated($slug) ){ 251 | WpPerformance::synchronize_discussion_data( $decoded_data[$slug] ); 252 | } 253 | break; 254 | case self::$addons_slug[1]: // 'cache-performance'. 255 | 256 | if( isset( $decoded_data[$slug]['cdn_sett'] ) ){ 257 | update_option( 'Optimisationio_rev3a_cdnsettings', $decoded_data[$slug]['cdn_sett'] ); 258 | } 259 | 260 | if( isset( $decoded_data[$slug]['general_sett'] ) ){ 261 | update_option( 'Optimisationio_rev3a_settings', $decoded_data[$slug]['general_sett'] ); 262 | } 263 | 264 | if( isset( $decoded_data[$slug]['db_opt_sett'] ) ){ 265 | update_option( 'Optimisationio_rev3a_dboptimisesetting', $decoded_data[$slug]['db_opt_sett'] ); 266 | } 267 | 268 | if( isset( $decoded_data[$slug]['gravatar_cache_sett'] ) ){ 269 | update_option( 'Optimisationio_rev3a_gravatar_cache_settings', $decoded_data[$slug]['gravatar_cache_sett'] ); 270 | } 271 | break; 272 | case self::$addons_slug[2]: // 'wp-image-compression'. 273 | 274 | if( isset( $decoded_data[$slug]['general_sett'] ) ){ 275 | update_option( '_wpimage_options', $decoded_data[$slug]['general_sett'] ); 276 | } 277 | 278 | if( isset( $decoded_data[$slug]['cloudinary_sett'] ) ){ 279 | update_option( '_wpimage_options_cloudinary', $decoded_data[$slug]['cloudinary_sett'] ); 280 | } 281 | 282 | if( isset( $decoded_data[$slug]['lazy_load_sett'] ) ){ 283 | update_option( '_wpimage_lazyload_options', $decoded_data[$slug]['lazy_load_sett'] ); 284 | } 285 | 286 | if( isset( $decoded_data[$slug]['max_width'] ) ){ 287 | update_option( 'wpimages_max_width', $decoded_data[$slug]['max_width'] ); 288 | } 289 | 290 | if( isset( $decoded_data[$slug]['max_height'] ) ){ 291 | update_option( 'wpimages_max_height', $decoded_data[$slug]['max_height'] ); 292 | } 293 | 294 | if( isset( $decoded_data[$slug]['quality'] ) ){ 295 | update_option( 'wpimages_quality', $decoded_data[$slug]['quality'] ); 296 | } 297 | 298 | if( isset( $decoded_data[$slug]['quality_auto'] ) ){ 299 | update_option( 'wpimages_quality_auto', $decoded_data[$slug]['quality_auto'] ); 300 | } 301 | 302 | if( isset( $decoded_data[$slug]['max_width_library'] ) ){ 303 | update_option( 'wpimages_max_width_library', $decoded_data[$slug]['max_width_library'] ); 304 | } 305 | 306 | if( isset( $decoded_data[$slug]['max_height_library'] ) ){ 307 | update_option( 'wpimages_max_height_library', $decoded_data[$slug]['max_height_library'] ); 308 | } 309 | 310 | if( isset( $decoded_data[$slug]['max_width_other'] ) ){ 311 | update_option( 'wpimages_max_width_other', $decoded_data[$slug]['max_width_other'] ); 312 | } 313 | 314 | if( isset( $decoded_data[$slug]['max_height_other'] ) ){ 315 | update_option( 'wpimages_max_height_other', $decoded_data[$slug]['max_height_other'] ); 316 | } 317 | 318 | if( isset( $decoded_data[$slug]['bmp_to_jpg'] ) ){ 319 | update_option( 'wpimages_bmp_to_jpg', $decoded_data[$slug]['bmp_to_jpg'] ); 320 | } 321 | 322 | if( isset( $decoded_data[$slug]['png_to_jpg'] ) ){ 323 | update_option( 'wpimages_png_to_jpg', $decoded_data[$slug]['png_to_jpg'] ); 324 | } 325 | break; 326 | } 327 | } 328 | } 329 | 330 | $ret['msg'] = __("Settings imported successfully", "optimisationio"); 331 | $ret['error'] = 0; 332 | } 333 | else{ 334 | $ret['msg'] = __("Imported invalid data", "optimisationio"); 335 | $ret['type'] = 'invalid_data'; 336 | } 337 | } 338 | } 339 | 340 | wp_send_json($ret); 341 | } 342 | 343 | public function ajax_export_addons_settings(){ 344 | 345 | $post_req = $_POST; // Input var okay. 346 | 347 | $ret = array( 'error' => null ); 348 | 349 | if( $this->wp_verify_nonce( $post_req['nonce'], 'optimisationio-import-export-nonce' ) ){ 350 | 351 | if( ! isset( $post_req['data'] ) || ! is_array( $post_req['data'] ) ){ 352 | $ret['msg'] = __("Invalid export arguments", "optimisationio"); 353 | $ret['type'] = 'invalid_arguments'; 354 | } 355 | else{ 356 | 357 | $export = array(); 358 | 359 | foreach( $post_req['data'] as $key => $val ){ 360 | if( self::addon_activated($val) ){ 361 | switch( $val ){ 362 | case self::$addons_slug[0]: // 'wp-disable'. 363 | $export[$val] = get_option( 'wpperformance_rev3a_settings' ); 364 | break; 365 | case self::$addons_slug[1]: // 'cache-performance'. 366 | $export[$val] = array( 367 | 'cdn_sett' => get_option( 'Optimisationio_rev3a_cdnsettings' ), 368 | 'general_sett' => get_option( 'Optimisationio_rev3a_settings' ), 369 | 'db_opt_sett' => get_option( 'Optimisationio_rev3a_dboptimisesetting' ), 370 | 'gravatar_cache_sett' => get_option( 'Optimisationio_rev3a_gravatar_cache_settings' ), 371 | ); 372 | break; 373 | case self::$addons_slug[2]: // 'wp-image-compression'. 374 | $export[$val] = array( 375 | 'general_sett' => get_option( '_wpimage_options' ), 376 | 'cloudinary_sett' => get_option( '_wpimage_options_cloudinary' ), 377 | 'lazy_load_sett' => get_option( '_wpimage_lazyload_options' ), 378 | 'max_width' => get_option( 'wpimages_max_width' ), 379 | 'max_height' => get_option( 'wpimages_max_height' ), 380 | 'quality' => get_option( 'wpimages_quality' ), 381 | 'quality_auto' => get_option( 'wpimages_quality_auto' ), 382 | 'max_width_library' => get_option( 'wpimages_max_width_library' ), 383 | 'max_height_library' => get_option( 'wpimages_max_height_library' ), 384 | 'max_width_other' => get_option( 'wpimages_max_width_other' ), 385 | 'max_height_other' => get_option( 'wpimages_max_height_other' ), 386 | 'bmp_to_jpg' => get_option( 'wpimages_bmp_to_jpg' ), 387 | 'png_to_jpg' => get_option( 'wpimages_png_to_jpg' ), 388 | ); 389 | break; 390 | } 391 | } 392 | } 393 | 394 | $ret['decoded_export'] = $export; 395 | 396 | if( count( $export) ){ 397 | $ret['export'] = base64_encode( json_encode( $export ) ); 398 | $ret['error'] = 0; 399 | } 400 | else{ 401 | $ret['msg'] = __("Can't find saved data to export", "optimisationio"); 402 | $ret['type'] = 'not_saved_data'; 403 | } 404 | } 405 | } 406 | else{ 407 | $ret['msg'] = __("Failed data verification", "optimisationio"); 408 | $ret['type'] = 'verification_fail'; 409 | } 410 | 411 | wp_send_json($ret); 412 | } 413 | 414 | public static function init_addons(){ 415 | 416 | $addon_homepage = array( 417 | self::$addons_slug[0] => 'https://wordpress.org/plugins/wp-disable/', 418 | self::$addons_slug[1] => 'https://wordpress.org/plugins/cache-performance/', 419 | self::$addons_slug[2] => 'https://wordpress.org/plugins/wp-image-compression/', 420 | ); 421 | 422 | $addon_title = array( 423 | self::$addons_slug[0] => 'WP Disable', 424 | self::$addons_slug[1] => 'Cache for WordPress Performance', 425 | self::$addons_slug[2] => 'JPG, PNG Compression and Optimization', 426 | ); 427 | 428 | $addon_file = array( 429 | self::$addons_slug[0] => 'wp-disable/wpperformance.php', 430 | self::$addons_slug[1] => 'cache-performance/optimisationio.php', 431 | self::$addons_slug[2] => 'wp-image-compression/wp-image-compression.php', 432 | ); 433 | 434 | $addon_description = array( 435 | self::$addons_slug[0] => __( 'Improve WordPress performance by disabling unused items.', 'optimisationio' ), 436 | self::$addons_slug[1] => __( 'Simple efficient WordPress caching.', 'optimisationio' ), 437 | self::$addons_slug[2] => __( 'Image Compression and resizing - Setup under the Tools menu', 'optimisationio' ), 438 | ); 439 | 440 | $addon_image = array( 441 | self::$addons_slug[0] => plugin_dir_url( dirname( __FILE__ ) ) . 'images/wp-disable.jpg', 442 | self::$addons_slug[1] => plugin_dir_url( dirname( __FILE__ ) ) . 'images/optimisation-1.jpg', 443 | self::$addons_slug[2] => plugin_dir_url( dirname( __FILE__ ) ) . 'images/wp-image-compression.jpg', 444 | ); 445 | 446 | foreach (self::$addons_slug as $slug) { 447 | self::$addons[$slug] = array( 448 | 'slug' => $slug, 449 | 'title' => $addon_title[$slug], 450 | 'file' => $addon_file[$slug], 451 | 'thumb' => $addon_image[$slug], 452 | 'homepage' => $addon_homepage[$slug], 453 | 'download_link' => self::addon_download_link($slug), 454 | 'installed' => self::addon_installed($slug, $addon_file[$slug]), 455 | 'activated' => self::addon_activated($slug, $addon_file[$slug]), 456 | 'description' => $addon_description[$slug], 457 | ); 458 | } 459 | } 460 | 461 | public static function addon_installed( $slug, $file = false ){ 462 | if($file){ 463 | return file_exists( WP_PLUGIN_DIR . '/' . $file ); 464 | } 465 | if( null === self::$addons ){ 466 | self::init_addons(); 467 | } 468 | return file_exists( WP_PLUGIN_DIR . '/' . self::$addons[$slug]['file'] ); 469 | } 470 | 471 | public static function addon_activated( $slug, $file = false ){ 472 | if($file){ 473 | return self::addon_installed( $slug, $file ) && in_array( $file, apply_filters( 'active_plugins', get_option( 'active_plugins' ) ), true ); 474 | } 475 | if( null === self::$addons ){ 476 | self::init_addons(); 477 | } 478 | 479 | return self::addon_installed( $slug, $file ) && in_array( self::$addons[$slug]['file'], apply_filters( 'active_plugins', get_option( 'active_plugins' ) ), true ); 480 | } 481 | 482 | public static function active_addons_number(){ 483 | if( null === self::$addons ){ 484 | self::init_addons(); 485 | } 486 | return ( defined('OPTIMISATIONIO_WP_DISABLE_ADDON') && (int) self::$addons['wp-disable']['activated'] ? 1 : 0 ) + 487 | ( defined('OPTIMISATIONIO_CACHE_ADDON') && (int) self::$addons['cache-performance']['activated'] ? 1 : 0 ) + 488 | ( defined('OPTIMISATIONIO_IMAGE_COMPRESSION_ADDON') && self::$addons['wp-image-compression']['activated'] ? 1 : 0 ); 489 | } 490 | 491 | public static function addon_download_link($plugin_slug){ 492 | 493 | $transient_id = 'optimisaitionio_addon_download_link[' . $plugin_slug . ']'; 494 | 495 | $link = get_transient( $transient_id ); 496 | 497 | if( false === $link ){ 498 | 499 | if( ! function_exists('plugins_api') ){ 500 | include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); 501 | } 502 | 503 | $plugin_info = plugins_api( 'plugin_information', array( 504 | 'slug' => $plugin_slug, 505 | 'fields' => array( 506 | 'short_description' => false, 507 | 'sections' => false, 508 | 'requires' => false, 509 | 'rating' => false, 510 | 'ratings' => false, 511 | 'downloaded' => false, 512 | 'last_updated' => false, 513 | 'added' => false, 514 | 'tags' => false, 515 | 'compatibility' => false, 516 | 'homepage' => false, 517 | 'donate_link' => false, 518 | ), 519 | ) ); 520 | 521 | if ( ! is_wp_error( $plugin_info ) ) { 522 | $link = isset( $plugin_info->download_link ) ? $plugin_info->download_link : false; 523 | } 524 | 525 | if( $link ){ 526 | set_transient( $transient_id, $link, DAY_IN_SECONDS ); 527 | } 528 | } 529 | 530 | return $link; 531 | } 532 | 533 | public static function echo_stats_size( $valid, $size ){ 534 | $e = '' . __( 'n/a', 'optimisationio' ) . ''; 535 | if( $valid ){ 536 | $size = size_format( $size ); 537 | $e = $size ? $size : '0 B'; 538 | } 539 | echo $e; 540 | } 541 | 542 | public static function echo_addon_state_color( $activated, $installed ){ 543 | echo $installed ? ( $activated ? 'green' : 'orange' ) : 'red'; 544 | } 545 | 546 | public static function delete_transients(){ 547 | foreach (self::$addons_slug as $slug) { 548 | delete_transient('optimisaitionio_addon_download_link[' . $slug . ']'); 549 | } 550 | } 551 | 552 | private static function display_stats__compress_images(){ 553 | $active_addon = self::addon_activated('wp-image-compression'); 554 | if ( $active_addon ) { 555 | global $wpdb; 556 | $image_compress_info = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "image_compression_settings", ARRAY_A); 557 | } 558 | ?> 559 |
560 |
561 |
562 |
563 |
564 | 565 | 566 |
567 |
568 |
569 |
570 |
571 |
572 |
' . self::$str_i18n['n/a'] . ''; ?>  ' ); ?>
573 |
574 |
582 |
583 |
    584 |
  • size : 0 ); ?>
  • 585 |
  • optimised_size : 0 ); ?>
  • 586 |
  • saving : 0 ); ?>
  • 587 |
588 |
    589 |
  • '); ?>' . self::$str_i18n['n/a'] . ''; ?>
  • 590 |
  • '); ?>' . self::$str_i18n['n/a'] . ''; ?>
  • 591 |
592 |
    593 |
  • 594 |
  • ' . self::$str_i18n['n/a'] . ''; ?>
  • 595 |
596 |
597 | '; 602 | ?> 603 |
607 | 608 | 609 | 610 | 611 |
612 | 613 | 617 |
618 |
619 |
620 | 621 |
622 |
623 | 624 |
625 |
626 |
632 |
633 | 634 |

635 |
636 | 637 |
652 |
653 | /> 654 | 655 |