In the automated production project of WordPress sites, I developed a parser for text specifications.
The task of the parser is to transform a regular text document with access and project parameters into data that can be used by other scripts.
Example of source data
Language — English
GEO — London
Theme — Financial Services
Access
https://********/wp-admin
Login — *******
Password — *********
FTP
***.***.***.**
ftp_user
ftp_password
What is extracted
WordPress URL;
login;
password;
FTP host;
FTP user;
FTP password;
language;
GEO;
theme;
domains;
parameters of a specific site.
How the parser works
Text specification
→ searching for the file through project_config.json
→ splitting into site blocks
→ extracting WordPress access
→ extracting FTP access
→ matching data by sites
→ forming wp_entries and ftp_entries
→ passing to WordPress pipeline
The parser supports:
multiple sites in one specification;
FTP as an optional block;
passwords with special characters;
site selection by index;
different separator options;
fallback path to the file;
a unified data format for Playwright, FTP, and PHP scripts.
The obtained data is further used for:
logging into WordPress;
uploading files via FTP;
importing Elementor;
publishing pages;
setting the language;
generating content;
technical configuration of the site.
The task of the parser is to transform a regular text document with access and project parameters into data that can be used by other scripts.
Example of source data
Language — English
GEO — London
Theme — Financial Services
Access
https://********/wp-admin
Login — *******
Password — *********
FTP
***.***.***.**
ftp_user
ftp_password
What is extracted
WordPress URL;
login;
password;
FTP host;
FTP user;
FTP password;
language;
GEO;
theme;
domains;
parameters of a specific site.
How the parser works
Text specification
→ searching for the file through project_config.json
→ splitting into site blocks
→ extracting WordPress access
→ extracting FTP access
→ matching data by sites
→ forming wp_entries and ftp_entries
→ passing to WordPress pipeline
The parser supports:
multiple sites in one specification;
FTP as an optional block;
passwords with special characters;
site selection by index;
different separator options;
fallback path to the file;
a unified data format for Playwright, FTP, and PHP scripts.
The obtained data is further used for:
logging into WordPress;
uploading files via FTP;
importing Elementor;
publishing pages;
setting the language;
generating content;
technical configuration of the site.