Version Description
- Fixed: Debug Mode wouldn't stop logging at 1MB.
- Fixed: "No log file available for download" message would show when Debug Mode was disabled under Advanced Settings.
Download this release
Release Info
Developer | DaanvandenBergh |
Plugin | OMGF | GDPR/DSVGO Compliant, Faster Google Fonts. Easy. |
Version | 5.3.4 |
Comparing to | |
See all releases |
Code changes from version 5.3.3 to 5.3.4
- host-webfonts-local.php +1 -1
- includes/admin/settings/class-advanced.php +20 -20
- includes/class-omgf.php +5 -2
- readme.txt +6 -2
host-webfonts-local.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: OMGF
|
5 |
* Plugin URI: https://daan.dev/wordpress/omgf/
|
6 |
* Description: Increase GDPR compliance, reduce DNS requests and leverage browser cache by automatically downloading Google Fonts to your server.
|
7 |
-
* Version: 5.3.
|
8 |
* Author: Daan from Daan.dev
|
9 |
* Author URI: https://daan.dev
|
10 |
* License: GPL2v2 or later
|
4 |
* Plugin Name: OMGF
|
5 |
* Plugin URI: https://daan.dev/wordpress/omgf/
|
6 |
* Description: Increase GDPR compliance, reduce DNS requests and leverage browser cache by automatically downloading Google Fonts to your server.
|
7 |
+
* Version: 5.3.4
|
8 |
* Author: Daan from Daan.dev
|
9 |
* Author URI: https://daan.dev
|
10 |
* License: GPL2v2 or later
|
includes/admin/settings/class-advanced.php
CHANGED
@@ -70,7 +70,7 @@ class OMGF_Admin_Settings_Advanced extends OMGF_Admin_Settings_Builder
|
|
70 |
</p>
|
71 |
</td>
|
72 |
</tr>
|
73 |
-
|
74 |
}
|
75 |
|
76 |
/**
|
@@ -119,26 +119,26 @@ class OMGF_Admin_Settings_Advanced extends OMGF_Admin_Settings_Builder
|
|
119 |
*/
|
120 |
public function do_download_log()
|
121 |
{
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
|
|
|
|
|
|
135 |
<?php endif; ?>
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
</td>
|
140 |
-
</tr>
|
141 |
-
<?php
|
142 |
}
|
143 |
|
144 |
/**
|
70 |
</p>
|
71 |
</td>
|
72 |
</tr>
|
73 |
+
<?php
|
74 |
}
|
75 |
|
76 |
/**
|
119 |
*/
|
120 |
public function do_download_log()
|
121 |
{
|
122 |
+
if (OMGF_DEBUG_MODE === 'on') : ?>
|
123 |
+
<tr>
|
124 |
+
<th></th>
|
125 |
+
<td>
|
126 |
+
<?php if (file_exists(OMGF::$log_file)) : ?>
|
127 |
+
<?php
|
128 |
+
clearstatcache();
|
129 |
+
$nonce = wp_create_nonce(OMGF_Admin_Settings::OMGF_ADMIN_PAGE);
|
130 |
+
?>
|
131 |
+
<a class="button button-secondary" href="<?php echo admin_url("admin-ajax.php?action=omgf_download_log&nonce=$nonce"); ?>"><?php _e('Download Log', $this->plugin_text_domain); ?></a>
|
132 |
+
<?php if (filesize(OMGF::$log_file) > MB_IN_BYTES) : ?>
|
133 |
+
<a id="omgf-delete-log" class="button button-cancel" data-nonce="<?php echo $nonce; ?>"><?php _e('Delete log', $this->plugin_text_domain); ?></a>
|
134 |
+
<p class="omgf-warning"><?php _e('Your log file is currently larger than 1MB. To protect your filesystem, debug logging has stopped. Delete the log file to enable debug logging again.', $this->plugin_text_domain); ?></p>
|
135 |
+
<?php endif; ?>
|
136 |
+
<?php else : ?>
|
137 |
+
<p class="description"><?php _e('No log file available for download.', $this->plugin_text_domain); ?></p>
|
138 |
<?php endif; ?>
|
139 |
+
</td>
|
140 |
+
</tr>
|
141 |
+
<?php endif;
|
|
|
|
|
|
|
142 |
}
|
143 |
|
144 |
/**
|
includes/class-omgf.php
CHANGED
@@ -416,14 +416,17 @@ class OMGF
|
|
416 |
}
|
417 |
|
418 |
/**
|
419 |
-
* Global debug logging function.
|
420 |
*
|
421 |
* @param mixed $message
|
422 |
* @return void
|
423 |
*/
|
424 |
public static function debug($message)
|
425 |
{
|
426 |
-
if (
|
|
|
|
|
|
|
427 |
return;
|
428 |
}
|
429 |
|
416 |
}
|
417 |
|
418 |
/**
|
419 |
+
* Global debug logging function. Stops logging if log size exceeds 1MB.
|
420 |
*
|
421 |
* @param mixed $message
|
422 |
* @return void
|
423 |
*/
|
424 |
public static function debug($message)
|
425 |
{
|
426 |
+
if (
|
427 |
+
OMGF_DEBUG_MODE !== 'on' ||
|
428 |
+
(OMGF_DEBUG_MODE === 'on' && filesize(self::$log_file) > MB_IN_BYTES)
|
429 |
+
) {
|
430 |
return;
|
431 |
}
|
432 |
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: DaanvandenBergh
|
|
3 |
Tags: google, fonts, gdpr, cache, speed, preload, font-display, webfonts, subsets, remove, minimize, external, requests
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 6.0
|
6 |
-
Stable tag: 5.3.
|
7 |
Requires PHP: 7.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -76,7 +76,11 @@ For the FAQ, [click here](https://daan.dev/docs/omgf-pro-faq/).
|
|
76 |
|
77 |
== Changelog ==
|
78 |
|
79 |
-
= 5.3.
|
|
|
|
|
|
|
|
|
80 |
* Added: Debug Mode with an option to download the log file. Stops logging when file exceeds 1MB for those who forgot to disable it.
|
81 |
* Fixed: Prevent array to string conversion with new Used Subset(s) option by writing defaults to the database: Latin, Latin Extended.
|
82 |
* Added: debug logging points in OMGF_Optimize class.
|
3 |
Tags: google, fonts, gdpr, cache, speed, preload, font-display, webfonts, subsets, remove, minimize, external, requests
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 6.0
|
6 |
+
Stable tag: 5.3.4
|
7 |
Requires PHP: 7.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
76 |
|
77 |
== Changelog ==
|
78 |
|
79 |
+
= 5.3.4 =
|
80 |
+
* Fixed: Debug Mode wouldn't stop logging at 1MB.
|
81 |
+
* Fixed: "No log file available for download" message would show when Debug Mode was disabled under Advanced Settings.
|
82 |
+
|
83 |
+
= 5.3.3 | July 22nd, 2022 =
|
84 |
* Added: Debug Mode with an option to download the log file. Stops logging when file exceeds 1MB for those who forgot to disable it.
|
85 |
* Fixed: Prevent array to string conversion with new Used Subset(s) option by writing defaults to the database: Latin, Latin Extended.
|
86 |
* Added: debug logging points in OMGF_Optimize class.
|