Article Sequence Optimizer
Optimizes infinite scroll performance by managing DOM nodes and visibility for articles.
by XWP · github.com/xwp/article-sequence-optimizer · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/xwp/article-sequence-optimizer/archive/refs/heads/main.zipReadme
Article Sequence Optimizer
Contributors: XWP Tags: performance, infinite-scroll, inp, dom-optimization Requires at least: 6.3 Tested up to: 6.8 Requires PHP: 8.1 Stable tag: 1.0.0
Optimizes infinite scroll performance by managing DOM nodes and visibility for articles.
Description
The Article Sequence Optimizer improves the performance of long article sequences (infinite scroll) by intelligently managing the DOM. It uses a hybrid approach to reduce Interaction to Next Paint (INP) and memory usage:
- CSS Content Visibility: For articles containing iframes (like embeds), it uses
content-visibility: autoto remove them from the video memory / rendering chain, while preventing reloads or flickering when scrolling back. - DOM Detachment: For text/image-only articles, it detaches the content from the DOM and stores it in a memory fragment, significantly reducing the active DOM size and style recalculation costs.
Configuration
Go to Settings → Article Sequence Optimizer to configure the plugin:
- Container Selector: The CSS selector for the direct parent container of your articles (default:
#articles-area). - Article Selector: The CSS selector for the article elements that are direct children of the container (default:
article). - Safelist Iframes Selector: Selectors for iframes that should remain visible (default:
.ad). - Buffer Distance: The distance in pixels for pre-loading articles. Use a single value like
2500pxor specify all 4 directions (default:2500px). - Max Cache Size: Maximum number of articles to keep in memory (default:
50).
Installation
- Upload the plugin files to the
/wp-content/plugins/articles-sequence-optimizerdirectory, or install the plugin through the WordPress plugins screen directly. - Activate the plugin through the 'Plugins' screen in WordPress.
- Navigate to Settings → Article Sequence Optimizer to configure the selectors for your theme.
Frequently Asked Questions
Does this work with any theme?
Yes, as long as you configure the correct Container Selector and Article Selector in the settings.
Will this break my dynamic embeds?
The plugin is designed to handle embeds safely. It uses CSS hiding for articles with iframes/embeds instead of detaching them, which prevents ads from reloading or losing their state. You can also use the Safelist Iframes Selector to exclude specific elements.
Developer Hooks
article_sequence_optimizer_should_load
Filters whether the optimizer script should be loaded.
Parameters:
$should_load(bool): Whether to load the script. Default istrueonly on single posts of type 'post'.
Example: Enable on all post types (including pages and custom post types):
add_filter( 'article_sequence_optimizer_should_load', function( $should_load ) {
return is_singular();
} );Read the full README on GitHub →
Releases
| Tag | Published |
|---|---|
| 1.0.0 | Nov 28, 2025 |
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.