array( 'GitHub', 'Commit to a repository. Cloudflare Pages (or Netlify, Vercel…) builds from it.', 'editor-code' ), 'cloudflare' => array( 'Cloudflare Pages', 'Upload straight to Cloudflare Pages with the Direct Upload API.', 'cloud' ), 'local' => array( 'Local / ZIP', 'Only generate the files. Download them as a ZIP from Tools.', 'portfolio' ), ); CFSP_UI::card_start( 'Deployment method', 'Where finished exports are pushed.' ); ?>
$cfsp_t ) : ?>
'target=github' ) ); ?>
GitHub account

Using the token defined in wp-config.php (CFSP_GITHUB_TOKEN).

@
Connected
Setup needed: the GitHub OAuth App client ID (CFSP_GITHUB_CLIENT_ID) isn\'t set, so Connect GitHub can\'t work yet. See readme.txt → "GitHub OAuth App".', 'error' ); ?>

Opens GitHub so you can approve access. There is nothing to copy back into WordPress.

Use a dedicated repository. It's saved as soon as you choose. Files the export doesn't produce are removed on push, except dotfiles/folders (.github/), README, LICENSE, CNAME and wrangler config.

'Use the same production branch in Cloudflare Pages.' ) ); CFSP_UI::input( 'gh_path', 'Folder in repository', array( 'placeholder' => '(repository root)', 'help' => 'Optional, e.g. public. Match the build output directory.' ) ); ?>
'{reason} = what changed (e.g. Auto: updated "My post"), {count} = number of files.' ) ); ?>
'Defaults to the GitHub account' ) ); CFSP_UI::input( 'gh_author_email', 'Commit author email', array( 'type' => 'email', 'placeholder' => 'you@example.com' ) ); ?>
Connect Cloudflare Pages: Workers & Pages → Create → Pages → Connect to Git → pick this repository. Framework preset None, build command empty, output directory / (or your folder). Every push then deploys automatically.', 'tip' ); else : ?> 'target=cloudflare' ) ); $cfsp_acct_def = defined( 'CFSP_ACCOUNT_ID' ) && CFSP_ACCOUNT_ID; $cfsp_token_def = defined( 'CFSP_API_TOKEN' ) && CFSP_API_TOKEN; ?>
$cfsp_acct_def, 'help' => $cfsp_acct_def ? 'Set in wp-config.php.' : 'Workers & Pages → Account details.', ) ); CFSP_UI::input( 'api_token', 'API token', array( 'type' => 'password', 'disabled' => $cfsp_token_def, 'placeholder' => $cfsp_token_def ? 'Set in wp-config.php' : ( CFSP_Settings::get( 'api_token' ) ? '•••••••• saved (leave blank to keep)' : '' ), 'help' => 'Permission: Account → Cloudflare Pages → Edit.', ) ); CFSP_UI::input( 'project_name', 'Project name', array( 'placeholder' => 'my-site', 'help' => 'Lowercase letters, numbers and dashes. New to Cloudflare Pages? Enter a name, save, then click Create project.', ) ); CFSP_UI::input( 'branch', 'Production branch' ); ?>

'target=local' ) ); ?>

Exports are written to .

Download ZIP

_redirects and _headers files, which Cloudflare Pages reads from the site root.', array( 'show_if' => 'target!=local' ) ); CFSP_UI::toggle( 'redirect_renamed', 'Redirect renamed posts and categories', array( 'help' => 'When the address of a post or page changes (a new slug, a new parent page), its old address redirects to the new one with a 301. Uses WordPress\'s record of old slugs too, so posts renamed earlier are covered. A renamed category or tag (or one moved under another parent, with its sub-categories) redirects to its new address; a deleted one redirects to its parent category, or to the homepage when it has none. Your own lines below come first.' ) ); CFSP_UI::input( 'redirect_grace', 'Except renames soon after publishing', array( 'type' => 'number', 'min' => 0, 'max' => 1440, 'suffix' => 'minutes', 'show_if' => 'redirect_renamed', 'help' => 'Fixing a wrong address within this time after publishing leaves no redirect behind. 0 redirects every rename.', ) ); CFSP_UI::textarea( 'redirects', '_redirects', array( 'rows' => 4, 'placeholder' => '/old-page/ /new-page/ 301', 'help' => 'One rule per line. Rules with a * or a :placeholder are written after all plain rules, because Cloudflare Pages counts every line after the first of them toward its limit of 100 wildcard rules.', ) ); CFSP_UI::textarea( 'headers', '_headers', array( 'rows' => 4, 'placeholder' => "/*\n X-Frame-Options: SAMEORIGIN" ) ); CFSP_UI::card_end();