Version Description
Throw clear error if any of the new tables don't exist. To prevent confusion.
Download this release
Release Info
Developer | DaanvandenBergh |
Plugin | OMGF | GDPR/DSVGO Compliant, Faster Google Fonts. Easy. |
Version | 2.2.8 |
Comparing to | |
See all releases |
Code changes from version 2.2.7 to 2.2.8
- host-webfonts-local.php +1 -1
- includes/class-admin.php +36 -0
- readme.txt +4 -1
host-webfonts-local.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: OMGF
|
5 |
* Plugin URI: https://daan.dev/wordpress-plugins/host-google-fonts-locally
|
6 |
* Description: Minimize DNS requests and leverage browser cache by easily saving Google Fonts to your server and removing the external Google Fonts.
|
7 |
-
* Version: 2.2.
|
8 |
* Author: Daan van den Bergh
|
9 |
* Author URI: https://daan.dev
|
10 |
* License: GPL2v2 or later
|
4 |
* Plugin Name: OMGF
|
5 |
* Plugin URI: https://daan.dev/wordpress-plugins/host-google-fonts-locally
|
6 |
* Description: Minimize DNS requests and leverage browser cache by easily saving Google Fonts to your server and removing the external Google Fonts.
|
7 |
+
* Version: 2.2.8
|
8 |
* Author: Daan van den Bergh
|
9 |
* Author URI: https://daan.dev
|
10 |
* License: GPL2v2 or later
|
includes/class-admin.php
CHANGED
@@ -21,9 +21,16 @@ class OMGF_Admin
|
|
21 |
const OMGF_ADMIN_JS_HANDLE = 'omgf-admin-js';
|
22 |
const OMGF_ADMIN_CSS_HANDLE = 'omgf-admin-css';
|
23 |
|
|
|
|
|
|
|
24 |
public function __construct()
|
25 |
{
|
|
|
|
|
|
|
26 |
// @formatter:off
|
|
|
27 |
add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
|
28 |
// @formatter:on
|
29 |
}
|
@@ -48,6 +55,35 @@ class OMGF_Admin
|
|
48 |
}
|
49 |
}
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
protected function get_template($name)
|
52 |
{
|
53 |
return include OMGF_PLUGIN_DIR . 'templates/admin/block-' . $name . '.phtml';
|
21 |
const OMGF_ADMIN_JS_HANDLE = 'omgf-admin-js';
|
22 |
const OMGF_ADMIN_CSS_HANDLE = 'omgf-admin-css';
|
23 |
|
24 |
+
/** @var QM_DB|wpdb $wpdb */
|
25 |
+
private $wpdb;
|
26 |
+
|
27 |
public function __construct()
|
28 |
{
|
29 |
+
global $wpdb;
|
30 |
+
|
31 |
+
$this->wpdb = $wpdb;
|
32 |
// @formatter:off
|
33 |
+
add_action('admin_notices', array($this, 'table_exists'));
|
34 |
add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
|
35 |
// @formatter:on
|
36 |
}
|
55 |
}
|
56 |
}
|
57 |
|
58 |
+
/**
|
59 |
+
* Check if main OMGF table exists on page load in Admin screen.
|
60 |
+
*/
|
61 |
+
public function table_exists()
|
62 |
+
{
|
63 |
+
$table = OMGF_DB_TABLENAME;
|
64 |
+
|
65 |
+
if (!$this->wpdb->get_var($this->wpdb->prepare("SHOW TABLES LIKE %s", $table))): ?>
|
66 |
+
<div id="message" class="notice notice-error is-dismissible">
|
67 |
+
<p><?php _e("Table $table does not exist and is necessary for OMGF to function properly. Try manually de-activating and activating the plugin via the WordPress plugins screen.", 'host-webfonts-local'); ?></p>
|
68 |
+
</div>
|
69 |
+
<?php
|
70 |
+
update_option(OMGF_Admin_Settings::OMGF_SETTING_DB_VERSION, null);
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Backwards compatibility
|
74 |
+
*
|
75 |
+
* @since v2.2.2
|
76 |
+
*/
|
77 |
+
update_option('caos_webfonts_db_version', null);
|
78 |
+
?>
|
79 |
+
<?php endif;
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* @param $name
|
84 |
+
*
|
85 |
+
* @return mixed
|
86 |
+
*/
|
87 |
protected function get_template($name)
|
88 |
{
|
89 |
return include OMGF_PLUGIN_DIR . 'templates/admin/block-' . $name . '.phtml';
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://daan.dev/donate/
|
|
4 |
Tags: google, fonts, host, save, local, locally, webfonts, update, minimize, external, requests, leverage, browser, cache
|
5 |
Requires at least: 4.6
|
6 |
Tested up to: 5.3
|
7 |
-
Stable tag: 2.2.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -115,6 +115,9 @@ N/A
|
|
115 |
|
116 |
== Changelog ==
|
117 |
|
|
|
|
|
|
|
118 |
= 2.2.7 =
|
119 |
Forget to up static version after changes to Admin JS files.
|
120 |
|
4 |
Tags: google, fonts, host, save, local, locally, webfonts, update, minimize, external, requests, leverage, browser, cache
|
5 |
Requires at least: 4.6
|
6 |
Tested up to: 5.3
|
7 |
+
Stable tag: 2.2.8
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
115 |
|
116 |
== Changelog ==
|
117 |
|
118 |
+
= 2.2.8 =
|
119 |
+
Throw clear error if any of the new tables don't exist. To prevent confusion.
|
120 |
+
|
121 |
= 2.2.7 =
|
122 |
Forget to up static version after changes to Admin JS files.
|
123 |
|