Changeset 2597187
- Timestamp:
- 09/11/2021 07:50:52 AM (5 years ago)
- Location:
- webp-converter
- Files:
-
- 37 added
- 8 edited
-
assets/screenshot-2.png (modified) (previous)
-
assets/screenshot-3.png (modified) (previous)
-
tags/1.0.1 (added)
-
tags/1.0.1/config (added)
-
tags/1.0.1/config/config.php (added)
-
tags/1.0.1/css (added)
-
tags/1.0.1/css/jquery-ui.css (added)
-
tags/1.0.1/css/webp-admin.css (added)
-
tags/1.0.1/functions.php (added)
-
tags/1.0.1/images (added)
-
tags/1.0.1/images/done.png (added)
-
tags/1.0.1/images/error.png (added)
-
tags/1.0.1/images/loading.gif (added)
-
tags/1.0.1/images/rss.png (added)
-
tags/1.0.1/images/wait.png (added)
-
tags/1.0.1/includes (added)
-
tags/1.0.1/includes/class-activate.php (added)
-
tags/1.0.1/includes/class-htserve.php (added)
-
tags/1.0.1/includes/class-scripts.php (added)
-
tags/1.0.1/includes/class-settings.php (added)
-
tags/1.0.1/index.php (added)
-
tags/1.0.1/js (added)
-
tags/1.0.1/js/ap-tabs.js (added)
-
tags/1.0.1/js/ap.cookie.js (added)
-
tags/1.0.1/js/webp.js (added)
-
tags/1.0.1/languages (added)
-
tags/1.0.1/languages/webp-converter.pot (added)
-
tags/1.0.1/readme.txt (added)
-
tags/1.0.1/view (added)
-
tags/1.0.1/view/admin (added)
-
tags/1.0.1/view/admin/converter-data.php (added)
-
tags/1.0.1/view/admin/help.php (added)
-
tags/1.0.1/view/admin/image-item.php (added)
-
tags/1.0.1/view/admin/image-sub-item.php (added)
-
tags/1.0.1/view/admin/pro-add.php (added)
-
tags/1.0.1/view/admin/settings.php (added)
-
tags/1.0.1/webp-converter.php (added)
-
trunk/css/webp-admin.css (modified) (2 diffs)
-
trunk/includes/class-activate.php (added)
-
trunk/includes/class-htserve.php (added)
-
trunk/includes/class-settings.php (modified) (5 diffs)
-
trunk/languages/webp-converter.pot (modified) (8 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/view/admin/settings.php (modified) (3 diffs)
-
trunk/webp-converter.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
webp-converter/trunk/css/webp-admin.css
r2593052 r2597187 72 72 } 73 73 .webp-top { 74 margin-bottom: 20px; 74 margin: 10px 0px 20px 0px; 75 text-align: center; 75 76 } 76 77 .sub-images { … … 133 134 padding: 10px !important; 134 135 } 136 .ui-tooltip { 137 opacity: 1; 138 filter: alpha(opacity=100); 139 } 140 .user-hta { 141 border: 4px dashed #ccc; 142 border-radius: 5px; 143 padding: 10px; 144 margin: 10px 0px; 145 box-sizing: border-box; 146 } -
webp-converter/trunk/includes/class-settings.php
r2593052 r2597187 1 1 <?php 2 2 namespace WEBP\Settings; 3 use WEBP\Htserve as Htserve; 3 4 4 5 class APWEBP_Converter_Settings { … … 31 32 } 32 33 33 $GLOBALS['msg'] = __('Plugin data successfully updated.', 'webp-converter') . '<br>'; 34 if (isset($_REQUEST['apwebp_image_quality'])) { 35 update_option('apwebp_image_quality', sanitize_text_field($_REQUEST['apwebp_image_quality'])); 36 } else { 37 delete_option('apwebp_image_quality'); 38 } 39 40 do_action('apwebp_save_settings'); 41 42 $GLOBALS['msg'] = apply_filters('webp_msg_filter', __('Plugin data successfully updated.', 'webp-converter') . '<br>'); 34 43 } 35 44 } … … 80 89 81 90 public function settings() { 91 $hts = new Htserve\APWEBP_Htserve; 82 92 include APWEBP_DIRECTORY_PATH . '/view/admin/settings.php'; 83 93 } … … 128 138 $post = [ 129 139 'url' => $file_full_url, 140 'quality' => get_option('apwebp_image_quality'), 130 141 ]; 131 142 … … 140 151 $post = [ 141 152 'url' => $file_full_url, 153 'quality' => get_option('apwebp_image_quality'), 142 154 ]; 143 155 $response = $this->call_web_service($url, $post, $headers); -
webp-converter/trunk/languages/webp-converter.pot
r2593052 r2597187 4 4 "Project-Id-Version: Webp Converter\n" 5 5 "Report-Msgid-Bugs-To: \n" 6 "POT-Creation-Date: 2021-0 8-30 06:05+0000\n"6 "POT-Creation-Date: 2021-09-10 12:48+0000\n" 7 7 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 8 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 14 14 "Content-Transfer-Encoding: 8bit\n" 15 15 "X-Generator: Loco https://localise.biz/\n" 16 "X-Loco-Version: 2.3.3; wp-5. 5.5"16 "X-Loco-Version: 2.3.3; wp-5.8.1" 17 17 18 18 #. URI of the plugin … … 20 20 msgstr "" 21 21 22 #: includes/class-settings.php:182 includes/class-settings.php:185 23 msgid "API calls left" 22 #: includes/class-htserve.php:199 23 msgid ".htaccess files are created successfully." 24 msgstr "" 25 26 #: view/admin/settings.php:90 27 msgid ".htaccess on /uploads/ dir" 28 msgstr "" 29 30 #: view/admin/settings.php:75 31 msgid ".htaccess on /wp-content/ dir" 32 msgstr "" 33 34 #: includes/class-htserve.php:195 35 msgid "" 36 "/uploads/ dir not writable. Please check if the dir has correct permissions." 37 msgstr "" 38 39 #: includes/class-htserve.php:191 40 msgid "" 41 "/wp-content/ dir not writable. Please check if the dir has correct " 42 "permissions." 24 43 msgstr "" 25 44 … … 32 51 msgstr "" 33 52 34 #: includes/class-settings.php:18635 msgid "day(s)"36 msgstr ""37 38 53 #: view/admin/settings.php:36 39 54 msgid "Don't convert different image sizes" … … 42 57 #: view/admin/settings.php:26 43 58 msgid "Enable" 59 msgstr "" 60 61 #: view/admin/settings.php:66 62 msgid "" 63 "Enable this so that images can be served in webp format using htaccess. This " 64 "is useful to serve images which are embedded in the page / post content with " 65 "full url." 44 66 msgstr "" 45 67 … … 68 90 msgstr "" 69 91 70 #: includes/class-settings.php:57 92 #: view/admin/settings.php:43 93 msgid "Image quality" 94 msgstr "" 95 96 #: includes/class-settings.php:66 71 97 msgid "Images per page" 72 98 msgstr "" 73 99 74 #: view/admin/converter-data.php:44 100 #: includes/class-htserve.php:203 101 msgid "Images will not be served as webp by .htaccess" 102 msgstr "" 103 104 #: view/admin/converter-data.php:45 75 105 msgid "items" 76 106 msgstr "" 77 107 78 #: view/admin/settings.php: 51108 #: view/admin/settings.php:112 79 109 msgid "Plugin API Status" 80 110 msgstr "" 81 111 82 #: includes/class-settings.php: 33112 #: includes/class-settings.php:42 83 113 msgid "Plugin data successfully updated." 84 114 msgstr "" 85 115 86 #: includes/class-settings.php:186 87 msgid "Renew in" 88 msgstr "" 89 90 #: view/admin/settings.php:44 116 #: view/admin/settings.php:105 91 117 msgid "Save" 92 118 msgstr "" 93 119 94 #: view/admin/converter-data.php:7 120 #: view/admin/settings.php:91 121 msgid "" 122 "Seems like the /uploads/ dir is not writable. Please create one .htaccess " 123 "file inside your uploads dir." 124 msgstr "" 125 126 #: view/admin/settings.php:76 127 msgid "" 128 "Seems like the /wp-content/ dir is not writable. Please create one .htaccess " 129 "file inside your wp-content dir." 130 msgstr "" 131 132 #: view/admin/converter-data.php:8 95 133 msgid "Select All" 96 134 msgstr "" … … 102 140 msgstr "" 103 141 104 #: view/admin/converter-data.php: 9142 #: view/admin/converter-data.php:10 105 143 msgid "Start WEBP Image Converter" 106 144 msgstr "" … … 110 148 msgstr "" 111 149 112 #: view/admin/converter-data.php: 8150 #: view/admin/converter-data.php:9 113 151 msgid "Unselect All" 152 msgstr "" 153 154 #: view/admin/settings.php:65 155 msgid "Use .htaccess to serve webp images" 114 156 msgstr "" 115 157 -
webp-converter/trunk/readme.txt
r2593052 r2597187 5 5 Requires at least: 2.0.2 6 6 Tested up to: 5.8 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 44 44 == Changelog == 45 45 46 = 1.0.1 = 47 * Now embedded images can be served as webp using .htaccess 48 46 49 = 1.0.0 = 47 50 * this is the first release. -
webp-converter/trunk/view/admin/settings.php
r2593052 r2597187 3 3 <h1 class="wp-heading-inline" style="margin-bottom: 10px;"><?php _e('WEBP Images Settings', 'webp-converter');?></h1> 4 4 5 <?php if (isset($GLOBALS['msg'])) {echo '<div class="updated notice notice-success webp-msg is-dismissible">' . esc_html($GLOBALS['msg']) . '</div>';}?>5 <?php if (isset($GLOBALS['msg'])) {echo '<div class="updated notice notice-success webp-msg is-dismissible">' . html_entity_decode(esc_html($GLOBALS['msg'])) . '</div>';}?> 6 6 7 7 <form name="f" method="post" action=""> … … 34 34 <tr> 35 35 <td valign="top" width="300"><strong><?php _e('Convert only full size images', 'webp-converter');?></strong></td> 36 <td><label><input type="checkbox" name="apwebp_dont_conv_image_sizes" value="yes" <?php echo get_option('apwebp_dont_conv_image_sizes') == 'yes' ? 'checked="checked"' : ''; ?> /> <?php _e('Don\'t convert different image sizes', 'webp-converter');?></label></td>36 <td><label><input type="checkbox" name="apwebp_dont_conv_image_sizes" value="yes" <?php echo get_option('apwebp_dont_conv_image_sizes') == 'yes' ? 'checked="checked"' : ''; ?> /> <?php _e('Don\'t convert different thumbnail image sizes', 'webp-converter');?></label></td> 37 37 </tr> 38 38 <tr> … … 40 40 <td> </td> 41 41 </tr> 42 <tr> 43 <td valign="top" width="300"><strong><?php _e('Image quality', 'webp-converter');?></strong></td> 44 <td> 45 <label><input type="radio" name="apwebp_image_quality" value="50" <?php echo get_option('apwebp_image_quality') == '50' ? 'checked="checked"' : ''; ?> /> 50%</label> 46 47 <label><input type="radio" name="apwebp_image_quality" value="60" <?php echo get_option('apwebp_image_quality') == '60' ? 'checked="checked"' : ''; ?> /> 60%</label> 48 49 <label><input type="radio" name="apwebp_image_quality" value="70" <?php echo get_option('apwebp_image_quality') == '70' ? 'checked="checked"' : ''; ?> /> 70%</label> 50 51 <label><input type="radio" name="apwebp_image_quality" value="80" <?php echo get_option('apwebp_image_quality') == '80' ? 'checked="checked"' : ''; ?> /> 80%</label> 52 53 <label><input type="radio" name="apwebp_image_quality" value="90" <?php echo get_option('apwebp_image_quality') == '90' ? 'checked="checked"' : ''; ?> /> 90%</label> 54 55 <label><input type="radio" name="apwebp_image_quality" value="100" <?php echo get_option('apwebp_image_quality') == '100' ? 'checked="checked"' : ''; ?> /> 100%</label> 56 57 </td> 58 </tr> 59 <tr> 60 <td> </td> 61 <td> </td> 62 </tr> 63 <tr> 64 <tr> 65 <td valign="top" width="300"><strong><?php _e('Use .htaccess to serve webp images', 'webp-converter');?></strong></td> 66 <td><label><input type="checkbox" name="apwebp_use_htaccess" value="yes" <?php echo get_option('apwebp_use_htaccess') == 'yes' ? 'checked="checked"' : ''; ?> /> <?php _e('Enable this so that images can be served in webp format using htaccess. This is useful to serve images which are embedded in the page / post content with full url.', 'webp-converter');?></label></td> 67 </tr> 68 <tr> 69 <td> </td> 70 <td> </td> 71 </tr> 72 73 <?php if (get_option('apwebp_use_htaccess') == 'yes' and $hts->get_wpc_ht_data_to_user() !== false) {?> 74 <tr> 75 <td valign="top"><strong><?php _e('.htaccess on /wp-content/ dir', 'webp-converter');?></strong></td> 76 <td><font color="red"><?php _e('Seems like the /wp-content/ dir is not writable. Please create one .htaccess file inside your wp-content dir.', 'webp-converter');?></font></td> 77 </tr> 78 <tr> 79 <td> </td> 80 <td><div class="user-hta"><?php echo $hts->get_wpc_ht_data_to_user(); ?></div></td> 81 </tr> 82 <tr> 83 <td> </td> 84 <td> </td> 85 </tr> 86 <?php }?> 87 88 <?php if (get_option('apwebp_use_htaccess') == 'yes' and $hts->get_wpu_ht_data_to_user() !== false) {?> 89 <tr> 90 <td valign="top"><strong><?php _e('.htaccess on /uploads/ dir', 'webp-converter');?></strong></td> 91 <td><font color="red"><?php _e('Seems like the /uploads/ dir is not writable. Please create one .htaccess file inside your uploads dir.', 'webp-converter');?></font></td> 92 </tr> 93 <tr> 94 <td> </td> 95 <td><div class="user-hta"><?php echo $hts->get_wpu_ht_data_to_user(); ?></div></td> 96 </tr> 97 <tr> 98 <td> </td> 99 <td> </td> 100 </tr> 101 <?php }?> 102 42 103 <tr> 43 104 <td> </td> -
webp-converter/trunk/webp-converter.php
r2593052 r2597187 4 4 Plugin URI: # 5 5 Description: Speed up your website by serving images in WebP format. This plugin will replace files in standard JPEG, PNG and GIF formats with WebP format. 6 Version: 1.0. 06 Version: 1.0.1 7 7 Text Domain: webp-converter 8 8 Domain Path: /languages … … 19 19 20 20 namespace WEBP\Init; 21 21 use WEBP\Htserve as Htserve; 22 22 use WEBP\Init as Init; 23 23 use WEBP\Scripts as Scripts; … … 34 34 } 35 35 36 include_once APWEBP_DIRECTORY_PATH . '/includes/class-activate.php'; 37 36 38 function plug_install_apwebp_converter() { 37 39 include_once ABSPATH . 'wp-admin/includes/plugin.php'; … … 44 46 include_once APWEBP_DIRECTORY_PATH . '/includes/class-settings.php'; 45 47 include_once APWEBP_DIRECTORY_PATH . '/includes/class-scripts.php'; 48 include_once APWEBP_DIRECTORY_PATH . '/includes/class-htserve.php'; 46 49 include_once APWEBP_DIRECTORY_PATH . '/functions.php'; 47 50 48 51 new Settings\APWEBP_Converter_Settings; 52 new Htserve\APWEBP_Htserve; 49 53 new Scripts\APWEBP_Converter_Scripts; 50 54 } … … 58 62 new Init\APWEBP_Converter_Pre_Checking; 59 63 64 register_activation_hook(__FILE__, array('WEBP\Activate\APWEBP_Activate', 'webp_install')); 65 register_deactivation_hook(__FILE__, array('WEBP\Activate\APWEBP_Activate', 'webp_uninstall')); 66 60 67 add_filter('wp_get_attachment_image_src', 'apwebp_ap_convert_url_for_images', 10, 4); 61 68 add_filter('wp_get_attachment_url', 'apwebp_ap_convert_url_for_attachments');
Note: See TracChangeset
for help on using the changeset viewer.