Changeset 3008876 for host-webfonts-local
- Timestamp:
- 12/12/2023 03:14:25 PM (16 months ago)
- Location:
- host-webfonts-local
- Files:
-
- 6 edited
- 1 copied
-
tags/5.7.7 (copied) (copied from host-webfonts-local/trunk)
-
tags/5.7.7/host-webfonts-local.php (modified) (1 diff)
-
tags/5.7.7/readme.txt (modified) (2 diffs)
-
tags/5.7.7/src/Admin/Actions.php (modified) (9 diffs)
-
trunk/host-webfonts-local.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/Admin/Actions.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
host-webfonts-local/tags/5.7.7/host-webfonts-local.php
r2992194 r3008876 4 4 * Plugin URI: https://daan.dev/wordpress/omgf/ 5 5 * Description: Increase GDPR/DSGVO compliance and leverage browser cache by automatically self-hosting Google Fonts. 6 * Version: 5.7. 66 * Version: 5.7.7 7 7 * Author: Daan from Daan.dev 8 8 * Author URI: https://daan.dev -
host-webfonts-local/tags/5.7.7/readme.txt
r2992194 r3008876 4 4 Requires at least: 4.6 5 5 Tested up to: 6.3 6 Stable tag: 5.7. 66 Stable tag: 5.7.7 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 79 79 80 80 == Changelog == 81 82 = 5.7.7 | December 12th, 2023 = 83 * Fixed: CSRF issue in custom Update Settings logic. 81 84 82 85 = 5.7.6 | November 8th, 2023 = -
host-webfonts-local/tags/5.7.7/src/Admin/Actions.php
r2963278 r3008876 22 22 /** 23 23 * Execute all actions required in wp-admin. 24 *25 24 * @return void 26 25 */ … … 35 34 /** 36 35 * Needs to run before admin_menu and admin_init. 37 *38 36 * @action _admin_menu 39 37 */ … … 44 42 /** 45 43 * Initialize the Save & Optimize routine. 46 *47 44 * @return void 48 45 */ … … 53 50 /** 54 51 * We use a custom update action, because we're storing multidimensional arrays upon form submit. 55 *56 52 * This prevents us from having to use AJAX, serialize(), stringify() and eventually having to json_decode() it, i.e. 57 53 * a lot of headaches. 58 *59 54 * @since v5.6.0 60 55 */ 61 56 public function update_settings() { 62 // phpcs:ignore WordPress.Security 63 if ( empty( $_POST['action'] ) || $_POST['action'] !== 'omgf-update' ) { 57 $action = $_GET[ 'tab' ] ?? 'omgf-optimize-settings'; 58 59 wp_verify_nonce( $_POST[ '_wpnonce' ], $action ); 60 61 if ( ! current_user_can( 'manage_options' ) ) { 64 62 return; 65 63 } 66 64 67 // phpcs:ignore 68 $updated_settings = $this->clean($_POST); 65 if ( empty( $_POST[ 'action' ] ) || $_POST[ 'action' ] !== 'omgf-update' ) { 66 return; 67 } 68 69 $updated_settings = $this->clean( $_POST ); 69 70 70 71 foreach ( $updated_settings as $option_name => $option_value ) { … … 95 96 /** 96 97 * Additional update actions can be added here. 97 *98 98 * @since v5.6.0 99 99 */ … … 113 113 * Clean variables using `sanitize_text_field`. 114 114 * Arrays are cleaned recursively. Non-scalar values are ignored. 115 * @since 5.5.7 115 116 * 116 117 * @param string|array $var Sanitize the variable. 117 *118 * @since 5.5.7119 118 * 120 119 * @return string|array … … 133 132 * @param mixed $plugin 134 133 * @param mixed $response 134 * 135 135 * @return void 136 136 */ 137 137 public function render_update_notice( $plugin, $response ) { 138 $current_version = $plugin[ 'Version'];139 $new_version = $plugin[ 'new_version'];138 $current_version = $plugin[ 'Version' ]; 139 $new_version = $plugin[ 'new_version' ]; 140 140 141 141 if ( version_compare( $current_version, $new_version, '<' ) ) { 142 $response = wp_remote_get( 'https://daan.dev/omgf-update-notices.json?' . substr( uniqid( '', true ), - 5 ) );142 $response = wp_remote_get( 'https://daan.dev/omgf-update-notices.json?' . substr( uniqid( '', true ), - 5 ) ); 143 143 144 144 if ( is_wp_error( $response ) ) { … … 157 157 ]; 158 158 159 wp_kses( sprintf( ' <strong>' . __( 'This update includes major changes, please <a href="%s" target="_blank">read this</a> before continuing.' ) . '</strong>', $update_notices[ $new_version ]->url ), $allowed_html ); 159 wp_kses( 160 sprintf( 161 ' <strong>' . 162 __( 'This update includes major changes, please <a href="%s" target="_blank">read this</a> before continuing.' ) . 163 '</strong>', 164 $update_notices[ $new_version ]->url 165 ), 166 $allowed_html 167 ); 160 168 } 161 169 } … … 208 216 /** 209 217 * Check if directory is empty. 210 *211 218 * This works because a new FilesystemIterator will initially point to the first file in the folder - 212 219 * if there are no files in the folder, valid() will return false 213 220 * 214 221 * @param mixed $dir 222 * 215 223 * @return bool 216 224 */ -
host-webfonts-local/trunk/host-webfonts-local.php
r2992194 r3008876 4 4 * Plugin URI: https://daan.dev/wordpress/omgf/ 5 5 * Description: Increase GDPR/DSGVO compliance and leverage browser cache by automatically self-hosting Google Fonts. 6 * Version: 5.7. 66 * Version: 5.7.7 7 7 * Author: Daan from Daan.dev 8 8 * Author URI: https://daan.dev -
host-webfonts-local/trunk/readme.txt
r2992194 r3008876 4 4 Requires at least: 4.6 5 5 Tested up to: 6.3 6 Stable tag: 5.7. 66 Stable tag: 5.7.7 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 79 79 80 80 == Changelog == 81 82 = 5.7.7 | December 12th, 2023 = 83 * Fixed: CSRF issue in custom Update Settings logic. 81 84 82 85 = 5.7.6 | November 8th, 2023 = -
host-webfonts-local/trunk/src/Admin/Actions.php
r2963278 r3008876 22 22 /** 23 23 * Execute all actions required in wp-admin. 24 *25 24 * @return void 26 25 */ … … 35 34 /** 36 35 * Needs to run before admin_menu and admin_init. 37 *38 36 * @action _admin_menu 39 37 */ … … 44 42 /** 45 43 * Initialize the Save & Optimize routine. 46 *47 44 * @return void 48 45 */ … … 53 50 /** 54 51 * We use a custom update action, because we're storing multidimensional arrays upon form submit. 55 *56 52 * This prevents us from having to use AJAX, serialize(), stringify() and eventually having to json_decode() it, i.e. 57 53 * a lot of headaches. 58 *59 54 * @since v5.6.0 60 55 */ 61 56 public function update_settings() { 62 // phpcs:ignore WordPress.Security 63 if ( empty( $_POST['action'] ) || $_POST['action'] !== 'omgf-update' ) { 57 $action = $_GET[ 'tab' ] ?? 'omgf-optimize-settings'; 58 59 wp_verify_nonce( $_POST[ '_wpnonce' ], $action ); 60 61 if ( ! current_user_can( 'manage_options' ) ) { 64 62 return; 65 63 } 66 64 67 // phpcs:ignore 68 $updated_settings = $this->clean($_POST); 65 if ( empty( $_POST[ 'action' ] ) || $_POST[ 'action' ] !== 'omgf-update' ) { 66 return; 67 } 68 69 $updated_settings = $this->clean( $_POST ); 69 70 70 71 foreach ( $updated_settings as $option_name => $option_value ) { … … 95 96 /** 96 97 * Additional update actions can be added here. 97 *98 98 * @since v5.6.0 99 99 */ … … 113 113 * Clean variables using `sanitize_text_field`. 114 114 * Arrays are cleaned recursively. Non-scalar values are ignored. 115 * @since 5.5.7 115 116 * 116 117 * @param string|array $var Sanitize the variable. 117 *118 * @since 5.5.7119 118 * 120 119 * @return string|array … … 133 132 * @param mixed $plugin 134 133 * @param mixed $response 134 * 135 135 * @return void 136 136 */ 137 137 public function render_update_notice( $plugin, $response ) { 138 $current_version = $plugin[ 'Version'];139 $new_version = $plugin[ 'new_version'];138 $current_version = $plugin[ 'Version' ]; 139 $new_version = $plugin[ 'new_version' ]; 140 140 141 141 if ( version_compare( $current_version, $new_version, '<' ) ) { 142 $response = wp_remote_get( 'https://daan.dev/omgf-update-notices.json?' . substr( uniqid( '', true ), - 5 ) );142 $response = wp_remote_get( 'https://daan.dev/omgf-update-notices.json?' . substr( uniqid( '', true ), - 5 ) ); 143 143 144 144 if ( is_wp_error( $response ) ) { … … 157 157 ]; 158 158 159 wp_kses( sprintf( ' <strong>' . __( 'This update includes major changes, please <a href="%s" target="_blank">read this</a> before continuing.' ) . '</strong>', $update_notices[ $new_version ]->url ), $allowed_html ); 159 wp_kses( 160 sprintf( 161 ' <strong>' . 162 __( 'This update includes major changes, please <a href="%s" target="_blank">read this</a> before continuing.' ) . 163 '</strong>', 164 $update_notices[ $new_version ]->url 165 ), 166 $allowed_html 167 ); 160 168 } 161 169 } … … 208 216 /** 209 217 * Check if directory is empty. 210 *211 218 * This works because a new FilesystemIterator will initially point to the first file in the folder - 212 219 * if there are no files in the folder, valid() will return false 213 220 * 214 221 * @param mixed $dir 222 * 215 223 * @return bool 216 224 */
Note: See TracChangeset
for help on using the changeset viewer.