| 1 |
<?php |
| 2 |
/** |
| 3 |
* Media Optimization Admin Page View - Tab Container |
| 4 |
* |
| 5 |
* @package Search Atlas SEO |
| 6 |
* @copyright Copyright (C) 2021-2025, Search Atlas Group - support@searchatlas.com |
| 7 |
* @since 2.6.0 |
| 8 |
* |
| 9 |
* Variables expected from page callback: |
| 10 |
* @var bool $save_success |
| 11 |
* @var string $current_tab |
| 12 |
* @var Metasync_Media_Library_List_Table|null $list_table |
| 13 |
* @var array|null $stats |
| 14 |
* @var array|null $batch_progress |
| 15 |
*/ |
| 16 |
|
| 17 |
if (!defined('WPINC')) { |
| 18 |
die; |
| 19 |
} |
| 20 |
|
| 21 |
$settings = Metasync_Media_Settings::get_settings(); |
| 22 |
$capabilities = Metasync_Media_Settings::get_server_capabilities(); |
| 23 |
?> |
| 24 |
<div class="metasync-media-optimization-page"> |
| 25 |
|
| 26 |
<?php if (!$capabilities['has_library']): ?> |
| 27 |
<div class="notice notice-error"> |
| 28 |
<p> |
| 29 |
<strong><?php esc_html_e('Warning:', 'metasync'); ?></strong> |
| 30 |
<?php esc_html_e('Neither Imagick nor GD PHP extension is available. Image conversion will not work. Please contact your hosting provider to enable one of these extensions.', 'metasync'); ?> |
| 31 |
</p> |
| 32 |
</div> |
| 33 |
<?php endif; ?> |
| 34 |
|
| 35 |
<?php if ($save_success): ?> |
| 36 |
<div class="metasync-notice metasync-notice-success"> |
| 37 |
<span class="dashicons dashicons-yes-alt"></span> |
| 38 |
<?php esc_html_e('Media optimization settings saved successfully.', 'metasync'); ?> |
| 39 |
</div> |
| 40 |
<?php endif; ?> |
| 41 |
|
| 42 |
<!-- Tab Navigation --> |
| 43 |
<div class="metasync-tabs"> |
| 44 |
<ul class="metasync-tab-nav"> |
| 45 |
<li> |
| 46 |
<a href="#" data-tab="settings" class="<?php echo $current_tab === 'settings' ? 'active' : ''; ?>"> |
| 47 |
<span class="dashicons dashicons-admin-generic"></span> |
| 48 |
<?php esc_html_e('Settings', 'metasync'); ?> |
| 49 |
</a> |
| 50 |
</li> |
| 51 |
<li> |
| 52 |
<a href="#" data-tab="image-library" class="<?php echo $current_tab === 'image-library' ? 'active' : ''; ?>"> |
| 53 |
<span class="dashicons dashicons-format-gallery"></span> |
| 54 |
<?php esc_html_e('Image Library', 'metasync'); ?> |
| 55 |
</a> |
| 56 |
</li> |
| 57 |
</ul> |
| 58 |
</div> |
| 59 |
|
| 60 |
<!-- Settings Tab --> |
| 61 |
<div id="settings-content" class="metasync-tab-content <?php echo $current_tab === 'settings' ? 'active' : ''; ?>"> |
| 62 |
<?php require_once __DIR__ . '/settings-tab.php'; ?> |
| 63 |
</div> |
| 64 |
|
| 65 |
<!-- Image Library Tab --> |
| 66 |
<div id="image-library-content" class="metasync-tab-content <?php echo $current_tab === 'image-library' ? 'active' : ''; ?>"> |
| 67 |
<?php |
| 68 |
if ($list_table) { |
| 69 |
require_once __DIR__ . '/image-library-tab.php'; |
| 70 |
} |
| 71 |
?> |
| 72 |
</div> |
| 73 |
|
| 74 |
</div> |
| 75 |
|
| 76 |
<?php |
| 77 |
// CSS and JS are now enqueued via wp_enqueue_script/wp_enqueue_style |
| 78 |
// in media-optimization-loader.php on the admin_enqueue_scripts hook. |
| 79 |
?> |
| 80 |
|