Edit File by line
/home/barbar84/www/wp-conte.../plugins/wp-smush.../app/views/settings
File: meta-box.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Settings meta box.
[2] Fix | Delete
*
[3] Fix | Delete
* @since 3.0
[4] Fix | Delete
* @package WP_Smush
[5] Fix | Delete
*
[6] Fix | Delete
* @var string $site_language Site language.
[7] Fix | Delete
* @var string $translation_link Link to plugin translation page.
[8] Fix | Delete
* @var array $settings Settings values.
[9] Fix | Delete
* @var array $settings_data Settings labels and descriptions.
[10] Fix | Delete
* @var array $settings_group Settings group.
[11] Fix | Delete
* @var mixed $networkwide Network wide settings.
[12] Fix | Delete
*/
[13] Fix | Delete
[14] Fix | Delete
if ( ! defined( 'WPINC' ) ) {
[15] Fix | Delete
die;
[16] Fix | Delete
}
[17] Fix | Delete
[18] Fix | Delete
?>
[19] Fix | Delete
[20] Fix | Delete
<div class="sui-box-settings-row" xmlns="http://www.w3.org/1999/html">
[21] Fix | Delete
<div class="sui-box-settings-col-1">
[22] Fix | Delete
<span class="sui-settings-label "><?php esc_html_e( 'Translations', 'wp-smushit' ); ?></span>
[23] Fix | Delete
<span class="sui-description">
[24] Fix | Delete
<?php
[25] Fix | Delete
printf(
[26] Fix | Delete
/* translators: %1$s: opening a tag, %2$s: closing a tag */
[27] Fix | Delete
esc_html__( 'By default, Smush will use the language you’d set in your %1$sWordPress Admin Settings%2$s if a matching translation is available.', 'wp-smushit' ),
[28] Fix | Delete
'<a href="' . esc_html( admin_url( 'options-general.php' ) ) . '">',
[29] Fix | Delete
'</a>'
[30] Fix | Delete
);
[31] Fix | Delete
?>
[32] Fix | Delete
</span>
[33] Fix | Delete
</div>
[34] Fix | Delete
<div class="sui-box-settings-col-2">
[35] Fix | Delete
<div class="sui-form-field">
[36] Fix | Delete
<label for="language-input" class="sui-label">
[37] Fix | Delete
<?php esc_html_e( 'Active Translation', 'wp-smushit' ); ?>
[38] Fix | Delete
</label>
[39] Fix | Delete
<input type="text" id="language-input" class="sui-form-control" disabled="disabled" placeholder="<?php echo esc_attr( $site_language ); ?>">
[40] Fix | Delete
<span class="sui-description">
[41] Fix | Delete
<?php
[42] Fix | Delete
printf(
[43] Fix | Delete
/* translators: %1$s: opening a tag, %2$s: closing a tag */
[44] Fix | Delete
esc_html__( 'Not using your language, or have improvements? Help us improve translations by providing your own improvements %1$shere%2$s.', 'wp-smushit' ),
[45] Fix | Delete
'<a href="' . esc_html( $translation_link ) . '" target="_blank">',
[46] Fix | Delete
'</a>'
[47] Fix | Delete
);
[48] Fix | Delete
?>
[49] Fix | Delete
</span>
[50] Fix | Delete
</div>
[51] Fix | Delete
</div>
[52] Fix | Delete
</div>
[53] Fix | Delete
[54] Fix | Delete
<form id="wp-smush-settings-form" method="post">
[55] Fix | Delete
<input type="hidden" name="setting_form" id="setting_form" value="settings">
[56] Fix | Delete
<?php if ( is_multisite() && is_network_admin() ) : ?>
[57] Fix | Delete
<input type="hidden" name="setting-type" value="network">
[58] Fix | Delete
<?php endif; ?>
[59] Fix | Delete
[60] Fix | Delete
<?php
[61] Fix | Delete
wp_nonce_field( 'save_wp_smush_options', 'wp_smush_options_nonce', '', true );
[62] Fix | Delete
foreach ( $settings_data as $name => $values ) {
[63] Fix | Delete
if ( ! in_array( $name, $settings_group, true ) ) {
[64] Fix | Delete
continue;
[65] Fix | Delete
}
[66] Fix | Delete
[67] Fix | Delete
$label = ! empty( $settings_data[ $name ]['short_label'] ) ? $settings_data[ $name ]['short_label'] : $settings_data[ $name ]['label'];
[68] Fix | Delete
[69] Fix | Delete
// Show settings option.
[70] Fix | Delete
$this->settings_row( WP_SMUSH_PREFIX . $name, $label, $name, $settings[ $name ] );
[71] Fix | Delete
}
[72] Fix | Delete
?>
[73] Fix | Delete
[74] Fix | Delete
<?php if ( is_multisite() && is_network_admin() ) : ?>
[75] Fix | Delete
<div class="sui-box-settings-row">
[76] Fix | Delete
<div class="sui-box-settings-col-1">
[77] Fix | Delete
<span class="sui-settings-label"><?php echo esc_html( $settings_data['networkwide']['short_label'] ); ?></span>
[78] Fix | Delete
<span class="sui-description"><?php echo esc_html( $settings_data['networkwide']['desc'] ); ?></span>
[79] Fix | Delete
</div>
[80] Fix | Delete
[81] Fix | Delete
<div class="sui-box-settings-col-2">
[82] Fix | Delete
<div class="sui-side-tabs sui-tabs">
[83] Fix | Delete
<div data-tabs>
[84] Fix | Delete
<?php $selected = is_array( $networkwide ) ? 'custom' : $networkwide; ?>
[85] Fix | Delete
<label for="access-none" class="sui-tab-item <?php echo ! $networkwide ? 'active' : ''; ?>">
[86] Fix | Delete
<input type="radio" name="<?php echo esc_attr( WP_SMUSH_PREFIX ); ?>subsite-access" value="0" id="access-none" <?php checked( $selected, false ); ?>>
[87] Fix | Delete
<?php esc_html_e( 'None', 'wp-smushit' ); ?>
[88] Fix | Delete
</label>
[89] Fix | Delete
<label for="access-all" class="sui-tab-item <?php echo '1' === $networkwide ? 'active' : ''; ?>">
[90] Fix | Delete
<input type="radio" name="<?php echo esc_attr( WP_SMUSH_PREFIX ); ?>subsite-access" value="1" id="access-all" <?php checked( $selected, '1' ); ?>>
[91] Fix | Delete
<?php esc_html_e( 'All', 'wp-smushit' ); ?>
[92] Fix | Delete
</label>
[93] Fix | Delete
<label for="access-custom" class="sui-tab-item <?php echo is_array( $networkwide ) ? 'active' : ''; ?>">
[94] Fix | Delete
<input type="radio" name="<?php echo esc_attr( WP_SMUSH_PREFIX ); ?>subsite-access" value="custom" id="access-custom" <?php checked( $selected, 'custom' ); ?>>
[95] Fix | Delete
<?php esc_html_e( 'Custom', 'wp-smushit' ); ?>
[96] Fix | Delete
</label>
[97] Fix | Delete
</div>
[98] Fix | Delete
[99] Fix | Delete
<div data-panes>
[100] Fix | Delete
<div class="sui-notice sui-notice-info <?php echo ! $networkwide ? 'active' : ''; ?>">
[101] Fix | Delete
<div class="sui-notice-content">
[102] Fix | Delete
<div class="sui-notice-message">
[103] Fix | Delete
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
[104] Fix | Delete
<p><?php esc_html_e( "Subsite admins can't override any module settings and will always inherit your network settings.", 'wp-smushit' ); ?></p>
[105] Fix | Delete
</div>
[106] Fix | Delete
</div>
[107] Fix | Delete
</div>
[108] Fix | Delete
<div class="sui-notice sui-notice-info <?php echo '1' === $networkwide ? 'active' : ''; ?>">
[109] Fix | Delete
<div class="sui-notice-content">
[110] Fix | Delete
<div class="sui-notice-message">
[111] Fix | Delete
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
[112] Fix | Delete
<p><?php esc_html_e( 'Subsite admins can override all module settings.', 'wp-smushit' ); ?></p>
[113] Fix | Delete
</div>
[114] Fix | Delete
</div>
[115] Fix | Delete
</div>
[116] Fix | Delete
<div class="sui-tab-boxed <?php echo is_array( $networkwide ) ? 'active' : ''; ?>">
[117] Fix | Delete
<p class="sui-description">
[118] Fix | Delete
<?php esc_html_e( 'Choose which modules settings subsite admins have access to.', 'wp-smushit' ); ?>
[119] Fix | Delete
</p>
[120] Fix | Delete
[121] Fix | Delete
<label class="sui-checkbox sui-checkbox-stacked sui-checkbox-sm">
[122] Fix | Delete
<input type="checkbox" id="module-bulk" name="<?php echo esc_attr( WP_SMUSH_PREFIX ); ?>access[]" value="bulk" <?php checked( ! is_array( $networkwide ) || in_array( 'bulk', $networkwide, true ) ); ?>>
[123] Fix | Delete
<span aria-hidden="true">&nbsp;</span>
[124] Fix | Delete
<span><?php esc_html_e( 'Bulk Smush', 'wp-smushit' ); ?></span>
[125] Fix | Delete
</label>
[126] Fix | Delete
<label class="sui-checkbox sui-checkbox-stacked sui-checkbox-sm">
[127] Fix | Delete
<input type="checkbox" id="module-integrations" name="<?php echo esc_attr( WP_SMUSH_PREFIX ); ?>access[]" value="integrations" <?php checked( ! is_array( $networkwide ) || in_array( 'integrations', $networkwide, true ) ); ?>>
[128] Fix | Delete
<span aria-hidden="true">&nbsp;</span>
[129] Fix | Delete
<span><?php esc_html_e( 'Integrations', 'wp-smushit' ); ?></span>
[130] Fix | Delete
</label>
[131] Fix | Delete
<label class="sui-checkbox sui-checkbox-stacked sui-checkbox-sm">
[132] Fix | Delete
<input type="checkbox" id="module-lazy_load" name="<?php echo esc_attr( WP_SMUSH_PREFIX ); ?>access[]" value="lazy_load" <?php checked( ! is_array( $networkwide ) || in_array( 'lazy_load', $networkwide, true ) ); ?>>
[133] Fix | Delete
<span aria-hidden="true">&nbsp;</span>
[134] Fix | Delete
<span><?php esc_html_e( 'Lazy Load', 'wp-smushit' ); ?></span>
[135] Fix | Delete
</label>
[136] Fix | Delete
<label class="sui-checkbox sui-checkbox-stacked sui-checkbox-sm">
[137] Fix | Delete
<input type="checkbox" id="module-cdn" name="<?php echo esc_attr( WP_SMUSH_PREFIX ); ?>access[]" value="cdn" <?php checked( ! is_array( $networkwide ) || in_array( 'cdn', $networkwide, true ) ); ?>>
[138] Fix | Delete
<span aria-hidden="true">&nbsp;</span>
[139] Fix | Delete
<span><?php esc_html_e( 'CDN', 'wp-smushit' ); ?></span>
[140] Fix | Delete
</label>
[141] Fix | Delete
<label class="sui-checkbox sui-checkbox-stacked sui-checkbox-sm">
[142] Fix | Delete
<input type="checkbox" id="module-tools" name="<?php echo esc_attr( WP_SMUSH_PREFIX ); ?>access[]" value="tools" <?php checked( ! is_array( $networkwide ) || in_array( 'tools', $networkwide, true ) ); ?>>
[143] Fix | Delete
<span aria-hidden="true">&nbsp;</span>
[144] Fix | Delete
<span><?php esc_html_e( 'Tools', 'wp-smushit' ); ?></span>
[145] Fix | Delete
</label>
[146] Fix | Delete
<?php // Don't display if Dashboard's whitelabel is hiding documentation. ?>
[147] Fix | Delete
<?php if ( ! apply_filters( 'wpmudev_branding_hide_doc_link', false ) ) : ?>
[148] Fix | Delete
<label class="sui-checkbox sui-checkbox-stacked sui-checkbox-sm">
[149] Fix | Delete
<input type="checkbox" id="module-tutorials" name="<?php echo esc_attr( WP_SMUSH_PREFIX ); ?>access[]" value="tutorials" <?php checked( ! is_array( $networkwide ) || in_array( 'tutorials', $networkwide, true ) ); ?>>
[150] Fix | Delete
<span aria-hidden="true">&nbsp;</span>
[151] Fix | Delete
<span><?php esc_html_e( 'Tutorials', 'wp-smushit' ); ?></span>
[152] Fix | Delete
</label>
[153] Fix | Delete
<?php endif; ?>
[154] Fix | Delete
</div>
[155] Fix | Delete
</div>
[156] Fix | Delete
</div>
[157] Fix | Delete
</div>
[158] Fix | Delete
</div>
[159] Fix | Delete
<?php endif; ?>
[160] Fix | Delete
[161] Fix | Delete
<div class="sui-box-settings-row smush-keep-data-form-row">
[162] Fix | Delete
<div class="sui-box-settings-col-1">
[163] Fix | Delete
<span class="sui-settings-label"><?php echo esc_html( $settings_data['keep_data']['short_label'] ); ?></span>
[164] Fix | Delete
<span class="sui-description"><?php echo esc_html( $settings_data['keep_data']['desc'] ); ?></span>
[165] Fix | Delete
</div>
[166] Fix | Delete
[167] Fix | Delete
<div class="sui-box-settings-col-2">
[168] Fix | Delete
<?php if ( $this->should_render( 'tools' ) ) : ?>
[169] Fix | Delete
<strong><?php esc_html_e( 'Restore Images', 'wp-smushit' ); ?></strong>
[170] Fix | Delete
<span class="sui-description">
[171] Fix | Delete
<?php esc_html_e( 'Made a mistake? No worries. We have a built-in bulk restore tool that will restore your image thumbnails to their original state.', 'wp-smushit' ); ?>
[172] Fix | Delete
</span>
[173] Fix | Delete
<span class="sui-description sui-margin-bottom">
[174] Fix | Delete
<?php
[175] Fix | Delete
printf(
[176] Fix | Delete
/* translators: %1$s - <a> link, %2$s - </a> */
[177] Fix | Delete
esc_html__( 'Navigate to %1$sTools%2$s to begin the process.', 'wp-smushit' ),
[178] Fix | Delete
'<a href="' . esc_url( $this->get_page_url() ) . '&view=tools">',
[179] Fix | Delete
'</a>'
[180] Fix | Delete
);
[181] Fix | Delete
?>
[182] Fix | Delete
</span>
[183] Fix | Delete
<?php endif; ?>
[184] Fix | Delete
[185] Fix | Delete
<strong><?php echo esc_html( $settings_data['keep_data']['label'] ); ?></strong>
[186] Fix | Delete
<span class="sui-description">
[187] Fix | Delete
<?php esc_html_e( 'When you uninstall the plugin, what do you want to do with your settings? You can save them for next time, or wipe them back to factory settings.', 'wp-smushit' ); ?>
[188] Fix | Delete
</span>
[189] Fix | Delete
[190] Fix | Delete
<div class="sui-side-tabs">
[191] Fix | Delete
<div class="sui-tabs-menu">
[192] Fix | Delete
<label for="keep_data-true" class="sui-tab-item <?php echo $settings['keep_data'] ? 'active' : ''; ?>">
[193] Fix | Delete
<input type="radio" name="<?php echo esc_attr( WP_SMUSH_PREFIX ); ?>keep_data" value="1" id="keep_data-true" <?php checked( $settings['keep_data'] ); ?>>
[194] Fix | Delete
<?php esc_html_e( 'Keep', 'wp-smushit' ); ?>
[195] Fix | Delete
</label>
[196] Fix | Delete
[197] Fix | Delete
<label for="keep_data-false" class="sui-tab-item <?php echo $settings['keep_data'] ? '' : 'active'; ?>">
[198] Fix | Delete
<input type="radio" name="<?php echo esc_attr( WP_SMUSH_PREFIX ); ?>keep_data" value="0" id="keep_data-false" <?php checked( ! $settings['keep_data'] ); ?>>
[199] Fix | Delete
<?php esc_html_e( 'Delete', 'wp-smushit' ); ?>
[200] Fix | Delete
</label>
[201] Fix | Delete
</div>
[202] Fix | Delete
</div>
[203] Fix | Delete
[204] Fix | Delete
<strong><?php esc_html_e( 'Reset Factory Settings', 'wp-smushit' ); ?></strong>
[205] Fix | Delete
<span class="sui-description">
[206] Fix | Delete
<?php esc_html_e( 'Need to revert back to the default settings? This button will instantly reset your settings to the defaults.', 'wp-smushit' ); ?>
[207] Fix | Delete
</span>
[208] Fix | Delete
[209] Fix | Delete
<button class="sui-button sui-button-ghost" data-modal-open="wp-smush-reset-settings-dialog" data-modal-open-focus="reset-setting-confirm" data-modal-mask="true">
[210] Fix | Delete
<i class="sui-icon-undo" aria-hidden="true"></i>
[211] Fix | Delete
<?php esc_html_e( 'Reset Settings', 'wp-smushit' ); ?>
[212] Fix | Delete
</button>
[213] Fix | Delete
</div>
[214] Fix | Delete
</div>
[215] Fix | Delete
[216] Fix | Delete
<div class="sui-box-settings-row">
[217] Fix | Delete
<div class="sui-box-settings-col-1">
[218] Fix | Delete
<span class="sui-settings-label"><?php echo esc_html( $settings_data['api_auth']['short_label'] ); ?></span>
[219] Fix | Delete
<span class="sui-description"><?php echo esc_html( $settings_data['api_auth']['desc'] ); ?></span>
[220] Fix | Delete
</div>
[221] Fix | Delete
[222] Fix | Delete
<div class="sui-box-settings-col-2">
[223] Fix | Delete
<button type="button" class="sui-button sui-button-ghost" id="wp-smush-update-api-status">
[224] Fix | Delete
<span class="sui-loading-text">
[225] Fix | Delete
<i class="sui-icon-undo" aria-hidden="true"></i>
[226] Fix | Delete
<?php esc_html_e( 'Update API status', 'wp-smushit' ); ?>
[227] Fix | Delete
</span>
[228] Fix | Delete
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
[229] Fix | Delete
</button>
[230] Fix | Delete
</div>
[231] Fix | Delete
</div>
[232] Fix | Delete
[233] Fix | Delete
</form>
[234] Fix | Delete
[235] Fix | Delete
<?php $this->view( 'reset-settings', array(), 'modals' ); ?>
[236] Fix | Delete
[237] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function