Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Tests/Integration/inc/classes/ImagifyUser/getError.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ class Test_GetError extends TestCase {
* Test \Imagify\User\User->get_error() should return false when succesfully fetched user account data.
*/
public function testShouldReturnFalseWhenFetchedUserData() {
if ( empty( $this->getApiCredential( 'IMAGIFY_TESTS_API_KEY' ) ) ) {
$this->markTestSkipped( 'IMAGIFY_TESTS_API_KEY not available (fork PR limitation).' );
}

update_imagify_option( 'api_key', $this->getApiCredential( 'IMAGIFY_TESTS_API_KEY' ) );

// Verify the static $user property is null.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ public function testShouldReturnZeroWhenCouldNotFetchUserData() {
}

public function testShouldReturnQuotaWhenFetchedUserData() {
if ( empty( $this->getApiCredential( 'IMAGIFY_TESTS_API_KEY' ) ) ) {
$this->markTestSkipped( 'IMAGIFY_TESTS_API_KEY not available (fork PR limitation).' );
}

update_imagify_option( 'api_key', $this->getApiCredential( 'IMAGIFY_TESTS_API_KEY' ) );

// Verify the static $user property is null.
Expand Down
12 changes: 12 additions & 0 deletions Tests/Integration/inc/classes/ImagifyUser/isOverQuota.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public function testShouldReturnFalseWhenCouldNotFetchUserData() {
}

public function testShouldReturnFalseWhenPaidAccount() {
if ( empty( $this->getApiCredential( 'IMAGIFY_TESTS_API_KEY' ) ) ) {
$this->markTestSkipped( 'IMAGIFY_TESTS_API_KEY not available (fork PR limitation).' );
}

update_imagify_option( 'api_key', $this->getApiCredential( 'IMAGIFY_TESTS_API_KEY' ) );

// Verify the static $user property is null.
Expand All @@ -56,6 +60,10 @@ public function testShouldReturnFalseWhenPaidAccount() {
}

public function testShouldReturnFalseWhenFreeNotOverQuota() {
if ( empty( $this->getApiCredential( 'IMAGIFY_TESTS_API_KEY' ) ) ) {
$this->markTestSkipped( 'IMAGIFY_TESTS_API_KEY not available (fork PR limitation).' );
}

update_imagify_option( 'api_key', $this->getApiCredential( 'IMAGIFY_TESTS_API_KEY' ) );

// Verify the static $user property is null.
Expand All @@ -73,6 +81,10 @@ public function testShouldReturnFalseWhenFreeNotOverQuota() {
}

public function testShouldReturnTrueWhenFreeOverQuota() {
if ( empty( $this->getApiCredential( 'IMAGIFY_TESTS_API_KEY' ) ) ) {
$this->markTestSkipped( 'IMAGIFY_TESTS_API_KEY not available (fork PR limitation).' );
}

update_imagify_option( 'api_key', $this->getApiCredential( 'IMAGIFY_TESTS_API_KEY' ) );

// Verify the static $user property is null.
Expand Down
2 changes: 1 addition & 1 deletion assets/js/notices.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
preConfirm: function( inputValue ) {
return new Promise( function( resolve, reject ) {
setTimeout( function() {
$.get( ajaxurl + w.imagify.concat + 'action=imagify_signup&email=' + inputValue + '&imagifysignupnonce=' + $( '#imagifysignupnonce' ).val() )
$.get( ajaxurl + w.imagify.concat + 'action=imagify_signup&email=' + encodeURIComponent( inputValue ) + '&imagifysignupnonce=' + $( '#imagifysignupnonce' ).val() )
.done( function( response ) {
if ( ! response.success ) {
reject( response.data );
Expand Down
2 changes: 1 addition & 1 deletion assets/js/notices.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion classes/Bulk/Bulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ public function bulk_info_seen_callback() {
public function bulk_get_stats_callback() {
imagify_check_nonce( 'imagify-bulk-optimize' );

$folder_types = filter_input( INPUT_GET, 'types', FILTER_REQUIRE_ARRAY );
$folder_types = filter_input( INPUT_GET, 'types', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
$folder_types = is_array( $folder_types ) ? $folder_types : [];

if ( ! $folder_types ) {
Expand Down
18 changes: 18 additions & 0 deletions inc/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@
require_once IMAGIFY_PATH . 'vendor/autoload.php';
}

// Support Composer dependency install where Strauss prefixing hasn't run.
// Prefixed classes exist when installed as root package; unprefixed when installed as dependency.
if ( ! class_exists( 'Imagify\Dependencies\League\Container\Container', false ) ) {
if ( class_exists( 'League\Container\Container', false ) ) {
class_alias( 'League\Container\Container', 'Imagify\Dependencies\League\Container\Container' );
}
}
if ( ! interface_exists( 'Imagify\Dependencies\League\Container\ServiceProvider\ServiceProviderInterface', false ) ) {
if ( interface_exists( 'League\Container\ServiceProvider\ServiceProviderInterface', false ) ) {
class_alias( 'League\Container\ServiceProvider\ServiceProviderInterface', 'Imagify\Dependencies\League\Container\ServiceProvider\ServiceProviderInterface' );
}
}
if ( ! class_exists( 'Imagify\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider', false ) ) {
if ( class_exists( 'League\Container\ServiceProvider\AbstractServiceProvider', false ) ) {
class_alias( 'League\Container\ServiceProvider\AbstractServiceProvider', 'Imagify\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider' );
}
}

require_once IMAGIFY_PATH . 'inc/Dependencies/ActionScheduler/action-scheduler.php';

/**
Expand Down
Loading