Skip to content

Commit

Permalink
Merge pull request #1 from asadmanzoor93/develop
Browse files Browse the repository at this point in the history
Add priority settings variables for configurations
  • Loading branch information
AsadDevAI authored Jan 19, 2023
2 parents e24b550 + 78d8b5b commit 96950ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
9 changes: 6 additions & 3 deletions includes/class-wp-imgix.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ private function setup()
if (!function_exists('imgix_url'))
return;

$this->builder = new UrlBuilder(WP_IMGIX_URL);
$WP_IMGIX_URL = get_option('WP_IMGIX_URL') ? get_option('WP_IMGIX_URL') : WP_IMGIX_URL;
$WP_IMGIX_SIGNING_TOKEN = get_option('WP_IMGIX_SIGNING_TOKEN') ? get_option('WP_IMGIX_SIGNING_TOKEN') : WP_IMGIX_SIGNING_TOKEN;
$this->builder = new UrlBuilder($WP_IMGIX_URL);
if (defined('WP_IMGIX_SIGNING_TOKEN')) {
$this->builder->setSignKey(WP_IMGIX_SIGNING_TOKEN);
$this->builder->setSignKey($WP_IMGIX_SIGNING_TOKEN);
}


Expand Down Expand Up @@ -812,7 +814,8 @@ public function filter_srcset_array($sources, $size_array, $image_src, $image_me

// If the image_src is a imgix url, add it's params
// to the srcset images too.
if (strpos($image_src, WP_IMGIX_URL) === 0) {
$WP_IMGIX_URL = get_option('WP_IMGIX_URL') ? get_option('WP_IMGIX_URL') : WP_IMGIX_URL;
if (strpos($image_src, $WP_IMGIX_URL) === 0) {
parse_str(parse_url($image_src, PHP_URL_QUERY), $image_src_args);
$args = array_merge($args, array_intersect_key($image_src_args, ['crop' => true]));
}
Expand Down
7 changes: 4 additions & 3 deletions wp-imgix.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
/**
* Plugin Name: WP ImgIX
* Version: 0.12.6
* Description: Simple Wordpress ImgIX integration
* Description: Simple WordPress ImgIX integration
* Author: Ryan Soury | Web Doodle
* Author URI: https://www.webdoodle.com.au/
*/

if (!defined('WP_IMGIX_URL') || !WP_IMGIX_URL) {
return;
$WP_IMGIX_URL = get_option('WP_IMGIX_URL') ? get_option('WP_IMGIX_URL') : WP_IMGIX_URL;
if (!defined('WP_IMGIX_URL') || !$WP_IMGIX_URL) {
return;
}

require_once dirname(__FILE__) . '/vendor/autoload.php';
Expand Down

0 comments on commit 96950ca

Please sign in to comment.