[Soft Rejected] I can’t see what reviewer sees. Please help


#1

My recent item was soft rejected because of this issues: https://envato.d.pr/hYNjns. I checked in all and don’t find the issues. Could someone help me how to find this issues and get it fixed? Why am I not able to see this issues. I tried in fresh installation, installing test data, debugger enabled, installing all the themes plugins but no luck. Please somebody help me. Thnx


#2

Hi,

You could try to change your PHP version to 7.1 or to 5.6


#3

Make sure to enable wp debug and use this plugin https://wordpress.org/plugins/debug-bar/


#4

Yes we checked on PHP version 5.4 and latest, Wp-Debug is enabled, Debug-Bar plugin is installed still we don’t see this issues on our server. What other option would be the cause of this issues?


#5

You properly need to enable display errors with your php.ini config, Most shared hosting disable this.

BTW can you show me what code is in line #433 inside your nav walker class ?


#6

Just install the theme on a clean database with WP-debug enabled. You will see the same error messages. The menu you’re using is trying to print some output but when you don’t have anything on the menu, it throws error.


#7

This is what we have in the code: http://prntscr.com/jkm0a1


#8

We checked in fresh installation but still we dont see the error. Even when menu is not assigned.


#9

Do this on any line that uses $args->…

if( is_object( $args ) ) {
$item_output .= $args->before …
}


#10

Have you tried to install xdebug?


#11

Yea this might work. We will make these changes and re-submit it.


#12

*Not an official answer :slight_smile:

That type of error “notice trying to get property of non-object in…” appears when you are trying to get attributes of an object thinking it is an object, but in fact it is an array of objects.

So first you should access the array element, which is an object and only then access its attributes, like this, in your case: $args[0]->before

I think the error the reviewer sees is when there are no menus defined or no menus set for the location in Appearance->Menus

To fix it, you should always check first that a menu is defined, something like this:

if (has_nav_menu('primary')) {...

#13

I guess this solved the issues because I did not get any feedback on this issues:

But again soft rejected with the reason all Warning shown by Envato Theme Check plugin needs to be solved :frowning:
Question: Do we need to sanitize output variable which is already sanitized: http://prntscr.com/jkyrki


#14

Glad this helped :slight_smile:

From my experience I can say using echo $ is not allowed because you have to sanitize just before your output.
I think reviewers will do global search in your code for any echo $


#15

Use “print”