*/
public static function config(): array {
return array(
'endpoint' => rest_url( RestModule::NAMESPACE . '/sync' ),
'nonce' => wp_create_nonce( 'wp_rest' ),
'now' => time(),
'pollMs' => 3000,
'finishedMs' => 2500,
'state' => SyncState::read(),
);
}
public static function render(): void {
$state = SyncState::read();
// A run already in progress is painted as one straight away (and stays so even if the script never runs);
// sync.js fills in the bar, counts and list on its first render.
$running = $state['running'];
echo '
';
echo '
' . esc_html__( 'Sync', 'cortexcommerce' ) . '
';
echo '
' . esc_html__( 'Product changes you approve in CortexCommerce are written to your store every hour. Sync now writes them straight away.', 'cortexcommerce' ) . ' ' . esc_html__( 'Changed products are sent to CortexCommerce every 5 minutes.', 'cortexcommerce' ) . '