Wp Local



Description

The Washington Post offers breaking local news, weather and traffic information for the DC, Maryland and Virginia metro areas, plus information about school districts, crime, government, religion. WP Local Plus is a completely automated, turn-key WordPress plugin that will allow you to automatically create content packed, dynamic local business directories complete with dynamic business reviews, business listings, coupon offers and Google Maps integration, and much more, right from within your WordPress blog. Installing WordPress locally on a Windows or Mac computer is often the first step in any WordPress website development process. This is regarded as WordPress localhost installation. Localhost here refers to your Windows or Mac machine. To install WordPress locally, you need a localhost server app. Description WordPress Business Directory Plugin: Free Version. WP Local Plus is a powerful and easy to setup WordPress Directory Plugin. Create businesses. This WordPress business directory plugin helps you showcase businesses in your locality along with contact details. Local is a free local development environment designed to simplify the workflow of WordPress developers and designers.

How could using fonts via Google’s service possibly run afoul of GDPR? The fact of the matter is that, when a font is requested by the user’s browser, their IP is logged by Google and used for analytics.
— Lifehacker

Leverage Browser Cache, Minimize DNS requests and serve your Google Fonts in a 100% GDPR compliant way with OMGF!

OMGF is written with performance and user-friendliness in mind. It uses the Google Fonts Helper API to automatically cache the fonts your theme and plugins use to minimize DNS requests and speed up your WordPress website.

How Does It Work?

After installing the plugin, choose your Optimization Mode: Manual (default) or Automatic.

When Manual is selected, you can simply configure OMGF to work in the way you want, and run its detection mechanism on an address of your choosing.

In Automatic Mode, OMGF runs silently in the background and captures any requests made to fonts.googleapis.com or fonts.gstatic.com. When a webpage is first loaded, it reroutes these requests to its own Download API and copies the fonts over to your server. Then it generates a stylesheet for your fonts including EOT, TTF, WOFF and WOFF2 formats to guarantee maximum cross browser compatibility!

When the fonts are downloaded and the stylesheet is generated, it rewrites every URL (pointing to fonts.googleapis.com or fonts.gstatic.com) to the locally hosted variant.

Please keep in mind that, although I try to make the configuration of this plugin as easy as possible, the concept of locally hosting a file or optimizing Google Fonts for Pagespeed Insights or GT Metrix has proven to be confusing for some people. If you’re not sure of what your doing, please consult a SEO expert or Webdeveloper to help you with the configuration of this plugin or hire me to do it for you.

Features

Wp Local
  • Automatically replace registered/enqueued Google Fonts in wp_head() with local copies,
  • Automatically remove registered/enqueued Google Fonts from wp_head(),
  • Manage Optimized Google Fonts,
    • Preload above the fold fonts,
    • Don’t load certain fonts or entire stylesheets.
  • Leverage the font-display (swap) option,
  • Serve fonts from CDN,
  • Use OMGF with security through obscurity plugins.

Features in the PRO version

Everything in the free version, plus:
– Automatically remove/replace all Google Fonts throughout the entire document/page,
– Also supports WebFont Loader (webfont.js) and Early Access Google Fonts.
– Combine all Google Fonts (made by your theme and/or plugins) stylesheets into one file,
– Deduplicate Google Fonts stylesheets,
– Reduce loading time and page size, by forcing the used subset(s) for all Google Fonts requests,
– Remove Resource Hints (preload, preconnect, dns-prefetch) pointing to fonts.googleapis.com or fonts.gstatic.com.

Purchase OMGF Pro | Documentation | Tested Plugins & Themes

Installation

  1. Upload the plugin files to the /wp-content/plugins/host-webfonts-local directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‘Plugins’ screen in WordPress
  3. Use the Settings -> Optimize Google Fonts screen to configure the plugin
Wp Local

For a more comprehensive guide for configuration, click here.

FAQ

Why do my fonts load slow the first time?

That’s because OMGF’s download API is capturing the request and immediately downloading all the fonts. After the fonts are downloaded and the stylesheet is generated, the stylesheet will load just as fast as any other file request.

I don’t know what I’m doing! Can you help?

Of course 🙂 But first calm down and read this comprehensive guide on how to configure OMGF. If you have any questions afterwards, visit the Support Forum.

I have another file I want to host locally. Could you make a plugin?

Maintaining three plugins besides my daily 9-to-5 job is a handful, so no. If you’re looking for a way to host analytics.js locally; please install CAOS. For anything else, please follow the steps in this how-to.

How come my font isn’t available in OMGF?

This could be for several reasons:
1. Have you checked if your font is available on Google Fonts?
1. Is your font listed as an open source font, or is it a premium font? For obvious reasons, OMGF only has access to open source fonts.

