Skip to content

Create the LLMs.txt automatically and on a schedule.#22253

Merged
leonidasmi merged 12 commits intofeature/llms-txtfrom
llms-txt/create-file
May 15, 2025
Merged

Create the LLMs.txt automatically and on a schedule.#22253
leonidasmi merged 12 commits intofeature/llms-txtfrom
llms-txt/create-file

Conversation

@leonidasmi
Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi commented May 12, 2025

Context

Summary

This PR can be summarized in the following changelog entry:

  • Creates the LLMs.txt automatically and on a schedule.

Relevant technical choices:

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Switch to this PR and deactivate and activate the Yoast SEO plugin (or, if you're QA, install and activate this RC in a "fresh" site (as in, a site that never had this code before) ).
  • Using WP Crontrol, confirm that no scheduled wpseo_llms_txt_population action is created. And no llms.txt file is created.
  • Toggle the setting on and confirm that there's the scheduled action is set for the next week and that the llms.txt file is also instantly created.
  • Remove the cron via the WP Crontrol plugin and file from the file system.
  • Deactivate and activate the Yoast SEO plugin.
  • Using WP Crontrol, confirm that a weekly wpseo_llms_txt_population scheduled action was created, that's about to run in the next 5 minutes
  • Wait 5 minutes and confirm that a (empty if Add content in the llms.txt file #22257 hasnt been merged yet) /llms.txt file has been created in the root of the server and that's accessible in example.com/llms.txt
  • Also confirm that the scheduled action is now set to run in a week.
  • Manually delete the llms.txt file and run the scheduled action. Confirm that the file was regenerated.
  • Toggle the setting off and confirm that there is no scheduled action anymore and that the llms.txt file was deleted
  • Do the same tests but for the first step upgrade to this RC instead of installing it in a new site. Things should still behave the same.

Upgrade routines (no longer relevant after #22281)

  • In a fresh site that didnt have this code before have Yoast SEO activate and checkout this branch. Run the upgrade routine
    • Or if you're QA, install the released version and upgrade to this RC.
  • Using WP Crontrol, confirm that there's no scheduled wpseo_llms_txt_population action.
  • Toggle the setting on and confirm that the wpseo_llms_txt_population got created.
  • Remove the cron via the WP Crontrol plugin and file from the file system.
  • Re-run the upgrade routine and confirm that the wpseo_llms_txt_population was created again, to be ran in 5 minutes.

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes https://github.com/Yoast/reserved-tasks/issues/537

@leonidasmi leonidasmi added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label May 12, 2025
@leonidasmi leonidasmi added this to the feature/llms-txt milestone May 12, 2025
@thijsoo thijsoo marked this pull request as ready for review May 12, 2025 13:33
Copy link
Copy Markdown
Contributor Author

@leonidasmi leonidasmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: 🏗️

Comment thread src/llms-txt/user-interface/llms-txt-cron-callback-integration.php Outdated
Comment thread src/llms-txt/infrastructure/file/wordpress-file-system-adapter.php
Comment thread src/llms-txt/infrastructure/file/wordpress-file-system-adapter.php
Comment thread src/llms-txt/user-interface/enable-llms-txt-option-watcher.php Outdated
Comment thread src/llms-txt/application/file/llms-txt-cron-scheduler.php Outdated
Comment thread src/llms-txt/application/file/llms-txt-cron-scheduler.php Outdated
Comment thread src/llms-txt/application/file/llms-txt-cron-scheduler.php Outdated
Comment thread src/llms-txt/application/file/llms-txt-cron-scheduler.php
@github-actions
Copy link
Copy Markdown

A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch.

@leonidasmi
Copy link
Copy Markdown
Contributor Author

CR + Acceptance is ✅

@leonidasmi leonidasmi merged commit 3b574d1 into feature/llms-txt May 15, 2025
45 of 46 checks passed
@leonidasmi leonidasmi deleted the llms-txt/create-file branch May 15, 2025 07:52
@thijsoo thijsoo mentioned this pull request May 19, 2025
18 tasks
@leonidasmi leonidasmi mentioned this pull request May 21, 2025
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants