6.6. Lifecycle of Events
This section contains the lifecycle of events such as URL collection, crawling, and recrawling events. The lifecycle term refers to the order of application of, e.g., settings defined by you. The lifecycle of the events are given so that you can feel more comfortable while using the settings. If you know which setting is applied when, you have a deeper understanding of the settings and how to use them.
6.6.1. URL Collection Event
The list below shows the order of application of the settings when collecting post URLs from category pages.
Make a request to the target URL by adding Cookies and get the source code
Event: “After category request is made” (The filters registered to this event are executed)
Note
The rest of the items will not be executed if there is an error at this point, such as a “page not found” error or HTML parsing errors.
Find and replace in all post pages (in General Settings Page)
Resolve relative URLs existing in the source code
Event: “After category crawler is ready” (The filters registered to this event are executed)
Prepare featured images
Event: “When the category data is ready” (The filters registered to this event are executed)
6.6.2. Post Crawl and Recrawl Event
The list below shows the order of application of the settings when crawling and recrawling a post.
Note
Certain details are not saved when recrawling. For more information, please refer to Recrawling Section.
Make a request to the target URL by adding Cookies and get the source code
Event: “After post request is made” (The filters registered to this event are executed)
Note
The rest of the items will not be executed if there is an error at this point, such as a “page not found” error or HTML parsing errors.
Find and replace in all post pages (in General Settings Page)
Resolve relative URLs existing in the source code
Prepare pagination information by using the settings defined in Pagination Section
Remove unnecessary elements by using the selectors defined in Unnecessary Element Selectors
Event: “After post crawler is ready” (The filters registered to this event are executed)
Prepare post title
Prepare post excerpt
Prepare categories
Prepare custom short codes
Prepare publish date
Prepare list-type post information by using the settings under List Type Posts Section
Prepare post tag and meta information
Prepare custom post meta
Prepare taxonomies
Prepare and save media files
Save WooCommerce product details by using the settings defined under WooCommerce Section
Prepare the templates
- Post Title Template
- Post Excerpt Template
- List Item Template
- Remove links?
- Convert iframe elements to short code
- Convert script elements to short code
- Gallery Item Template
- Post Content Template
- Template Unnecessary Element Selectors
- Find and replace in post’s content
- Replace short codes that are defined by the plugin in all templates
Prepare the post data
Event: “When the post data is ready” (The filters registered to this event are executed)
Translate the selected contents (Translatable Fields) by using the selected translation service (Translate with)
Event: “After translation” (The filters registered to this event are executed)
Spin the selected contents (Spinnable Fields) by using the selected spinning service (Spin with)
Event: “After spinning” (The filters registered to this event are executed)
After the post data is crawled, it is saved to the database. During the saving operation, these events occur:
- Save post details, such as WooCommerce product data
- Event: “After post details are saved” (The filters registered to this event are executed) (This is executed only when a post is being saved, meaning that this is not available during the tests performed in the Tester Page. You can manually save a post via Manual Crawling Tool to test this.) If there are no post details that need to be saved, this event is still executed.
- Save custom post meta
- Save taxonomies
- Trigger save_post hook
- Event: “After post is completely saved” (The filters registered to this event are executed) (This is executed only when a post is being saved, meaning that this is not available during the tests performed in the Tester Page. You can manually save a post via Manual Crawling Tool to test this.) This event is executed after the post is completely saved. If the post could not be saved, this event will not be executed. For example, this event will not be executed if the post is a duplicate, an error occurs during the saving operation, the saving operation is stopped via the Stop command, and so on.