Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blocked access to api.freemius.com just fails without notice #684

Open
evrpress opened this issue Jan 17, 2024 · 4 comments
Open

Blocked access to api.freemius.com just fails without notice #684

evrpress opened this issue Jan 17, 2024 · 4 comments

Comments

@evrpress
Copy link

馃悶 bug report

Behavior:

  • What is the issue? (*)
    Some hosts block requests to other domains for "security" reasons. This happens with api.freemius.com as well. The problem is that there's no visual feedback on the actication screen so users have no idea what's going on.

In this video I block access to api.freemius.com:

s26NH5.mp4
  • What is the expected behavior?

An error message should show up explaining that access to api.freemius.com is needed for activation and updates

Versions: (*)

  • Freemius SDK Version: 2.6.2
  • WordPress Version: 6.4.2
  • PHP Version: 8.2
@evrpress
Copy link
Author

The problem causes a Fatal Error (at least on new PHP versions)

PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, false given in /wp-content/plugins/mailster/vendor/freemius/wordpress-sdk/includes/class-freemius.php:19985

@evrpress
Copy link
Author

Use this snippet for a quick test:

add_filter(
	'pre_http_request',
	function ( $bool, $r, $url ) {

		if ( false !== strpos( $url, '//api.freemius.com' ) ) {
			return new WP_Error( 'http_blocked', esc_html__( 'A valid URL was blocked.' ) );
		}

		return $bool;
	},
	100,
	3
);

@flowdee
Copy link

flowdee commented Jan 17, 2024

+1 to fix

@vovafeldman
Copy link
Contributor

We obviously have error handling in place. I'm unsure why the error wasn't triggered. The team will try to reproduce it and fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants