Rename plugin to wp-seoprostack-plugin, update file structure
This commit is contained in:
159
admin/settings/tabs/class-seoprostack-tab-advanced.php
Normal file
159
admin/settings/tabs/class-seoprostack-tab-advanced.php
Normal file
@ -0,0 +1,159 @@
|
||||
<?php
|
||||
/**
|
||||
* The Advanced tab for plugin settings.
|
||||
*
|
||||
* @package SEO_Pro_Stack
|
||||
* @subpackage SEO_Pro_Stack/Admin/Settings/Tabs
|
||||
*/
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Advanced tab for plugin settings.
|
||||
*/
|
||||
class SEOProStack_Tab_Advanced {
|
||||
|
||||
/**
|
||||
* Render the tab content.
|
||||
*/
|
||||
public function render() {
|
||||
// Get current settings
|
||||
$settings = get_option('seoprostack_advanced_settings', array(
|
||||
'disable_emojis' => 'yes',
|
||||
'disable_embeds' => 'yes',
|
||||
'remove_query_strings' => 'no',
|
||||
'disable_xmlrpc' => 'yes',
|
||||
'remove_shortlink' => 'yes',
|
||||
'remove_rsd_link' => 'yes',
|
||||
'remove_wlwmanifest_link' => 'yes',
|
||||
'disable_self_pingbacks' => 'yes',
|
||||
'disable_feed_links' => 'no',
|
||||
'remove_rest_api_links' => 'no',
|
||||
'minify_html' => 'no',
|
||||
'minify_css' => 'no',
|
||||
'minify_js' => 'no'
|
||||
));
|
||||
?>
|
||||
<div class="seoprostack-settings-content tab-content" id="advanced">
|
||||
<div class="seoprostack-setting-section">
|
||||
<h2><?php esc_html_e('Advanced Settings', 'seoprostack'); ?></h2>
|
||||
<p class="description"><?php esc_html_e('These settings help optimize your WordPress site for better performance. Use with caution and test thoroughly after making changes.', 'seoprostack'); ?></p>
|
||||
|
||||
<div id="advanced-settings-response"></div>
|
||||
|
||||
<form id="seoprostack-advanced-settings-form">
|
||||
<div class="seoprostack-toggle">
|
||||
<div class="seoprostack-toggle-header">
|
||||
<div class="seoprostack-toggle-main">
|
||||
<div class="seoprostack-toggle-left">
|
||||
<h3><?php esc_html_e('WordPress Cleanup', 'seoprostack'); ?></h3>
|
||||
<p><?php esc_html_e('Remove unnecessary code from WordPress header', 'seoprostack'); ?></p>
|
||||
</div>
|
||||
<div class="seoprostack-toggle-right">
|
||||
<label class="wp-toggle-switch">
|
||||
<input type="checkbox" class="seoprostack-toggle-switch" <?php checked(true, true); ?>>
|
||||
<span class="toggle-label"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="seoprostack-toggle-settings" style="display: block;">
|
||||
<div class="seoprostack-setting-row">
|
||||
<label class="seoprostack-checkbox-label">
|
||||
<input type="checkbox" name="disable_emojis" value="yes" <?php checked('yes', $settings['disable_emojis']); ?>>
|
||||
<?php esc_html_e('Disable WordPress Emojis', 'seoprostack'); ?>
|
||||
</label>
|
||||
<p class="description"><?php esc_html_e('Removes the WordPress emoji script and related code from loading on your site.', 'seoprostack'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="seoprostack-setting-row">
|
||||
<label class="seoprostack-checkbox-label">
|
||||
<input type="checkbox" name="disable_embeds" value="yes" <?php checked('yes', $settings['disable_embeds']); ?>>
|
||||
<?php esc_html_e('Disable WordPress Embeds', 'seoprostack'); ?>
|
||||
</label>
|
||||
<p class="description"><?php esc_html_e('Disables the WordPress embed functionality, removing the related JavaScript file.', 'seoprostack'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="seoprostack-setting-row">
|
||||
<label class="seoprostack-checkbox-label">
|
||||
<input type="checkbox" name="remove_query_strings" value="yes" <?php checked('yes', $settings['remove_query_strings']); ?>>
|
||||
<?php esc_html_e('Remove Query Strings from Static Resources', 'seoprostack'); ?>
|
||||
</label>
|
||||
<p class="description"><?php esc_html_e('Removes query strings from static resources like CSS and JavaScript files, improving caching.', 'seoprostack'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="seoprostack-setting-row">
|
||||
<label class="seoprostack-checkbox-label">
|
||||
<input type="checkbox" name="disable_xmlrpc" value="yes" <?php checked('yes', $settings['disable_xmlrpc']); ?>>
|
||||
<?php esc_html_e('Disable XML-RPC', 'seoprostack'); ?>
|
||||
</label>
|
||||
<p class="description"><?php esc_html_e('Disables the XML-RPC API, which could be a security vulnerability if not used.', 'seoprostack'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="seoprostack-setting-row">
|
||||
<label class="seoprostack-checkbox-label">
|
||||
<input type="checkbox" name="remove_shortlink" value="yes" <?php checked('yes', $settings['remove_shortlink']); ?>>
|
||||
<?php esc_html_e('Remove Shortlink', 'seoprostack'); ?>
|
||||
</label>
|
||||
<p class="description"><?php esc_html_e('Removes the shortlink tag from the header.', 'seoprostack'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="seoprostack-toggle">
|
||||
<div class="seoprostack-toggle-header">
|
||||
<div class="seoprostack-toggle-main">
|
||||
<div class="seoprostack-toggle-left">
|
||||
<h3><?php esc_html_e('Performance Optimization', 'seoprostack'); ?></h3>
|
||||
<p><?php esc_html_e('Enable additional performance optimizations', 'seoprostack'); ?></p>
|
||||
</div>
|
||||
<div class="seoprostack-toggle-right">
|
||||
<label class="wp-toggle-switch">
|
||||
<input type="checkbox" class="seoprostack-toggle-switch" <?php checked(true, true); ?>>
|
||||
<span class="toggle-label"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="seoprostack-toggle-settings" style="display: block;">
|
||||
<div class="seoprostack-setting-row">
|
||||
<label class="seoprostack-checkbox-label">
|
||||
<input type="checkbox" name="minify_html" value="yes" <?php checked('yes', $settings['minify_html']); ?>>
|
||||
<?php esc_html_e('Minify HTML', 'seoprostack'); ?>
|
||||
</label>
|
||||
<p class="description"><?php esc_html_e('Removes unnecessary whitespace from HTML to reduce file size.', 'seoprostack'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="seoprostack-setting-row">
|
||||
<label class="seoprostack-checkbox-label">
|
||||
<input type="checkbox" name="minify_css" value="yes" <?php checked('yes', $settings['minify_css']); ?>>
|
||||
<?php esc_html_e('Minify CSS', 'seoprostack'); ?>
|
||||
</label>
|
||||
<p class="description"><?php esc_html_e('Combines and minifies CSS files to reduce HTTP requests and file size.', 'seoprostack'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="seoprostack-setting-row">
|
||||
<label class="seoprostack-checkbox-label">
|
||||
<input type="checkbox" name="minify_js" value="yes" <?php checked('yes', $settings['minify_js']); ?>>
|
||||
<?php esc_html_e('Minify JavaScript', 'seoprostack'); ?>
|
||||
</label>
|
||||
<p class="description"><?php esc_html_e('Combines and minifies JavaScript files to reduce HTTP requests and file size.', 'seoprostack'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="seoprostack-setting-actions">
|
||||
<button type="submit" class="button button-primary" id="seoprostack-save-advanced-settings">
|
||||
<?php esc_html_e('Save Advanced Settings', 'seoprostack'); ?>
|
||||
</button>
|
||||
<span class="spinner"></span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user