Skip to content

Commit

Permalink
Update(fm): releases minor version 2.1.0 (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
killshot13 authored Feb 20, 2022
1 parent aaff59a commit c8ea451
Show file tree
Hide file tree
Showing 31 changed files with 95 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ composer.phar
*vendor/
.htaccess
.php-cs-fixer.cache
FontManager.zip
font-manager.zip


# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
Expand Down
17 changes: 0 additions & 17 deletions FontManager.php

This file was deleted.

15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# FontManager

v2.0.0
# Font Manager
v2.1.0

## Table of Contents

Expand All @@ -11,7 +10,7 @@ v2.0.0

## About

A Simple, Site-Specific WordPress Plugin to Host Google Fonts Locally and Reduce Page Load Speed.
A simple, site-specific WordPress plugin to host Google Fonts locally and reduce Page Load Speed.

### Getting Started []()

Expand All @@ -25,27 +24,27 @@ What things you need to install the software and how to install them.

- Use the FILEPATH prefix below to create your CSS, then copy the output to a temporary file; you will need it again soon.

> **Customize folder prefix (optional):** `../fonts/%FontName%/`
> **Customize folder prefix (optional):** `../fonts/%fontname%/`
### Installing []()

- Clone this repo to your local environment.

- Run `composer update` and `composer install` in the '/tools/php-csfixer' folder.

- Delete the fonts in '/assets/fonts/[Dosis, Exo2, Iceberg, Lato]' and create new folders to represent your font-families.
- Delete the fonts in '/assets/fonts/[dosis, exo2, iceberg]' and create new folders to represent your font-families.

- Unzip the `.zip` files from Google Webfonts Helper into their respective directories.

- Delete the CSS in '/assets/css/FontManager.css' and replace it with the applicable CSS you copied earlier.
- Delete the CSS in '/assets/css/font-manager.css' and replace it with the applicable CSS you copied earlier.

### Formatting

- php-cs-fixer

## Usage []()

- Once you have added the fonts you need and the CSS, compress the files in the assets folder along with the FontManager.php file into a `.zip` and FontManager is ready for installation.
- Once you have added the fonts you need and the CSS, compress the files in the assets folder along with the font-manager.php file into a `.zip` and font-manager is ready for installation.

- Consider testing functionality in a WP dev enviroment before installing the plugin on a live website if at all possible.

Expand Down
54 changes: 27 additions & 27 deletions assets/css/FontManager.css → assets/css/font-manager.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
font-style: normal;
font-weight: 300;
src: local(''),
url('../fonts/Dosis/dosis-v19-latin-300.woff2') format('woff2'),
url('../fonts/Dosis/dosis-v19-latin-300.woff') format('woff'),
url('../fonts/dosis/dosis-v19-latin-300.woff2') format('woff2'),
url('../fonts/dosis/dosis-v19-latin-300.woff') format('woff'),
}

/* dosis-regular - latin */
Expand All @@ -16,8 +16,8 @@
font-style: normal;
font-weight: 400;
src: local(''),
url('../fonts/Dosis/dosis-v19-latin-regular.woff2') format('woff2'),
url('../fonts/Dosis/dosis-v19-latin-regular.woff') format('woff'),
url('../fonts/dosis/dosis-v19-latin-regular.woff2') format('woff2'),
url('../fonts/dosis/dosis-v19-latin-regular.woff') format('woff'),
}

/* dosis-500 - latin */
Expand All @@ -26,8 +26,8 @@
font-style: normal;
font-weight: 500;
src: local(''),
url('../fonts/Dosis/dosis-v19-latin-500.woff2') format('woff2'),
url('../fonts/Dosis/dosis-v19-latin-500.woff') format('woff'),
url('../fonts/dosis/dosis-v19-latin-500.woff2') format('woff2'),
url('../fonts/dosis/dosis-v19-latin-500.woff') format('woff'),
}

/* dosis-700 - latin */
Expand All @@ -36,8 +36,8 @@
font-style: normal;
font-weight: 700;
src: local(''),
url('../fonts/Dosis/dosis-v19-latin-700.woff2') format('woff2'),
url('../fonts/Dosis/dosis-v19-latin-700.woff') format('woff'),
url('../fonts/dosis/dosis-v19-latin-700.woff2') format('woff2'),
url('../fonts/dosis/dosis-v19-latin-700.woff') format('woff'),
}

/* exo-2-300 - latin */
Expand All @@ -46,8 +46,8 @@
font-style: normal;
font-weight: 300;
src: local(''),
url('../fonts/Exo2/exo-2-v10-latin-300.woff2') format('woff2'),
url('../fonts/Exo2/exo-2-v10-latin-300.woff') format('woff'),
url('../fonts/exo2/exo-2-v10-latin-300.woff2') format('woff2'),
url('../fonts/exo2/exo-2-v10-latin-300.woff') format('woff'),
}

/*exo-2-regular - latin */
Expand All @@ -56,8 +56,8 @@
font-style: normal;
font-weight: 400;
src: local(''),
url('../fonts/Exo2/exo-2-v10-latin-regular.woff2') format('woff2'),
url('../fonts/Exo2/exo-2-v10-latin-regular.woff') format('woff'),
url('../fonts/exo2/exo-2-v10-latin-regular.woff2') format('woff2'),
url('../fonts/exo2/exo-2-v10-latin-regular.woff') format('woff'),
}

