PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / 1.7
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF v1.7
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
imagify / views / page-settings.php

page-settings.php in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF 1.7, at views/page-settings.php

187 lines 7.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
3
4 $settings = Imagify_Settings::get_instance();
5 $options = Imagify_Options::get_instance();
6 $option_name = $options->get_option_name();
7 $hidden_class = imagify_valid_key() ? '' : ' hidden';
8
9 /* Ads notice */
10 $notice = 'wp-rocket';
11 $user_id = get_current_user_id();
12 $notices = get_user_meta( $user_id, '_imagify_ignore_ads', true );
13 $notices = $notices && is_array( $notices ) ? array_flip( $notices ) : array();
14 $wrapper_class = isset( $notices[ $notice ] ) || defined( 'WP_ROCKET_VERSION' ) ? 'imagify-have-rocket' : 'imagify-dont-have-rocket';
15 ?>
16 <div class="wrap imagify-settings <?php echo $wrapper_class; ?> imagify-clearfix">
17
18 <div class="imagify-col imagify-main">
19
20 <?php $this->print_template( 'part-settings-header' ); ?>
21
22 <form action="<?php echo esc_url( $settings->get_form_action() ); ?>" id="imagify-settings" method="post">
23
24 <div class="imagify-settings-main-content<?php echo imagify_valid_key() ? '' : ' imagify-no-api-key'; ?>">
25
26 <?php settings_fields( $settings->get_settings_group() ); ?>
27 <?php wp_nonce_field( 'imagify-signup', 'imagifysignupnonce', false ); ?>
28 <?php wp_nonce_field( 'imagify-check-api-key', 'imagifycheckapikeynonce', false ); ?>
29
30 <?php
31 if ( ! imagify_valid_key() ) {
32 $this->print_template( 'part-settings-account' );
33 $this->print_template( 'part-settings-footer' );
34 }
35 ?>
36
37 <div class="imagify-col imagify-shared-with-account-col<?php echo $hidden_class; ?>">
38 <div class="imagify-settings-section">
39
40 <h2 class="imagify-options-title"><?php _e( 'General Settings', 'imagify' ); ?></h2>
41
42 <p class="imagify-options-subtitle" id="imagify-optimization-level-label">
43 <?php _e( 'Optimization Level', 'imagify' ); ?>
44
45 <span class="imagify-info">
46 <span class="dashicons dashicons-info"></span>
47 <a href="#imagify-more-info" class="imagify-modal-trigger"><?php _e( 'More info?', 'imagify' ); ?></a>
48 </span>
49 </p>
50
51 <div class="imagify-setting-optim-level">
52 <p class="imagify-inline-options">
53 <input type="radio" id="imagify-optimization_level_normal" name="<?php echo $option_name; ?>[optimization_level]" value="0" <?php checked( $options->get( 'optimization_level' ), 0 ); ?> aria-describedby="imagify-optimization-level-label">
54 <label for="imagify-optimization_level_normal">
55 <?php _e( 'Normal', 'imagify' ); ?>
56 </label>
57
58 <input type="radio" id="imagify-optimization_level_aggro" name="<?php echo $option_name; ?>[optimization_level]" value="1" <?php checked( $options->get( 'optimization_level' ), 1 ); ?> aria-describedby="imagify-optimization-level-label">
59 <label for="imagify-optimization_level_aggro">
60 <?php _e( 'Aggressive', 'imagify' ); ?>
61 </label>
62
63 <input type="radio" id="imagify-optimization_level_ultra" name="<?php echo $option_name; ?>[optimization_level]" value="2" <?php checked( $options->get( 'optimization_level' ), 2 ); ?> aria-describedby="imagify-optimization-level-label">
64 <label for="imagify-optimization_level_ultra">
65 <?php _e( 'Ultra', 'imagify' ); ?>
66 </label>
67 </p>
68
69 <p class="imagify-visual-comparison-text">
70 <?php
71 printf(
72 /* translators: 1 is a button tag start, 2 is the button tag end. */
73 __( 'Need help to choose? %1$sTry the Visual Comparison%2$s', 'imagify' ),
74 '<button type="button" class="button button-primary button-mini-flat imagify-visual-comparison-btn imagify-modal-trigger" data-target="#imagify-visual-comparison">',
75 '</button>'
76 );
77 ?>
78 </p>
79 </div>
80
81 <p class="imagify-setting-line">
82 <?php
83 $settings->field_checkbox( array(
84 'option_name' => 'auto_optimize',
85 'label' => __( 'Auto-Optimize images on upload', 'imagify' ),
86 'info' => __( 'Automatically optimize every image you upload to WordPress.', 'imagify' ),
87 ) );
88 ?>
89 </p>
90
91 <p class="imagify-setting-line">
92 <?php
93 $settings->field_checkbox( array(
94 'option_name' => 'backup',
95 'label' => __( 'Backup original images', 'imagify' ),
96 'info' => __( 'Keep your original images in a separate folder before optimization process.', 'imagify' ),
97 ) );
98
99 $backup_error_class = $options->get( 'backup' ) && ! imagify_backup_dir_is_writable() ? '' : ' hidden';
100 ?>
101 <br/><strong id="backup-dir-is-writable" class="imagify-error<?php echo $backup_error_class; ?>" data-nonce="<?php echo esc_attr( wp_create_nonce( 'imagify_check_backup_dir_is_writable' ) ); ?>">
102 <?php
103 $backup_path = imagify_make_file_path_relative( get_imagify_backup_dir_path( true ) );
104 /* translators: %s is a file path. */
105 printf( __( 'The backup folder %s cannot be created or is not writable by the server, original images cannot be saved!', 'imagify' ), "<code>$backup_path</code>" );
106 ?>
107 </strong>
108 </p>
109
110 <p class="imagify-setting-line">
111 <?php
112 $info = __( 'Keep all EXIF data from your images. EXIF are informations stored in your pictures like shutter speed, exposure compensation, ISO, etc...', 'imagify' );
113 $info .= '<a href="' . esc_url( imagify_get_external_url( 'exif' ) ) . '" target="_blank">' . __( 'Learn more', 'imagify' ) . '</a><br/><br/>';
114 $info .= __( 'If you are a photographer, you may be interested in this option if you are displaying on your pages some info like the model of your camera.', 'imagify' );
115
116 $settings->field_checkbox( array(
117 'option_name' => 'exif',
118 'label' => __( 'EXIF Data', 'imagify' ),
119 'info' => $info,
120 ) );
121 ?>
122 </p>
123 </div>
124 </div>
125
126 <?php if ( imagify_valid_key() ) { ?>
127 <div class="imagify-col imagify-account-info-col">
128 <?php $this->print_template( 'part-settings-account' ); ?>
129 </div>
130 <?php } ?>
131 </div>
132
133 <div class="imagify-settings-main-content<?php echo $hidden_class; ?>">
134
135 <div class="imagify-settings-section clear">
136 <h2 class="imagify-options-title"><?php _e( 'Optimization', 'imagify' ); ?></h2>
137 <?php
138 $this->print_template( 'part-settings-library' );
139 $this->print_template( 'part-settings-custom-folders' );
140 ?>
141 </div>
142 </div>
143
144 <div class="imagify-settings-main-content imagify-pb0<?php echo $hidden_class; ?>">
145 <div class="imagify-settings-section clear">
146 <div class="imagify-col">
147 <h2 class="imagify-options-title"><?php _e( 'Display Options', 'imagify' ); ?></h2>
148
149 <p class="imagify-options-subtitle"><?php _e( 'Show Toolbar Menu', 'imagify' ); ?></p>
150
151 <div class="imagify-col">
152 <p>
153 <?php
154 $settings->field_checkbox( array(
155 'option_name' => 'admin_bar_menu',
156 'label' => __( 'I want this awesome quick access menu on my Toolbar.', 'imagify' ),
157 ) );
158 ?>
159 </p>
160 </div>
161 <div class="imagify-col">
162 <p>
163 <img class="imagify-menu-bar-img" src="<?php echo IMAGIFY_ASSETS_IMG_URL . 'imagify-menu-bar.jpg'; ?>" width="300" height="225" alt="">
164 </p>
165 </div>
166 </div>
167 </div>
168
169 <?php
170 if ( imagify_valid_key() ) {
171 $this->print_template( 'part-settings-footer' );
172 }
173 ?>
174 </div>
175 </form>
176 </div>
177
178 <?php
179 $this->print_template( 'part-rocket-ad' );
180 $this->print_template( 'modal-settings-infos' );
181 $this->print_template( 'modal-settings-visual-comparison' );
182 $this->print_template( 'modal-payment' );
183 ?>
184
185 </div>
186 <?php
187