Hi Dima,
First, thanks for the response. Also, thanks for developing the plugin using templates, you have no idea how many plugin developers don’t do that! ??
I have to be honest, hiding warnings is not a solution, just a work-around. I can fix the problems in the templates, but no those in the widget.php file. Can I submit a PR to handles these properly?
I think what needs to be done is the following:
// here we get max products to know if current page is not too big
if ( $wp_rewrite->using_permalinks() and preg_match( "~/page/([0-9]+)~", $_POST['location'], $mathces ) or preg_match( "~paged?=([0-9]+)~", $_POST['location'], $mathces ) ) {
$args['paged'] = min( $mathces[1], $wp_query->max_num_pages );
$wp_query = new WP_Query( $args );
}
should be changed to:
if ($wp_rewrite->using_permalinks()
&& array_key_exists('location', $_POST)
&& (preg_match( "~/page/([0-9]+)~", $_POST['location'], $mathces )
|| preg_match( "~paged?=([0-9]+)~", $_POST['location'], $mathces ))
) {
$args['paged'] = min( $mathces[1], $wp_query->max_num_pages );
$wp_query = new WP_Query( $args );
}