Comments (5)
Mmm .. let me see if Ajax call does not have a callback for such situations.
If not, I'll see how to do it with a timeout function that can be canceled
in the situation that there is a satisfactory response, since in the case
of a timeout, we should not reset the data reports of the AO admin bar.
2016-08-02 15:34 GMT-03:00 frank goossens [email protected]:
@pablocusto https://github.com/pablocusto ; a tester had a problem with
the ajax request not getting a response
https://wordpress.org/support/topic/preparing-for-autoptimize-210-wanna-test?replies=8#post-8709332
when clearing the cache from the toolbar. could we add a timeout of e.g. 5s
in the static toolbar JS & handle that gracefully somehow?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#54, or mute the thread
https://github.com/notifications/unsubscribe-auth/AArPdY88XK9H2xHn_yYepn6uYDWbDY88ks5qb43DgaJpZM4Ja6bi
.
from autoptimize.
this seems the relevant SO answer; http://stackoverflow.com/a/5225624/237449 ;-)
from autoptimize.
Nice! Excelent!!
So basically it would be something like this:
jQuery.ajax({
type : 'GET',
url : autoptimize_ajax_object.ajaxurl,
data : {'action':action, 'nonce':autoptimize_ajax_object.nonce},
dataType: 'json',
cache : false,
timeout : 5000,
success : function( data )
{
// Remove the Autoptimize Loading Modal
modal_loading.remove();
// Reset output values & class names of cache info
jQuery( '#wp-admin-bar-autoptimize-cache-info .size' ).attr( 'class',
'size green' ).html( '0.00 B' );
jQuery( '#wp-admin-bar-autoptimize-cache-info .files' ).html( '0' );
jQuery( '#wp-admin-bar-autoptimize-cache-info .percentage .numbers'
).attr( 'class', 'numbers green' ).html( '0%' );
jQuery( '#wp-admin-bar-autoptimize-cache-info .autoptimize-radial-bar
.fill' ).attr( 'class', 'fill bg-green' );
// Reset the class names of bullet icon
jQuery( '#wp-admin-bar-autoptimize' ).attr( 'class', 'menupop
bullet-green' );
// Reset the Radial Bar progress
jQuery( '#wp-admin-bar-autoptimize-cache-info .autoptimize-radial-bar
.mask.full, #wp-admin-bar-autoptimize-cache-info .autoptimize-radial-bar
.fill' ).css({
'-webkit-transform' : 'rotate(0deg)',
'-ms-transform' : 'rotate(0deg)',
'transform' : 'rotate(0deg)'
});
},
error: function( jqXHR, textStatus )
{
if ( textStatus === 'timeout' )
{
// Remove the Autoptimize Loading Modal
modal_loading.remove();
}
}
});
Now, we must think how to report that cleaning was not performed
successfully because of a timeout.
You have something in mind of how you want us to make this report?
Some nice Popup, modify the loading icon by another representative, or with
a simple javascript alert?
2016-08-02 17:49 GMT-03:00 frank goossens [email protected]:
this seems the relevant SO answer;
http://stackoverflow.com/a/5225624/237449 ;-)—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#54 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AArPdR40IbQOpL95xR_Jl7DpIHBOa1cPks5qb61egaJpZM4Ja6bi
.
from autoptimize.
Let's try to insert a div with class "notice notice-error" underneath the first .wrap > h1, saying something like "Your Autoptimize cache might not have been purged successfully, please check on the Autoptimize settings-page." (string to go in autoptimizeToolbar.php in wp_localized_script).
from autoptimize.
fixed with #56
from autoptimize.
Related Issues (20)
- Compatible wih WP 6 and PHP 8.1 HOT 1
- Keep the code base clean HOT 3
- Undefined offset autoptimizeStyles.php HOT 3
- autoptimizecriticalcsscron PHP array key warnings HOT 5
- Avif support broken HOT 6
- Minified JS broken with private class identifiers HOT 4
- Disable emoji dns-prefetch in ClassicPress HOT 1
- PHP8 Warning HOT 1
- Optimized JS and inline script order HOT 3
- Problem with media="print" HOT 3
- Inline "background" not replaced with shortpixel HOT 5
- Security risk reported by Kaspersky HOT 6
- Proposal: stronger default settings HOT 9
- Optimised Google Fonts still blocking for 1.3s according to PageSpeed HOT 2
- Add: option to enable WebP as default output format HOT 1
- PHP Warning in cronjob: Trying to access array offset on value of type int in autoptimizeCacheChecker.php HOT 3
- Creation of dynamic property in autoptimizeProTab.php HOT 4
- Proposal: add Plugin Check workflow HOT 6
- Autoptimize deletes all subfolders in /cache/ HOT 3
- Incorrect cache size triggering unnecessary email warnings HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autoptimize.