<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <section id="amasty_fpc" translate="label" type="text" sortOrder="62116" showInDefault="1" showInWebsite="1" showInStore="1">
            <resource>Amasty_Fpc::config</resource>
            <class>separator-top</class>
            <label>Full Page Cache Warmer</label>
            <tab>amasty</tab>
            <group id="amasty_information" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Information</label>
                <frontend_model>Amasty\Fpc\Block\Adminhtml\System\Config\Information</frontend_model>
            </group>
            <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>General</label>
                <field id="enabled" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Enable Extension</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="auto_update" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Auto-update Cache upon the Product Changes</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <comment>Adds product pages urls to the Warmer Queue upon the product edit</comment>
                </field>
                <field id="queue_regenerate" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Auto-generate Queue after Cache Flush</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <comment>Set to yes to automatically generate warmer queue after cache flushing</comment>
                </field>
                <field id="background_queue_regenerate" translate="label comment" type="select" sortOrder="32" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Auto-generate Queue in Background</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <depends>
                        <field id="queue_regenerate">1</field>
                    </depends>
                    <comment>If enabled, warmer queue will be regenerated in background via cron and will not affect admin side performance.</comment>
                </field>
                <field id="enable_flushes_log" translate="label comment" type="select" sortOrder="35" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Enable Cache Flushes Logging</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="ignore_classes" translate="label comment" type="textarea" sortOrder="37" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Exclude Classes from Log</label>
                    <comment>Please specify classes that are not expected to be logged in cache flushes log.</comment>
                    <frontend_model>Amasty\Fpc\Block\Adminhtml\Form\Field\ExcludeClasses</frontend_model>
                    <backend_model>Magento\Config\Model\Config\Backend\Serialized\ArraySerialized</backend_model>
                    <depends>
                        <field id="enable_flushes_log">1</field>
                    </depends>
                </field>
                <field id="customer_activity" translate="label comment" type="select" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Enable Customers' Activity Log</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <tooltip>
                        Such features as FPC Warmer Reports and "Queue Generation Source" is set to "Customers Activity Source" use the data from the log.
                        The setting value should be set to YES to let the a.m. features work.
                    </tooltip>
                </field>
            </group>
            <group id="source_and_priority" translate="label" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Source and Priority</label>
                <field id="source" translate="label comment tooltip" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Queue Generation Source</label>
                    <source_model>Amasty\Fpc\Model\Config\Source\QuerySource</source_model>
                    <comment>The queue for warming up will be created according to the chosen source</comment>
                    <tooltip><![CDATA[<strong>Pages and Priority</strong> - you can choose which pages should be warmed by their types.
                     Drag and drop pages to prioritize pages for the warming queue depending on their importance.<br/>
                    <strong>Text file with one link per line</strong> - you can use a custom text file with a list of links to be crawled (one link per line).<br/>
                    <strong>Sitemap XML</strong> - only URLs represented in the sitemap will be warmed up. The option requires a valid XML sitemap located in your
                    Magento 2 root folder. Also, set the relative path to the Sitemap XML file on your server.<br/>
                    <strong>Sitemap XML and Text File Together</strong> - sometimes it's not enough to warm up URLs from a Sitemap XML only.
                    By using the option you can add a text file with URLs to be warmed up together with the ones from the Sitemap. <br/>
                    <strong>Customers Activity Source</strong> - a list of URLs for warming up will be created according to the Customers Activity Log.
                    It means that the most popular URLs will be at the top of the queue. While the least will be at the bottom. <br/>
                    <strong>Page Types and Text File Together</strong> - by using the option you can create a file with the most valuable pages to warm first and then warm other pages according to their type and priority.]]>
                    </tooltip>
                </field>
                <field id="file_path" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Queue Links File Path</label>
                    <depends>
                        <field id="source" separator=",">2,3,5</field>
                    </depends>
                    <comment><![CDATA[Please, set the relative path to the file on your server. <br/>Example: var/tmp/queue_links.txt]]></comment>
                </field>
                <field id="sitemap_path" translate="label comment" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Sitemap XML File Path</label>
                    <depends>
                        <field id="source" separator=",">1,3</field>
                    </depends>
                    <comment><![CDATA[Please, set the relative path to the Sitemap XML file on your server. <br/>Example: sitemaps/sitemap.xml]]></comment>
                </field>
                <field id="page_types" translate="label tooltip" type="Amasty\Fpc\Block\Adminhtml\Form\Field\PageType" sortOrder="35" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Pages and Priority</label>
                    <tooltip>You can remove a page type from warming up queue by removing the tick from a checkbox.
                        Set page types to be warmed up first by drag and'dropping it to the top of the list.
                    </tooltip>
                    <backend_model>Amasty\Fpc\Model\System\Config\Backend\PageType</backend_model>
                    <depends>
                        <field id="source" separator=",">0,5</field>
                    </depends>
                </field>
            </group>
            <group id="performance_settings" translate="label" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Performance Settings</label>
                <field id="multiple_curl" translate="label comment" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Enable Multi-Process Warming</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <tooltip>
                        Multi-process warming significantly boosts the warming process speed. But it generates the extra load to the server as well.
                        We recommend running the test warming while monitoring the server load first.
                    </tooltip>
                </field>
                <field id="processes_number" translate="label comment" type="text" sortOrder="5" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Number of Parallel Processes</label>
                    <tooltip>
                        The more parallel processes are set the faster is the warming process, as well as the higher is the server load.
                    </tooltip>
                    <validate>validate-greater-than-zero validate-digits</validate>
                    <depends>
                        <field id="multiple_curl">1</field>
                    </depends>
                </field>
                <field id="generate_cron" translate="label comment " type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Queue Generation Schedule</label>
                    <comment><![CDATA[Enter cron expression<br/>
                        <br/>
                        * * * * *<br/>
                        | | | | |<br/>
                        | | | | +---- Day of the Week   (range: 0-6, 1 standing for Monday)<br/>
                        | | | +------ Month of the Year (range: 1-12)<br/>
                        | | +-------- Day of the Month  (range: 1-31)<br/>
                        | +---------- Hour              (range: 0-23)<br/>
                        +------------ Minute            (range: 0-59)<br/>
                        Example: 0 */12 * * * - every twelve hours<br/>
                        <br/>
                        Read more about cron expressions - <a href="https://en.wikipedia.org/wiki/Cron">here</a>]]>
                    </comment>
                </field>
                <field id="max_queue_size" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Queue Max Size</label>
                    <comment>Set the maximum number of pages in the Warmer Queue</comment>
                </field>
                <field id="batch_size" translate="label comment" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Single Batch Size</label>
                    <comment>The number of page URLs that will be processed at a single cron run. Default value is: 50</comment>
                </field>
                <field id="process_cron" translate="label comment" type="text" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Warmer Schedule</label>
                    <comment><![CDATA[Enter cron expression<br/>
                        <br/>
                        * * * * *<br/>
                        | | | | |<br/>
                        | | | | +---- Day of the Week   (range: 0-6, 1 standing for Monday)<br/>
                        | | | +------ Month of the Year (range: 1-12)<br/>
                        | | +-------- Day of the Month  (range: 1-31)<br/>
                        | +---------- Hour              (range: 0-23)<br/>
                        +------------ Minute            (range: 0-59)<br/>
                        Example: */5 * * * * - every five minuts<br/>
                        <br/>
                        Read more about cron expressions - <a href="https://en.wikipedia.org/wiki/Cron">here</a>]]>
                    </comment>
                </field>
                <field id="delay" translate="label comment" type="text" sortOrder="50" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Delay between Requests</label>
                    <comment>Please make sure there is enough delay to keep the server load safe. Default value is: 300 (milliseconds)</comment>
                </field>
                <field id="log_size" translate="label comment" type="text" sortOrder="60" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Log Size</label>
                    <comment>Set the maximum number of lines in the log table</comment>
                </field>
            </group>
            <group id="combinations" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>Page Combinations</label>
                <field id="switch_customer_groups" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Warm Pages per Customer Groups</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <tooltip> Pages for the default customer group will be warmed only if disabled.</tooltip>
                </field>
                <field id="customer_groups" translate="label comment" type="multiselect" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Customer Groups</label>
                    <source_model>Amasty\Fpc\Model\Config\Source\CustomerGroup</source_model>
                    <can_be_empty>1</can_be_empty>
                    <depends>
                        <field id="switch_customer_groups">1</field>
                    </depends>
                    <comment>"General" customer group is used by default even if nothing is selected</comment>
                </field>
                <field id="switch_currencies" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Warm Pages per Currencies</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <tooltip> Pages for the default currency will be warmed only if disabled.</tooltip>
                </field>
                <field id="currencies" translate="label comment" type="multiselect" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Currencies</label>
                    <source_model>Amasty\Fpc\Model\Config\Source\Currency</source_model>
                    <can_be_empty>1</can_be_empty>
                    <depends>
                        <field id="switch_currencies">1</field>
                    </depends>
                    <comment>Default currency is used by default even if nothing is selected</comment>
                </field>
                <field id="switch_stores" translate="label comment" type="select" sortOrder="50" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Warm Pages per Stores</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <tooltip> Pages for the default store will be warmed only if disabled.</tooltip>
                </field>
                <field id="stores" translate="label comment" type="multiselect" sortOrder="60" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Stores</label>
                    <source_model>Magento\Config\Model\Config\Source\Store</source_model>
                    <can_be_empty>1</can_be_empty>
                    <depends>
                        <field id="switch_stores">1</field>
                    </depends>
                    <comment>Default store view is used by default even if nothing is selected</comment>
                </field>
                <field id="ignore_list" translate="label comment" type="textarea" sortOrder="70" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Exclude Pages</label>
                    <comment><![CDATA[Add the regular expressions to exclude pages from warm up<br/>\? - pages with GET param]]></comment>
                    <frontend_model>Amasty\Fpc\Block\Adminhtml\Form\Field\ExcludePages</frontend_model>
                    <backend_model>Magento\Config\Model\Config\Backend\Serialized\ArraySerialized</backend_model>
                </field>
                <field id="process_mobile" translate="label comment" type="select" sortOrder="80" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Process Mobile View</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <comment>The feature should be used if a separate mobile theme is installed on your Magento</comment>
                </field>
                <field id="mobile_agent" translate="label comment" type="text" sortOrder="90" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Mobile Agent</label>
                    <comment>This text will be sent as header on mobile request</comment>
                    <depends>
                        <field id="process_mobile">1</field>
                    </depends>
                </field>
                <field id="user_agents" translate="label comment" type="text" sortOrder="100" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>User Agents</label>
                    <depends>
                        <field id="process_mobile">1</field>
                    </depends>
                </field>
            </group>
            <group id="hole_punch" translate="label" type="text" sortOrder="45" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>FPC Hole Punch</label>
                <field id="hole_punch" translate="label comment" type="textarea" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Hole Punch</label>
                    <comment>Please refresh cache to apply changes. Please note, that not all blocks can be excluded due to Magento restrictions.</comment>
                    <frontend_model>Amasty\Fpc\Block\Adminhtml\Form\Field\HolePunch</frontend_model>
                    <backend_model>Magento\Config\Model\Config\Backend\Serialized\ArraySerialized</backend_model>
                </field>
            </group>
            <group id="connection" translate="label" type="text" sortOrder="50" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>Connection Settings</label>
                <field id="http_auth" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Use HTTP Authentication</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <comment>Use when website is protected with .htaccess</comment>
                </field>
                <field id="login" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Login</label>
                    <depends>
                        <field id="http_auth">1</field>
                    </depends>
                </field>
                <field id="password" translate="label comment" type="password" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Password</label>
                    <depends>
                        <field id="http_auth">1</field>
                    </depends>
                </field>
                <field id="skip_verification" translate="label comment" type="select" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Disable Certificate Verification</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <comment>Enable this only if FPC warmer doesn't work for https</comment>
                </field>
            </group>
            <group id="debug" translate="label" type="text" sortOrder="60" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>Debug</label>
                <field id="show_status" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Show Cache Status</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="context_debug" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Show Context Data</label>
                    <depends>
                        <field id="show_status">1</field>
                    </depends>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="ips" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Show Cache Status Only For</label>
                    <depends>
                        <field id="show_status">1</field>
                    </depends>
                    <comment>Enter IP addresses comma separated</comment>
                </field>
            </group>
            <group id="optimizer" translate="label" type="text" sortOrder="80" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>Lazy Load Compatibility Settings</label>
                <field id="info" translate="label" sortOrder="0" showInDefault="1" showInWebsite="1" showInStore="1">
                    <frontend_model>Amasty\Fpc\Block\Adminhtml\Form\Field\LazyLoadCompatInfo</frontend_model>
                </field>
                <field id="webp_support" translate="label" type="multiselect" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>User Agents</label>
                </field>
                <field id="devices" translate="label" type="multiselect" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Images Resolution</label>
                </field>
            </group>
        </section>
    </system>
</config>
