-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jono
committed
Dec 21, 2022
1 parent
e3e61d1
commit ac8989a
Showing
21 changed files
with
177 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
<?php | ||
/** | ||
* Edge Images plugin file. | ||
* | ||
* @package Edge_Images | ||
*/ | ||
|
||
namespace Edge_Images; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
<?php | ||
/** | ||
* Edge Images plugin file. | ||
* | ||
* @package Edge_Images | ||
*/ | ||
|
||
namespace Edge_Images; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
<?php | ||
/** | ||
* Edge Images plugin file. | ||
* | ||
* @package Edge_Images | ||
*/ | ||
|
||
namespace Edge_Images; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
<?php | ||
/** | ||
* Edge Images plugin file. | ||
* | ||
* @package Edge_Images | ||
*/ | ||
|
||
namespace Edge_Images; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
<?php | ||
/** | ||
* Edge Images plugin file. | ||
* | ||
* @package Edge_Images | ||
*/ | ||
|
||
namespace Edge_Images; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?php | ||
// Silence is golden. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?php | ||
// Silence is golden. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?php | ||
// Silence is golden. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?php | ||
// Silence is golden. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,50 @@ | ||
<?php | ||
// Prevent direct access | ||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; | ||
/** | ||
* Edge Images plugin file. | ||
* | ||
* @package Edge_Images\Views | ||
*/ | ||
|
||
namespace Edge_Images\Views; | ||
|
||
// Avoid direct calls to this file. | ||
if ( ! defined( 'EDGE_IMAGES_VERSION' ) ) { | ||
header( 'Status: 403 Forbidden' ); | ||
header( 'HTTP/1.1 403 Forbidden' ); | ||
exit(); | ||
} | ||
?> | ||
|
||
<div class="wrap"> | ||
|
||
<h1>Edge Images</h1> | ||
|
||
<form method="post" action="options.php"> | ||
<input type="hidden" name="option_page" value="edge_images"> | ||
<input type="hidden" name="action" value="update"> | ||
|
||
<input type="hidden" id="_wpnonce" name="_wpnonce" value="XXXXXX"> | ||
<input type="hidden" name="_wp_http_referer" value="XXXX"> | ||
|
||
<table class="form-table" role="presentation"> | ||
<tbody> | ||
<tr> | ||
<th scope="row"><label for="edge_provider">Edge Provider</label></th> | ||
<td> | ||
<select id="edge_provider" name="edge_provider"> | ||
<option>- None -</option> | ||
<option>Cloudflare</option> | ||
<option>Accelerated Domains</option> | ||
</select> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<p class="submit"> | ||
<input type="submit" name="submit" id="submit" class="button button-primary" value="Save Changes"> | ||
</p> | ||
|
||
</form> | ||
<h1>Edge Images</h1> | ||
|
||
<form method="post" action="options.php"> | ||
|
||
<input type="hidden" name="option_page" value="edge_images"> | ||
<input type="hidden" name="action" value="update"> | ||
|
||
<input type="hidden" id="_wpnonce" name="_wpnonce" value="XXXXXX"> | ||
<input type="hidden" name="_wp_http_referer" value="XXXX"> | ||
|
||
<table class="form-table" role="presentation"> | ||
<tbody> | ||
<tr> | ||
<th scope="row"><label for="edge_provider">Edge Provider</label></th> | ||
<td> | ||
<select id="edge_provider" name="edge_provider"> | ||
<option>Cloudflare</option> | ||
<option>Accelerated Domains</option> | ||
</select> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<p class="submit"> | ||
<input type="submit" name="submit" id="submit" class="button button-primary" value="Save Changes"> | ||
</p> | ||
|
||
</form> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?php | ||
// Silence is golden. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,54 @@ | ||
<?php | ||
|
||
namespace Edge_Images; | ||
|
||
/** | ||
* Edge Images | ||
* | ||
* @package Edge_Images | ||
* @copyright Copyright (C) 2008-2022, Yoast BV - [email protected] | ||
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3 or higher | ||
* | ||
* @wordpress-plugin | ||
* Plugin Name: Edge Images | ||
* Version: 3.1 | ||
* Description: Provides support for Cloudflare's images transformation service. | ||
* Description: Provides support for transforming images on the edge, via Cloudflare or Accelerated Domains. | ||
* | ||
* Author: Jono Alderson | ||
* Author URI: https://www.jonoalderson.com | ||
* Plugin URI: https://www.jonoalderson.com/plugins/edge-images/ | ||
* Donate link: https://www.jonoalderson.com | ||
* Contributors: jonoaldersonwp | ||
* | ||
* Version: 3.2 | ||
* Requires at least: 6.0 | ||
* Tested up to: 6.1.1 | ||
* Stable tag: 3.1 | ||
* Requires PHP: 7.4 | ||
* | ||
* Text Domain: edge-images | ||
* Tags: images, cloudflare, accelerated domains, performance | ||
* | ||
* 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, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
namespace Edge_Images; | ||
|
||
// Prevent direct file access. | ||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; | ||
} | ||
|
||
// Set our constants. | ||
if ( ! defined( 'EDGE_IMAGES_VERSION' ) ) { | ||
define( 'EDGE_IMAGES_VERSION', '3.1' ); | ||
define( 'EDGE_IMAGES_VERSION', '3.2' ); | ||
} | ||
|
||
if ( ! defined( 'EDGE_IMAGES_PLUGIN_DIR' ) ) { | ||
|
@@ -113,8 +144,8 @@ function get_edge_image( int $id, array $atts = array(), $size = 'large', bool $ | |
// Construct the <img>, and wrap it in a <picture>. | ||
$html = $image->construct_img_el( true ); | ||
|
||
// Echo the image. | ||
if ( $echo ) { | ||
// Echo the image. | ||
echo Helpers::sanitize_image_html( $html ); | ||
return; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters