Skip to content

Commit

Permalink
1.2.1 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
stooit committed Jun 8, 2021
1 parent c25e2dd commit 603965c
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 16 deletions.
13 changes: 4 additions & 9 deletions plugins/quant/quant.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: QuantCDN static edge integration
* Author: Stuart Rowlands
* Plugin URI: https://www.quantcdn.io
* Version: 1.1.0
* Version: 1.2.1
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
Expand Down Expand Up @@ -63,13 +63,8 @@ function quant_wp_batch_processing_init() {
Quant_WP_Batch_Processor::get_instance()->register( $batch );
$batch = new QuantHomeBatch();
Quant_WP_Batch_Processor::get_instance()->register( $batch );

$seedOptions = get_option(QUANT_SEED_KEY);
if ($seedOptions['theme_assets']) {
$batch = new QuantThemeAssetsBatch();
Quant_WP_Batch_Processor::get_instance()->register( $batch );
}

$batch = new QuantThemeAssetsBatch();
Quant_WP_Batch_Processor::get_instance()->register( $batch );
$batch = new QuantCustomRoutesBatch();
Quant_WP_Batch_Processor::get_instance()->register( $batch );
$batch = new QuantArchivesBatch();
Expand Down Expand Up @@ -135,4 +130,4 @@ function quant_include_validation_template( $template ) {
}

return $template;
}
}
6 changes: 5 additions & 1 deletion plugins/quant/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: static, jamstack, cdn, quant, static site generator
Requires at least: 4.6
Tested up to: 5.7.2
Requires PHP: 7.2
Stable tag: 1.2.0
Stable tag: 1.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -55,6 +55,10 @@ Follow the [Forms documentation](https://docs.quantcdn.io/docs/dashboard/forms)

== Changelog ==

= 1.2.1 =
* New feature: Additional support for relative asset rewriting.
* Simplified settings screen.

= 1.2.0 =
* New feature: Improved support for Elementor.
* New feature: Support seeding entire media library.
Expand Down
Empty file modified plugins/quant/src/App.php
100644 → 100755
Empty file.
10 changes: 10 additions & 0 deletions plugins/quant/src/Client.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ class Client
{

private $settings;
private $seedOptions;
private $headers = [];
private $endpoint;
private $webserver;
private $host;

public function __construct() {
$this->settings = get_option(QUANT_SETTINGS_KEY);
$this->seedOptions = get_option(QUANT_SEED_KEY);
$this->webserver = $this->settings['webserver_url'];
$this->host = $this->settings['webserver_host'];
$this->endpoint = $this->settings['api_endpoint'] . '/v1';
Expand Down Expand Up @@ -390,6 +392,14 @@ public function absoluteToRelative($markup, $host) {
$markup = preg_replace("/http(s?)\:\/\/{$host}\:{$port}/i", '', $markup);
$markup = preg_replace("/http(s?)\:\/\/{$host}/i", '', $markup);

// Allow additional domain rewrites for relative paths.
$stripDomains = explode("\n", $this->seedOptions['domains_strip']);
foreach ($stripDomains as $domain) {
$d = trim($domain);
$markup = preg_replace("/http(s?)\:\/\/{$d}\:{$port}/i", '', $markup);
$markup = preg_replace("/http(s?)\:\/\/{$d}/i", '', $markup);
}

return str_replace(get_site_url(), '', $markup);
}

Expand Down
Empty file modified plugins/quant/src/Field.php
100644 → 100755
Empty file.
12 changes: 6 additions & 6 deletions plugins/quant/src/Settings.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,6 @@ public static function register()

add_settings_section('seed', 'Seed content', '__return_empty_string', $seedKey);

add_settings_field('seed_theme_assets', 'Theme assets', ['Quant\Field', 'checkbox'], $seedKey, 'seed', [
'name' => "{$seedKey}[theme_assets]",
'description' => 'Additional theme assets (fonts, images, js)',
'value' => $seedOptions['theme_assets'] ?? 0,
]);

add_settings_field('seed_404_route', '404 path', ['Quant\Field', 'text'], $seedKey, 'seed', [
'name' => "{$seedKey}[404_route]",
'description' => 'Route to use for 404 error pages',
Expand All @@ -108,6 +102,12 @@ public static function register()
'value' => $seedOptions['custom_routes'] ?? '/robots.txt',
]);

add_settings_field('seed_domains_strip', 'Relative rewrite', ['Quant\Field', 'textarea'], $seedKey, 'seed', [
'name' => "{$seedKey}[domains_strip]",
'description' => 'Optional domains (e.g www.example.com) to rewrite as relative',
'value' => $seedOptions['domains_strip'] ?? '',
]);


/**
* Cron settings fields
Expand Down
Empty file modified plugins/quant/src/SettingsScreen.php
100644 → 100755
Empty file.
Empty file modified plugins/quant/src/functions.php
100644 → 100755
Empty file.

0 comments on commit 603965c

Please sign in to comment.