cron-setting.php
5 months ago
custom-directory.php
1 month ago
directory-navigation.php
2 weeks ago
exclude-settings.php
5 months ago
external-database.php
3 months ago
login-data.php
4 days ago
mail-setting.php
5 months ago
plugins-update.php
1 year ago
process-lock.php
1 year ago
scan.php
2 weeks ago
start.php
1 year ago
symlink-uploads.php
1 year ago
update.php
1 year ago
symlink-uploads.php
53 lines
| 1 | <?php |
| 2 | |
| 3 | use WPStaging\Backend\Modules\Jobs\Scan; |
| 4 | use WPStaging\Framework\Facades\Info; |
| 5 | use WPStaging\Framework\Facades\UI\Checkbox; |
| 6 | |
| 7 | /** |
| 8 | * This file is currently being called for the both FREE and PRO version: |
| 9 | * @see src/views/clone/ajax/scan.php:89 |
| 10 | * |
| 11 | * @var Scan $scan |
| 12 | * @var stdClass $options |
| 13 | * @var bool $isPro |
| 14 | * @var object $wpDefaultDirectories |
| 15 | * |
| 16 | * @see Scan::start For details on $options. |
| 17 | */ |
| 18 | |
| 19 | // By default symlink option is unchecked |
| 20 | $uploadsSymlinked = false; |
| 21 | |
| 22 | if ($isPro && !empty($options->current)) { |
| 23 | $uploadsSymlinked = isset($options->existingClones[$options->current]['uploadsSymlinked']) && $options->existingClones[$options->current]['uploadsSymlinked']; |
| 24 | } |
| 25 | |
| 26 | $disableUploadsSymlink = false; |
| 27 | if (Info::canUse('symlink') === false || !$isPro) { |
| 28 | $disableUploadsSymlink = true; |
| 29 | } |
| 30 | ?> |
| 31 | |
| 32 | <div class="wpstg--advanced-settings--checkbox"> |
| 33 | <label for="wpstg_symlink_upload"><?php esc_html_e('Symlink Uploads Folder', 'wp-staging'); ?></label> |
| 34 | <?php Checkbox::render('wpstg_symlink_upload', 'wpstg_symlink_upload', 'true', $uploadsSymlinked, ['isDisabled' => $disableUploadsSymlink]); ?> |
| 35 | <span class="wpstg--tooltip wpstg-tooltip-icon"> |
| 36 | <img class="wpstg--dashicons" src="<?php echo esc_url($scan->getInfoIcon()); ?>" alt="info"/> |
| 37 | <span class="wpstg--tooltiptext"> |
| 38 | <?php if ($disableUploadsSymlink && $isPro) : ?> |
| 39 | <span class="wpstg--red"> |
| 40 | <?php echo sprintf(esc_html__('Symlink Uploads Folder is disabled by default because %s is either unavailable(does\'nt exists) or restricted by your hosting provider.', 'wp-staging'), '<code>symlink</code>'); ?> |
| 41 | </span> |
| 42 | <br/> |
| 43 | <br/> |
| 44 | <?php else : ?> |
| 45 | <?php echo sprintf(esc_html__('Activate to symlink the folder %s%s%s to the production site. %s All files including images on the production site\'s uploads folder will be linked to the staging site uploads folder. This will speed up the cloning and pushing process tremendously as no files from the uploads folder are copied between both sites. %s Warning: this can lead to mixed and shared content issues if both sites load (custom) stylesheet files from the same uploads folder. %s Using this option means changing images on the staging site will change images on the production site as well. Use this with care! %s', 'wp-staging'), '<code>', esc_html($wpDefaultDirectories->getRelativeUploadPath()), '</code>', '<br><br>', '<br><br><span class="wpstg--red">', '<br><br>', '</span>'); ?> |
| 46 | <br/> |
| 47 | <br/> |
| 48 | <span class="wpstg--red"><?php esc_html_e('This feature only works if the staging site is on the same domain as the production site.', 'wp-staging'); ?></span> |
| 49 | <?php endif; ?> |
| 50 | </span> |
| 51 | </span> |
| 52 | </div> |
| 53 |