Comment on page
Preserve your Setka Editor content after the service shutdown
This is a step-by-step guide on ensuring your content created with Setka Editor is safe in WordPress after Setka Editor infrastructure shutdown.
To ensure robust content preservation on WordPress after the Setka Editor infrastructure shutdown this guide will do two things:
- Explain which assets rely on Setka Editor CDN
- Describe the steps needed to migrate mentioned assets to a different CDN
Posts created in Setka Editor use and depend on CSS files, custom fonts and icons. These files are assets.
No. These files are media files and they always stored in your
wp-content/uploads
folder (the real full path used by Setka WordPress plugin comes from wp_upload_dir()
).Most of the assets can be synced (downloaded) to WordPress from Setka CDN automatically by Setka WordPress plugin. However some of them are always stored on Setka CDN. And because of Setka CDN is going to shutdown you will need to do:
- Ensure that auto synced assets are downloaded to your WordPress site successfully.
- Download some assets manually.
- Prepare your site for disabling of Setka CDN because otherwise the plugin will generates errors.
The official Setka plugin for WordPress may be configured in two ways:
- Most of assets are stored on your server.
- All the assets are stored on Setka CDN.
You can check which configuration you are using by following these steps:
- Go to Admin panel > Plugins > Installed Plugins > Setka Editor > Settings > Settings tab.
- Scroll down to the Enable Setka CDN files checkbox.
- If Enable Setka CDN files checkbox is disabled — Most of assets are stored on your server.
- If Enable Setka CDN files checkbox is enabled — All the assets are stored on Setka CDN.
The option selected by Setka plugin as default value depends on multiple factors including your hosting platform and constants in your
wp-config.php
and can also be changed it in the plugin settings.This table represents where the different files are stored, depending on settings:
Files | Setka CDN is disabled | Setka CDN is enabled |
---|---|---|
HTML code | Your server | Your server |
CSS files of Setka styles and grids | Your server | Setka CDN |
Fonts, Icons | Your server | Setka CDN |
JS files of interactive elements (public.js) | Setka CDN | Setka CDN |
Images, Videos | /wp-content/uploads | /wp-content/uploads |
Setka Editor JS file | Setka CDN | Setka CDN |
Setka Editor JSON file | Your Server | Setka CDN |
Setka Editor CSS file | Setka CDN | Setka CDN |
On the frontend side WordPress plugin can use 3 different sets of CSS files for different needs:
Here we will give a brief description of these files to save you time, however if you need more detail you can read about them here.
- 1.Combined CSS file. This single file includes CSS for all your Setka Themes and Layouts.
- 2.Standalone CSS files. These files contain 1 theme or layout per 1 file + Common files.
- 3.AMP CSS. Used as replacement for first 2 types of CSS on AMP pages.
AMP styles are always used only on AMP pages and can be used with the https://amp-wp.org/ WordPress plugin. If you have AMP pages built with Setka editor, these pages will use AMP CSS files. For more details on AMP check this page.
Go to the Admin panel > Plugins > Installed Plugins > Setka Editor > Settings > Settings tab on your site and find the "Styles" setting. Depending on which radio button is selected, you will have different modes enabled.
If Default radio button is selected then your site will use Standalone styles if possible (= they successfully synced).
If Legacy radio button is selected then your site will use Combined CSS file.
In case of incomplete sync or if no radio button is selected, then the plugin will use combined styles.
If you don't have AMP pages on your site you can skip the AMP sync.
Use the
wp setka-editor amp status
command in WP CLI to see your current sync status. If the sync is completed successfully then you will see the results as shown below.The values from
setka_editor_amp_styles_id
and setka_editor_amp_styles
have different values and depend on your themes and layouts configuration in Setka Editor Configurator.Successful sync must have the following values:
-
Name: setka_editor_amp_sync
Value: true
-
Name: setka_editor_amp_sync_stage
Value: ok
-
Name: setka_editor_use_amp_styles
Value: true
# Output example of the command
# wp setka-editor amp status
# with successfull and completed AMP styles sync
---
-
Name: setka_editor_amp_styles_id
Value: int(WP_POST_ID)
-
Name: setka_editor_amp_styles
Value:
common:
-
id: int(ID)
url: string(URL)
filetype: css
wp_id: int(WP_POST_ID)
themes:
-
id: string(SHORT_THEME_NAME)
url: string(URL)
filetype: css
fonts:
- string(URL)
wp_id: int(WP_POST_ID)
...
layouts:
-
id: string(SHORT_LAYOUT_NAME)
url: string(URL)
filetype: css
wp_id: int(WP_POST_ID)
...
-
Name: setka_editor_amp_sync_attempts_limit_failure
Value: false
-
Name: setka_editor_amp_sync_failure_notice
Value: true
-
Name: setka_editor_amp_sync_failure
Value: false
-
Name: setka_editor_amp_sync_last_failure_name
Value: ""
-
Name: setka_editor_amp_sync
Value: true
-
Name: setka_editor_amp_sync_stage
Value: ok
-
Name: setka_editor_use_amp_styles
Value: true
The same as AMP but the command is
wp setka-editor standalone status
Successful sync must have the following values:
-
Name: setka_editor_standalone_sync
Value: true
-
Name: setka_editor_standalone_sync_stage
Value: ok
-
Name: setka_editor_use_standalone_styles
Value: true
# Output example of the command
# wp setka-editor standalone status
# with successfull and completed AMP styles sync
---
-
Name: setka_editor_standalone_styles_id
Value: 5680
-
Name: setka_editor_standalone_styles
Value:
common:
-
id: 279
url: https://ceditor.setka.io/common_css/common_css_1634572086.css
filetype: css
wp_id: 5541
wp_path: common_css/common_css_1634572086.css
common_critical:
-
id: 282
url: https://ceditor.setka.io/common_css/common_css_critical_1634572087.css
filetype: css
wp_id: 5542
wp_path: common_css/common_css_critical_1634572087.css
common_deferred:
-
id: 283
url: https://ceditor.setka.io/common_css/common_css_deferred_1634572088.css
filetype: css
wp_id: 5543
wp_path: common_css/common_css_deferred_1634572088.css
themes:
-
id: "4507"
url: https://ceditor.setka.io/clients/FDpZD23CECgbOoZdCtwCC3PZuKjwjFKQ/css/fp9hT3WyyBva92-tO43DBg.css
filetype: css
wp_id: 5661
wp_path: clients/FDpZD23CECgbOoZdCtwCC3PZuKjwjFKQ/css/fp9hT3WyyBva92-tO43DBg.css
-
id: "11425"
url: https://ceditor.setka.io/clients/FDpZD23CECgbOoZdCtwCC3PZuKjwjFKQ/css/Qejmalurx_rzOQYzJfj5jw.css
filetype: css
wp_id: 5662
wp_path: clients/FDpZD23CECgbOoZdCtwCC3PZuKjwjFKQ/css/Qejmalurx_rzOQYzJfj5jw.css
themes_critical:
-
id: "4507"
url: https://ceditor.setka.io/clients/FDpZD23CECgbOoZdCtwCC3PZuKjwjFKQ/css/aUcm4mm9kcprne6fRDwR5A_critical.css
filetype: css
fonts:
- 'https://fonts.googleapis.com/css?family=Open+Sans:400,700%7COpen+Sans+Condensed:400,400i,700&subset=cyrillic&display=swap'
wp_id: 5663
wp_path: clients/FDpZD23CECgbOoZdCtwCC3PZuKjwjFKQ/css/aUcm4mm9kcprne6fRDwR5A_critical.css
-
id: "11425"
url: https://ceditor.setka.io/clients/FDpZD23CECgbOoZdCtwCC3PZuKjwjFKQ/css/eS0U5Ul-FfppO9L2fFGnaQ_critical.css
filetype: css
fonts:
- 'https://fonts.googleapis.com/css?family=Merriweather:300%7CPT+Serif:400i%7COpen+Sans:400,800%7CRoboto+Slab:300,400%7CMontserrat:800%7CZilla+Slab:400&subset=cyrillic_ext,latin_ext,latin,cyrillic,greek,cyrillic_ext,latin_ext,greek_ext,vietnamese,latin,cyrillic,cyrillic,latin_ext,cyrillic_ext,latin,latin_ext,latin&display=swap'
wp_id: 5664
wp_path: clients/FDpZD23CECgbOoZdCtwCC3PZuKjwjFKQ/css/eS0U5Ul-FfppO9L2fFGnaQ_critical.css
themes_deferred:
-
id: "4507"
url: https://ceditor.setka.io/clients/FDpZD23CECgbOoZdCtwCC3PZuKjwjFKQ/css/mgePjTlZ0NwQQIA8tGg6Jw_deferred.css
filetype: css
wp_id: 5665
wp_path: clients/FDpZD23CECgbOoZdCtwCC3PZuKjwjFKQ/css/mgePjTlZ0NwQQIA8tGg6Jw_deferred.css
-
id: "11425"
url: https://ceditor.setka.io/clients/FDpZD23CECgbOoZdCtwCC3PZuKjwjFKQ/css/l1rQYS1-C12_M1kGvh0OZA_deferred.css
filetype: css
wp_id: 5666
wp_path: clients/FDpZD23CECgbOoZdCtwCC3PZuKjwjFKQ/css/l1rQYS1-C12_M1kGvh0OZA_deferred.css
layouts:
-
id: 4col_12670
url: https://ceditor.setka.io/clients/FDpZD23CECgbOoZdCtwCC3PZuKjwjFKQ/layout_option_builds/38185/RDPHZsCnZmRw1qH5g68BCg.css
filetype: css
wp_id: 5667
wp_path: clients/FDpZD23CECgbOoZdCtwCC3PZuKjwjFKQ/layout_option_builds/38185/RDPHZsCnZmRw1qH5g68BCg.css
-
id: 6col_limited_940
url: https://ceditor.setka.io/clients/FDpZD23CECgbOoZdCtwCC3PZuKjwjFKQ/layout_option_builds/38186/ojGKxokMAoQlEgjMxI_DJA.css
filetype: css
wp_id: 5668
wp_path: clients/FDpZD23CECgbOoZdCtwCC3PZuKjwjFKQ/layout_option_builds/38186/ojGKxokMAoQlEgjMxI_DJA.css
-
id: 4col
url: https://ceditor.setka.io/clients/FDpZD23CECgbOoZdCtwCC3PZuKjwjFKQ/layout_option_builds/38187/PwQHDpT6PTFV_e9B2yUzfQ.css
filetype: css
wp_id: 5669
wp_path: clients/FDpZD23CECgbOoZdCtwCC3PZuKjwjFKQ/layout_option_builds/38187/PwQHDpT6PTFV_e9B2yUzfQ.css
-
Name: setka_editor_standalone_sync_attempts_limit_failure
Value: false
-
Name: setka_editor_standalone_sync_failure_notice
Value: true
-
Name: setka_editor_standalone_sync_failure
Value: false
-
Name: setka_editor_standalone_sync_last_failure_name
Value: ""
-
Name: setka_editor_standalone_sync
Value: true
-
Name: setka_editor_standalone_sync_stage
Value: ok
-
Name: setka_editor_use_standalone_styles
Value: true
Successful sync has the following values:
-
Name: setka_editor_file_sync_failure
Value: false
-
Name: setka_editor_file_sync_stage
Value: ok
-
Name: setka_editor_file_sync
Value: true
-
Name: setka_editor_use_local_files
Value: true
# wp setka-editor files status
---
-
Name: setka_editor_files
Value:
-
id: int(ID)
url: string(SETKA_CDN_URL)
filetype: css
-
...
-
Name: setka_editor_file_sync_failure
Value: false
-
Name: setka_editor_file_sync_stage
Value: ok
-
Name: setka_editor_file_sync
Value: true
-
Name: setka_editor_use_local_files
Value: true
The last thing on the list that needs to be downloaded from Setka CDN and stored on your server is the JS files of interactive elements, or simply public.js. Here is how to download the file:
First step — go to your server with WordPress and create a
download-public.php
with the following content (bellow).<?php
$container = $GLOBALS['WPSetkaEditorPlugin']->getContainer();
/**
* @var $themePluginsJS \Setka\Editor\Admin\Options\ThemePluginsJSOption
*/
$themePluginsJS = $container->get(\Setka\Editor\Admin\Options\ThemePluginsJSOption::class);
$downloader = new \Setka\Editor\Admin\Service\FilesSync\WordPressDownloader();
$fileSystem = \Setka\Editor\Admin\Service\Filesystem\FilesystemFactory::create();
// Download the file to a temporary location.
$tmpFile = $downloader->download($themePluginsJS->get())->getResult();
$basePath = path_join(
call_user_func($container->getParameter('wp.plugins.setka_editor.dynamic.storage_path')),
$container->getParameter('wp.plugins.setka_editor.storage_basename')
);
$urlPath = parse_url($themePluginsJS->get(), PHP_URL_PATH);
$dstFolderPath = trim(dirname($urlPath), '/\\');
$dstPathFragments = explode('/', $dstFolderPath);
$_a = $basePath;
foreach ($dstPathFragments as $dstPathFragment) {
$_a = path_join($_a, $dstPathFragment);
if (!$fileSystem->exists($_a)) {
$fileSystem->mkdir($_a);
}
}
$dstFile = path_join($_a, basename($urlPath));
try {
$fileSystem->move($tmpFile, $dstFile);
} catch (\Exception $exception) {
echo 'The file haven\'t moved from the temporary folder to the destination. The destination file may already exists. Check the path, delete the file and try run this script again.' . PHP_EOL .
'The file you tried to download and save: ' . $themePluginsJS->get() . PHP_EOL .
'The destination path: ' . $dstFile . PHP_EOL;
exit(1);
}
$dstUrl = path_join(
path_join(
$container->getParameter('wp.plugins.setka_editor.storage_url'),
$container->getParameter('wp.plugins.setka_editor.storage_basename')
),
ltrim($urlPath, '/\\')
);
$themePluginsJS->updateValue($dstUrl);
Second — run the command
wp eval-file download-public.php
.Because Setka CDN will not be accessible and your site (with Setka Editor WordPress plugin) will not able download assets. If cron events are not disabled by the time Setka CDN shuts down, the plugin will start producing errors.
These commands disable the sync cron events.
wp setka-editor standalone disable
wp setka-editor amp disable
wp setka-editor files disable
wp cron event delete setka_editor_cron_sync_account
As an extra safe step you can manually check that all Setka-realted events were removed by using
wp cron event list
command. If there are, for some reasons, events still exists you may remove them manually with wp cron event delete EVENT_NAME
command.All Setka-related Cron events have the hook name starting with setka_editor_*.
WARNING: if someone clicks "Manual Sync" or "Change license key" all of the sync functionality will be re-enabled and you will need to disable cron events again after a successful sync.
By this time you should have the necessary assets synced with your WordPress server, public.js stored on your server and cron events disabled.
- 1.Check if your Setka posts use any assets, stored on Setka CDN (Keep in mind that this method will show only assets loaded after the Network tab was opened):
- 1.Open the browser's developer tools (
CMD+ALT+I
on Mac OS orF12
on Windows). - 2.Switch to the Network tab of developer tools.
- 3.Filter the list а files by
ceditor.setka.io
and reload the page.
- 2.If files are showing up in the list, they were not saved on your server and continue to load from Setka CDN.
- 3.Using information in the guide above, download assets from Setka CDN to your server.
If you have technical questions on the documentation above, please contact our support team at [email protected] with the topic "Preserving Setka Editor content after the service shutdown".