Does this plugin remove resource hints, e.g. preconnect, preload or dns-prefetch?

No, to automatically remove resource hints pointing to fonts.googleapis.com or fonts.gstatic.com, upgrade to OMGF Pro.

Can I serve the fonts from my CDN?

Yes, you can. Enter the url of your CDN and empty OMGF’s cache directory.

I have Google Fonts Processing set to Replace/Remove but the fonts from fonts.gstatic.com|fonts.googleapis.com are still loaded. What’s going on?

The free version of OMGF removes any fonts that are loaded in the conventional way: wp_enqueue_scripts(). If it doesn’t work for you, you’re theme or plugins using other methods to load Google Fonts, e.g. in the footer, WebFont Loader, etc. Upgrade to OMGF Pro to automatically replace these fonts with a locally hosted version.

Does this plugin edit template files?

No, it does not. It creates a CSS Stylesheet which will be automatically added to your theme’s header using WordPress built-in queueing system.

The stylesheet isn’t loaded? What’s going on?

The free version of OMGF enqueues the stylesheet into WordPress’ head using wp_enqueue_scripts(). If the stylesheet isn’t loaded, this probably means your theme isn’t implementing wp_head() correctly. Upgrade to OMGF Pro to automatically add the stylesheet into WordPress’ head.

Does this plugin support Multi Site? I’m getting CORS errors!

Yes, it does. When using subdomains, however, you might run into CORS related issues. To get around this, you should configure each site separately. Do the following:

  • Go to the site’s own dashboard,
  • Change OMGF’s cache directory (Save font files to…) to something unique, e.g. /uploads/site1/omgf,
  • Click ‘Save Changes’.

Repeat this for every site you want to use with OMGF. A new stylesheet, using the corresponding site’s Home-URL and cache directory for each font, will be generated. Bypassing any Cross-Origin Resource Sharing (CORS) issues you might run into.

Is this plugin compatible with WPML?

No, not yet. But I will definitely try to make it compatible in the future!

Reviews

Localize a script.

Contents

  • Description
  • Related

Description Description

Works only if the script has already been added.

Accepts an associative array $l10n and creates a JavaScript object:

See also See also

Parameters Parameters

$handle

(string)(Required)Script handle the data will be attached to.

$object_name

(string)(Required)Name for the JavaScript object. Passed directly, so it should be qualified JS variable. Example: '/[a-zA-Z0-9_]+/'.

$l10n

(array)(Required)The data itself. The data can be either a single or multi-dimensional array.

Return Return

(bool) True if the script was successfully localized, false otherwise.

More Information More Information

This function localizes a registered script with data for a JavaScript variable.

This lets you offer properly localized translations of any strings used in your script. This is necessary because WordPress currently only offers a localization API in PHP, not directly in JavaScript (but see ticket #20491).

Though localization is the primary use, it was often used to pass generic data from PHP to JavaScript, because it was originally the only official way to do that. wp_add_inline_script() was introduced in WordPress Version 4.5, and is now the best practice for that use case. `wp_localize_script()` should only be used when you actually want to localize strings.

$object_name is the name of the variable which will contain the data. Note that this should be unique to both the script and to the plugin or theme. Thus, the value here should be properly prefixed with the slug or another unique value, to prevent conflicts. However, as this is a JavaScript object name, it cannot contain dashes. Use underscores or camelCasing.

$l10n is the data itself. The data can be either a single- or multi- (as of 3.3) dimensional array. Like json_encode(), the data will be a JavaScript object if the array is an associate array (a map), otherwise the array will be a JavaScript array.

IMPORTANT!wp_localize_script() MUST be called after the script has been registered using wp_register_script() or wp_enqueue_script().

Furthermore, the actual output of the JavaScript <script> a tag containing your localization variable occurs at the time that the enqueued script is printed (output/included on the page). This has some significant repercussions if you enqueue your script as you should using the appropriate actions (wp_enqueue_scripts and admin_enqueue_scripts), but wish to localize later using data that is not available at enqueue time.

In this case, consider enqueueing your script with the in_footer argument set to true, to delay the printing of your script include until much later in the page build (ie: wp_enqueue_script( $slug, $URL, $deps, $ver, true ); ).
The last chance to localize your script would then be on the 'wp_print_footer_scripts' hook.

Source Source

Local

Wp_localize_script Example

File: wp-includes/functions.wp-scripts.php

View on Trac

Local By Flywheel Don't Work

Related Related

Wp Localhost

Uses Uses

Local Wordpress Development Environment

Uses
UsesDescription
wp-includes/class.wp-scripts.php:WP_Scripts::localize()

Localizes a script, only if the script has already been added.