/* exo-2-500 - latin */
Expand All @@ -66,8 +66,8 @@
font-style: normal;
font-weight: 500;
src: local(''),
url('../fonts/Exo2/exo-2-v10-latin-500.woff2') format('woff2'),
url('../fonts/Exo2/exo-2-v10-latin-500.woff') format('woff'),
url('../fonts/exo2/exo-2-v10-latin-500.woff2') format('woff2'),
url('../fonts/exo2/exo-2-v10-latin-500.woff') format('woff'),
}

/* exo-2-700 - latin */
Expand All @@ -76,8 +76,8 @@
font-style: normal;
font-weight: 700;
src: local(''),
url('../fonts/Exo2/exo-2-v10-latin-700.woff2') format('woff2'),
url('../fonts/Exo2/exo-2-v10-latin-700.woff') format('woff'),
url('../fonts/exo2/exo-2-v10-latin-700.woff2') format('woff2'),
url('../fonts/exo2/exo-2-v10-latin-700.woff') format('woff'),
}

/*exo-2-300italic - latin */
Expand All @@ -86,8 +86,8 @@
font-style: italic;
font-weight: 300;
src: local(''),
url('../fonts/Exo2/exo-2-v10-latin-300italic.woff2') format('woff2'),
url('../fonts/Exo2/exo-2-v10-latin-300italic.woff') format('woff'),
url('../fonts/exo2/exo-2-v10-latin-300italic.woff2') format('woff2'),
url('../fonts/exo2/exo-2-v10-latin-300italic.woff') format('woff'),
}

/* exo-2-italic - latin */
Expand All @@ -96,8 +96,8 @@
font-style: italic;
font-weight: 400;
src: local(''),
url('../fonts/Exo2/exo-2-v10-latin-italic.woff2') format('woff2'),
url('../fonts/Exo2/exo-2-v10-latin-italic.woff') format('woff'),
url('../fonts/exo2/exo-2-v10-latin-italic.woff2') format('woff2'),
url('../fonts/exo2/exo-2-v10-latin-italic.woff') format('woff'),
}

/* exo-2-500italic - latin */
Expand All @@ -106,8 +106,8 @@
font-style: italic;
font-weight: 500;
src: local(''),
url('../fonts/Exo2/exo-2-v10-latin-500italic.woff2') format('woff2'),
url('../fonts/Exo2/exo-2-v10-latin-500italic.woff') format('woff'),
url('../fonts/exo2/exo-2-v10-latin-500italic.woff2') format('woff2'),
url('../fonts/exo2/exo-2-v10-latin-500italic.woff') format('woff'),
}

/* exo-2-700italic - latin */
Expand All @@ -116,8 +116,8 @@
font-style: italic;
font-weight: 700;
src: local(''),
url('../fonts/Exo2/exo-2-v10-latin-700italic.woff2') format('woff2'),
url('../fonts/Exo2/exo-2-v10-latin-700italic.woff') format('woff'),
url('../fonts/exo2/exo-2-v10-latin-700italic.woff2') format('woff2'),
url('../fonts/exo2/exo-2-v10-latin-700italic.woff') format('woff'),
}

/* iceberg-regular - latin */
Expand All @@ -126,8 +126,8 @@
font-style: normal;
font-weight: 400;
src: local(''),
url('../fonts/Iceberg/iceberg-v10-latin-regular.woff2') format('woff2'),
url('../fonts/Iceberg/iceberg-v10-latin-regular.woff') format('woff'),
url('../fonts/iceberg/iceberg-v10-latin-regular.woff2') format('woff2'),
url('../fonts/iceberg/iceberg-v10-latin-regular.woff') format('woff'),
}

/* ff-tisa-sans-web-pro-300 - latin */
Expand Down Expand Up @@ -172,7 +172,7 @@

/* ff-tisa-sans-web-pro-300italic - latin */
@font-face {
font-family: 'ff-tisa-sans-web-pro';
font-family: 'ff-tisa-sans-web-pro';
font-style: italic;
font-weight: 300;
src: url('https://use.typekit.net/xjz8xzq.css');
Expand Down
Binary file removed assets/fonts/Iceberg/iceberg-v10-latin-regular.ttf
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
60 changes: 60 additions & 0 deletions font-manager.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php
/**
* Font Manager plugin for WordPress.
*
* @see https://github.com/STH-Coders/font-manager/
*
* @author STHCoders <[email protected]>
* @copyright 2021-2022 STHCoders
* @license GPLv3 or later
*
* Plugin Name: Font Manager
* Description: A Simple Way to Host Google Fonts Locally & Reduce Page Load Speed.
* Version: 2.1.0
* Plugin URI: https://github.com/STH-Coders/font-manager/
* Author: STHCoders
* Author URI: https://www.linkedin.com/showcase/sthcoders/
*
* Portions copyright 2011-22 Michael Rehnert (@killshot13)
* Other portions copyright as indicated by authors in the relevant files
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
if (!defined('ABSPATH')) {
exit;
}

define('FONT_MANAGER_VERSION', '2.1.0');

// add or update plugin version to database.
function fm_font_save_manager_version()
{
$font_manager_version = get_option('font_manager_version');
if (!$font_manager_version) {
add_option('font_manager_version', FONT_MANAGER_VERSION);
} else {
update_option('font_manager_version', FONT_MANAGER_VERSION);
}
}

// primary function call
function font_manager_styles()
{
$fm_dir = dirname(__FILE__);
// Apply CSS in Turn
wp_enqueue_style('font_manager_css', "{$fm_dir}/assets/css/font-manager.css");
}
// Render Fonts Usable/Visible to WordPress/Browser
add_action('wp_enqueue_scripts', 'font_manager_styles');

0 comments on commit c8ea451

Please sign in to comment.