Skip to content

Move Bot Data Into JSON - #1

Open
greg-randall wants to merge 4 commits into
HuestonCo:mainfrom
greg-randall:main
Open

Move Bot Data Into JSON#1
greg-randall wants to merge 4 commits into
HuestonCo:mainfrom
greg-randall:main

Conversation

@greg-randall

Copy link
Copy Markdown

I pulled all of the bot info code from the main PHP file and moved it into a JSON, so that longer term it's easier to maintain the bot info separate from the PHP file itself.

This mostly involved looking through detect_bot_name(), get_llm_bot_labels(), and get_bot_favicon_domain(), combining the information and creating a JSON 'bot-info.json'. Then rewriting those functions to use the data supplied by get_bot_data(), which checks cache, then validates and caches from file. The WordPress cache of the files is only updated when the plugin version changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant