Plugin Directory

Changeset 3465921


Ignore:
Timestamp:
02/20/2026 04:10:59 PM (5 weeks ago)
Author:
DaanvandenBergh
Message:

Update to version 6.1.3 from GitHub

Location:
host-webfonts-local
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • host-webfonts-local/tags/6.1.3/host-webfonts-local.php

    r3465853 r3465921  
    44 * Plugin URI: https://daan.dev/wordpress/omgf/
    55 * Description: Increase GDPR/DSGVO compliance and leverage browser cache by automatically self-hosting Google Fonts.
    6  * Version: 6.1.2
     6 * Version: 6.1.3
    77 * Author: Daan from Daan.dev
    88 * Author URI: https://daan.dev
  • host-webfonts-local/tags/6.1.3/readme.txt

    r3465853 r3465921  
    44Requires at least: 5.9
    55Tested up to: 6.9
    6 Stable tag: 6.1.2
     6Stable tag: 6.1.3
    77Requires PHP: 7.3
    88License: GPLv2 or later
     
    8989== Changelog ==
    9090
     91= 6.1.3 =
     92* Coincidentally found a bug that has been haunting me for years, that's why I'm releasing this quick patch release.
     93* Fixed: in some scenarios, unloaded_stylesheets would be stored as an array with one empty element in the database.
     94
    9195= 6.1.2 | February 20th, 2026 =
    92 * Fixed: if the expected MIME type of a downloaded file didn't match, a class OMGF\OMGF exception would be thrown.
     96* Fixed: if the expected MIME type of the downloaded file didn't match, a class OMGF\OMGF exception would be thrown.
    9397* Dev: Updated CI tools.
    9498
  • host-webfonts-local/tags/6.1.3/src/Helper.php

    r3375747 r3465921  
    2929     * This is basically a wrapper around update_option() to offer a centralized interface for
    3030     * storing OMGF's settings in the wp_options table.
     31     *
     32     * @param mixed $value
     33     * @param string $setting
     34     *
     35     * @return bool
    3136     * @since v5.6.0
    3237     *
    33      * @param mixed  $value
    34      * @param string $setting
    35      *
    36      * @return bool
    3738     */
    3839    public static function update_option( $setting, $value, $autoload = true ) {
     
    5455     * Gets all settings for OMGF.
    5556     * @filter omgf_settings
     57     * @return array
    5658     * @since  5.5.7
    57      * @return array
    5859     */
    5960    public static function get_settings() {
     
    8384     * This is basically a wrapper around delete_option() to offer a centralized interface for
    8485     * removing OMGF's settings in the wp_options table.
     86     *
     87     * @param string $setting
     88     *
     89     * @return bool
    8590     * @since v5.6.0
    8691     *
    87      * @param string $setting
    88      *
    89      * @return bool
    9092     */
    9193    public static function delete_option( $setting ) {
     
    124126     *
    125127     * @filter omgf_setting_{$name}
     128     *
     129     * @param mixed $default (optional)
     130     * @param string $name
     131     *
    126132     * @since  v5.6.0
    127133     *
    128      * @param mixed  $default (optional)
    129      * @param string $name
    130134     */
    131135    public static function get_option( $name, $default = null ) {
     
    175179
    176180        if ( empty( $unloaded_stylesheets ) ) {
     181            // Returns a string with one empty element if the option is empty, that's why we array_filter it.
    177182            $unloaded_stylesheets = explode( ',', self::get_option( Settings::OMGF_OPTIMIZE_SETTING_UNLOAD_STYLESHEETS, '' ) );
    178183        }
    179184
    180         return array_filter( $unloaded_stylesheets );
     185        // Remove empty elements (and store it to the static variable before returning it)
     186        $unloaded_stylesheets = array_filter( $unloaded_stylesheets );
     187
     188        return $unloaded_stylesheets;
    181189    }
    182190
     
    203211    /**
    204212     * Fetch cache keys from the DB.
     213     * @return array
     214     *
     215     * @codeCoverageIgnore
    205216     * @since v5.6.4 Extract cache keys from Optimized Fonts option if the option itself appears empty.
    206      * @return array
    207      *
    208      * @codeCoverageIgnore
    209217     */
    210218    public static function cache_keys() {
     
    234242     * Optimized Local Fonts to be displayed in the Optimize Local Fonts table.
    235243     * Use a static variable to reduce database reads/writes.
     244     *
     245     * @param bool $force_add
     246     * @param array $maybe_add If it doesn't exist, it's added to the cache layer.
     247     *
     248     * @return array
     249     *
     250     * @codeCoverageIgnore
    236251     * @since v4.5.7
    237252     *
    238      * @param bool  $force_add
    239      * @param array $maybe_add If it doesn't exist, it's added to the cache layer.
    240      *
    241      * @return array
    242      *
    243      * @codeCoverageIgnore
    244253     */
    245254    public static function admin_optimized_fonts( $maybe_add = [], $force_add = false ) {
     
    275284     * Optimized Local Fonts to be used in the frontend. Doesn\'t contain unloaded fonts.
    276285     * Use a static variable to reduce database reads/writes.
     286     *
     287     * @param bool $force_add
     288     * @param array $maybe_add If it doesn't exist, it's added to the cache layer.
     289     *
     290     * @return array
     291     *
     292     * @codeCoverageIgnore
    277293     * @since v5.8.1
    278294     *
    279      * @param bool  $force_add
    280      * @param array $maybe_add If it doesn't exist, it's added to the cache layer.
    281      *
    282      * @return array
    283      *
    284      * @codeCoverageIgnore
    285295     */
    286296    public static function optimized_fonts( $maybe_add = [], $force_add = false ) {
     
    321331
    322332    /**
     333     * @return array
     334     *
     335     * @codeCoverageIgnore
    323336     * @since v5.4.4 Returns the available subsets in all requested fonts/stylesheets.
    324337     *               Functions as a temporary cache layer to reduce DB reads with get_option().
    325      * @return array
    326      *
    327      * @codeCoverageIgnore
    328338     */
    329339    public static function available_used_subsets( $maybe_add = [], $intersect = false ) {
     
    378388     * To prevent "Cannot use output buffering  in output buffering display handlers" errors, I introduced a debug
    379389     * array feature, to easily display, well, arrays in the debug log (duh!)
     390     *
     391     * @param array|object $array The array to be displayed in the debug log
     392     * @param string $name A descriptive name to be shown in the debug log
     393     *
     394     * @return void
     395     *
     396     * @codeCoverageIgnore
    380397     * @since v5.3.7
    381398     *
    382      * @param array|object $array The array to be displayed in the debug log
    383      * @param string       $name  A descriptive name to be shown in the debug log
    384      *
    385      * @return void
    386      *
    387      * @codeCoverageIgnore
    388399     */
    389400    public static function debug_array( $name, $array ) {
    390401        if ( ! self::get_option( Settings::OMGF_ADV_SETTING_DEBUG_MODE ) ||
    391             ( self::get_option( Settings::OMGF_ADV_SETTING_DEBUG_MODE ) && file_exists( self::log_file() ) && filesize( self::log_file() ) > MB_IN_BYTES ) ) {
     402             ( self::get_option( Settings::OMGF_ADV_SETTING_DEBUG_MODE ) && file_exists( self::log_file() ) && filesize( self::log_file() ) > MB_IN_BYTES ) ) {
    392403            return;
    393404        }
     
    444455    public static function debug( $message ) {
    445456        if ( ! self::get_option( Settings::OMGF_ADV_SETTING_DEBUG_MODE ) ||
    446             ( self::get_option( Settings::OMGF_ADV_SETTING_DEBUG_MODE ) && file_exists( self::log_file() ) && filesize( self::log_file() ) > MB_IN_BYTES ) ) {
     457             ( self::get_option( Settings::OMGF_ADV_SETTING_DEBUG_MODE ) && file_exists( self::log_file() ) && filesize( self::log_file() ) > MB_IN_BYTES ) ) {
    447458            return;
    448459        }
     
    505516     * Generate a request to $uri including the required parameters for OMGF to run in the frontend.
    506517     *
     518     * @param $url A (relative or absolute) URL, defaults to home URL.
     519     *
     520     * @return string
    507521     * @since v5.4.4 Added omgf_optimize_run_args filter so other plugins can add query parameters to the Save & Optimize routine.
    508522     *
    509      * @param $url A (relative or absolute) URL, defaults to home URL.
    510      *
    511      * @return string
    512523     */
    513524    public static function no_cache_optimize_url( $url = '' ) {
  • host-webfonts-local/trunk/host-webfonts-local.php

    r3465853 r3465921  
    44 * Plugin URI: https://daan.dev/wordpress/omgf/
    55 * Description: Increase GDPR/DSGVO compliance and leverage browser cache by automatically self-hosting Google Fonts.
    6  * Version: 6.1.2
     6 * Version: 6.1.3
    77 * Author: Daan from Daan.dev
    88 * Author URI: https://daan.dev
  • host-webfonts-local/trunk/readme.txt

    r3465853 r3465921  
    44Requires at least: 5.9
    55Tested up to: 6.9
    6 Stable tag: 6.1.2
     6Stable tag: 6.1.3
    77Requires PHP: 7.3
    88License: GPLv2 or later
     
    8989== Changelog ==
    9090
     91= 6.1.3 =
     92* Coincidentally found a bug that has been haunting me for years, that's why I'm releasing this quick patch release.
     93* Fixed: in some scenarios, unloaded_stylesheets would be stored as an array with one empty element in the database.
     94
    9195= 6.1.2 | February 20th, 2026 =
    92 * Fixed: if the expected MIME type of a downloaded file didn't match, a class OMGF\OMGF exception would be thrown.
     96* Fixed: if the expected MIME type of the downloaded file didn't match, a class OMGF\OMGF exception would be thrown.
    9397* Dev: Updated CI tools.
    9498
  • host-webfonts-local/trunk/src/Helper.php

    r3375747 r3465921  
    2929     * This is basically a wrapper around update_option() to offer a centralized interface for
    3030     * storing OMGF's settings in the wp_options table.
     31     *
     32     * @param mixed $value
     33     * @param string $setting
     34     *
     35     * @return bool
    3136     * @since v5.6.0
    3237     *
    33      * @param mixed  $value
    34      * @param string $setting
    35      *
    36      * @return bool
    3738     */
    3839    public static function update_option( $setting, $value, $autoload = true ) {
     
    5455     * Gets all settings for OMGF.
    5556     * @filter omgf_settings
     57     * @return array
    5658     * @since  5.5.7
    57      * @return array
    5859     */
    5960    public static function get_settings() {
     
    8384     * This is basically a wrapper around delete_option() to offer a centralized interface for
    8485     * removing OMGF's settings in the wp_options table.
     86     *
     87     * @param string $setting
     88     *
     89     * @return bool
    8590     * @since v5.6.0
    8691     *
    87      * @param string $setting
    88      *
    89      * @return bool
    9092     */
    9193    public static function delete_option( $setting ) {
     
    124126     *
    125127     * @filter omgf_setting_{$name}
     128     *
     129     * @param mixed $default (optional)
     130     * @param string $name
     131     *
    126132     * @since  v5.6.0
    127133     *
    128      * @param mixed  $default (optional)
    129      * @param string $name
    130134     */
    131135    public static function get_option( $name, $default = null ) {
     
    175179
    176180        if ( empty( $unloaded_stylesheets ) ) {
     181            // Returns a string with one empty element if the option is empty, that's why we array_filter it.
    177182            $unloaded_stylesheets = explode( ',', self::get_option( Settings::OMGF_OPTIMIZE_SETTING_UNLOAD_STYLESHEETS, '' ) );
    178183        }
    179184
    180         return array_filter( $unloaded_stylesheets );
     185        // Remove empty elements (and store it to the static variable before returning it)
     186        $unloaded_stylesheets = array_filter( $unloaded_stylesheets );
     187
     188        return $unloaded_stylesheets;
    181189    }
    182190
     
    203211    /**
    204212     * Fetch cache keys from the DB.
     213     * @return array
     214     *
     215     * @codeCoverageIgnore
    205216     * @since v5.6.4 Extract cache keys from Optimized Fonts option if the option itself appears empty.
    206      * @return array
    207      *
    208      * @codeCoverageIgnore
    209217     */
    210218    public static function cache_keys() {
     
    234242     * Optimized Local Fonts to be displayed in the Optimize Local Fonts table.
    235243     * Use a static variable to reduce database reads/writes.
     244     *
     245     * @param bool $force_add
     246     * @param array $maybe_add If it doesn't exist, it's added to the cache layer.
     247     *
     248     * @return array
     249     *
     250     * @codeCoverageIgnore
    236251     * @since v4.5.7
    237252     *
    238      * @param bool  $force_add
    239      * @param array $maybe_add If it doesn't exist, it's added to the cache layer.
    240      *
    241      * @return array
    242      *
    243      * @codeCoverageIgnore
    244253     */
    245254    public static function admin_optimized_fonts( $maybe_add = [], $force_add = false ) {
     
    275284     * Optimized Local Fonts to be used in the frontend. Doesn\'t contain unloaded fonts.
    276285     * Use a static variable to reduce database reads/writes.
     286     *
     287     * @param bool $force_add
     288     * @param array $maybe_add If it doesn't exist, it's added to the cache layer.
     289     *
     290     * @return array
     291     *
     292     * @codeCoverageIgnore
    277293     * @since v5.8.1
    278294     *
    279      * @param bool  $force_add
    280      * @param array $maybe_add If it doesn't exist, it's added to the cache layer.
    281      *
    282      * @return array
    283      *
    284      * @codeCoverageIgnore
    285295     */
    286296    public static function optimized_fonts( $maybe_add = [], $force_add = false ) {
     
    321331
    322332    /**
     333     * @return array
     334     *
     335     * @codeCoverageIgnore
    323336     * @since v5.4.4 Returns the available subsets in all requested fonts/stylesheets.
    324337     *               Functions as a temporary cache layer to reduce DB reads with get_option().
    325      * @return array
    326      *
    327      * @codeCoverageIgnore
    328338     */
    329339    public static function available_used_subsets( $maybe_add = [], $intersect = false ) {
     
    378388     * To prevent "Cannot use output buffering  in output buffering display handlers" errors, I introduced a debug
    379389     * array feature, to easily display, well, arrays in the debug log (duh!)
     390     *
     391     * @param array|object $array The array to be displayed in the debug log
     392     * @param string $name A descriptive name to be shown in the debug log
     393     *
     394     * @return void
     395     *
     396     * @codeCoverageIgnore
    380397     * @since v5.3.7
    381398     *
    382      * @param array|object $array The array to be displayed in the debug log
    383      * @param string       $name  A descriptive name to be shown in the debug log
    384      *
    385      * @return void
    386      *
    387      * @codeCoverageIgnore
    388399     */
    389400    public static function debug_array( $name, $array ) {
    390401        if ( ! self::get_option( Settings::OMGF_ADV_SETTING_DEBUG_MODE ) ||
    391             ( self::get_option( Settings::OMGF_ADV_SETTING_DEBUG_MODE ) && file_exists( self::log_file() ) && filesize( self::log_file() ) > MB_IN_BYTES ) ) {
     402             ( self::get_option( Settings::OMGF_ADV_SETTING_DEBUG_MODE ) && file_exists( self::log_file() ) && filesize( self::log_file() ) > MB_IN_BYTES ) ) {
    392403            return;
    393404        }
     
    444455    public static function debug( $message ) {
    445456        if ( ! self::get_option( Settings::OMGF_ADV_SETTING_DEBUG_MODE ) ||
    446             ( self::get_option( Settings::OMGF_ADV_SETTING_DEBUG_MODE ) && file_exists( self::log_file() ) && filesize( self::log_file() ) > MB_IN_BYTES ) ) {
     457             ( self::get_option( Settings::OMGF_ADV_SETTING_DEBUG_MODE ) && file_exists( self::log_file() ) && filesize( self::log_file() ) > MB_IN_BYTES ) ) {
    447458            return;
    448459        }
     
    505516     * Generate a request to $uri including the required parameters for OMGF to run in the frontend.
    506517     *
     518     * @param $url A (relative or absolute) URL, defaults to home URL.
     519     *
     520     * @return string
    507521     * @since v5.4.4 Added omgf_optimize_run_args filter so other plugins can add query parameters to the Save & Optimize routine.
    508522     *
    509      * @param $url A (relative or absolute) URL, defaults to home URL.
    510      *
    511      * @return string
    512523     */
    513524    public static function no_cache_optimize_url( $url = '' ) {
Note: See TracChangeset for help on using the changeset viewer.