<span class="resolved" aria-label="Resolved" title="Topic is resolved."></span>Suggestion to developers

[ad_1]

Replies: 3

Hi,

In order to avoid this kind of errors:

CRITICAL Uncaught TypeError: get_object_vars(): Argument #1 ($object) must be of type object, null given in /all-my-forlders/wp-content/plugins/wordpress-popup/inc/front/hustle-module-front-ajax.php

I have taken the habit of modifying the function module_viewed(), in /inc/front/hustle-module-front-ajax.php, like that:

public function module_viewed() {
		$data = json_decode( file_get_contents( 'php://input' ) );
		if ($data != NULL) {
		$data = get_object_vars( $data );
		}
		//   $data = get_object_vars( $data );

Could this simple check be incorporated into the plugin, please ?
Thanks a lot.
Best regards

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer