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.' ); ?>
Using the token defined in wp-config.php (CFSP_GITHUB_TOKEN).
CFSP_GITHUB_CLIENT_ID) isn\'t set, so Connect GitHub can\'t work yet. See readme.txt → "GitHub OAuth App".', 'error' ); ?>
1. Your one-time code:
····-····
2. then paste the code and click Authorize.
Waiting for approval… this page updates by itself.
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.
public. Match the build output directory.' ) );
?>
{reason} = what changed (e.g. Auto: updated "My post"), {count} = number of files.' ) );
?>
/ (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;
?>
'target=local' ) ); ?>
Exports are written to .
_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();