Delete 100+ posts or media files from wordpress faster than default?
Delete 100+ posts or media files from wordpress faster than default?
Delete 100+ posts or media files from wordpress faster than default?
You need a js file.. Then call using js a stream function ajaxStreamCall(){ $.ajax({ type:’POST’, data : { action: ‘get_stream’, offset : +++ //you will need to find a method to offset from your current posts }, success: function(obj){ $(obj).prependTo(‘#news-stream’); }, url: “/wp-admin/admin-ajax.php” }); } You will need to find what your offset is, maybe … Read more
The WP_Widget class seems to run many times on a page load
If you want to defer loading of css, see CSS delivery optimization: How to defer css loading?. If you want to defer loading of js, you can use this: add_filter( ‘script_loader_tag’, function( $tag, $handle ) { return str_replace( “<script type=”text/javascript””, “<script type=”text/javascript” defer=”defer””, $tag ); }, 10, 2 );
@Edward, You’ve configured the Xdebug profiler output filename in such a way that it overwrites the output file, each time, you run the process. %u, %H, %R – you mentioned in the output name are called format specifiers. There are couple of ways to figure out which file you may want to analyze. Use %t … Read more
Calculating efficiently on large amount of data generated by wp_query
$limit = 5; if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); if ( in_array( get_the_ID(), $posts_to_exclude, true ) && $limit > 0 ) { continue; } $limit–; the_title(); endwhile; endif;
Best practice for plugins which are not hosted on wordpress.org is to hook into the wordpress update workflow, and do the version check request at that time. This means that updates are being checked only when core decides that it is time to check, which usually happens at an admin page load once every 7 … Read more
It is relatively rare for WP to have query performance issues on a small to moderately sized site: The queries it typically runs are reasonable (not perfect, but reasonable). A lot of things queried are aggressively cached within page load, and persistently with object cache available. While you certainly can throw enough code at it … Read more
You could activate the Query Monitor plugin and then load the post(s) / page(s) that are giving you trouble. It will show you where the slowness is being caused, core, theme, plugin A or Plugin B. It is often possible to speed up a slow query by adding the appropriate index. Try reading this article … Read more