Can't understand what the reviewer means

emiluzelac (reviewer) is asking me something that I don’t understand, which is literally the following:

  1. How does theme white label safe file loading?


Basically what I am asking how do you prevent the unknown to load.

Do you guys know what I am missing here? What does he mean?

Thanks!

Your entire function is the same thing as:

require_once (get_template_directory() . ‘/includes/class-tgm-plugin-activation.php’);
require_once (get_template_directory() . ‘/includes/assembly_fields.php’);

Why would you use a foreach only for two files(to include two files)? Even if the function is ok the reviewer mentioned the fear of loading unknown files.

My suggestion is to include/require these files as per the lines above. Then you will pass this point from the rejection mail.

Have a great day

Ok I understand what you mean, however my entire function is no the same as two require_once, it is that way for a few justified reasons:

  1. Safety: I am actually validating for the “unknown” with file_exists(), I am phisically checking if the file actually exists in the filesystem, there’s no place for the “unknown” here at all. It is the safest check within the current context. Would ever file_exists return true for a wrong or misspelled path?

  2. Reusability: The function is part of my framework, this way I can keep adding files to the list for future themes, and the logic for processing every file won’t be duplicated and will be less susceptible to errors, imagine if in the future the array of files reaches 20 items, I would need to duplicate 20 times any logic for processing / validating each file. This way I can have a single place (within the foreach) to manipulate or process or validate the files, instead of duplicating the entire logic for each file 20 times, which is against all coding standards and principles.

I am a software engineer and I have been programming for 17 years now, I know what I am doing. The point is unnecessary, nonsense and unjustified, not yours but his.

I see your point ThemeSLR your suggestion is to simply get over it and make the reviewer happy, and I appreciate that, but I refuse to contribute to a digital dictatorship, in which you have to look down with no chance to stand up for your rights and say your own word, when you really have a reason, and be punished if you dare.

I totally understand the pain here. But having a past experience with reviewers, for example Envato WordPress requirements does not give a thing for WordPress codex documentation, workflow…etc

I’m not saying your way to do that is wrong but this is their marketplace… They make the rules.

If you resubmit your item, you can explain your point of view regarding that function. If the reviewers understands you, you will pass the revoew tests.

Regards

1 Like

Thank you so much for your response, are you suggesting me to simply re-submit my item as it is now along with my justifications and see if he sees my point and pass that review point?

I agree with that, but my last two resubmissions took almost 3 days each one, this means if I dare to be courageous enough to simply not obey those nonsense rules and try to justify my point I will be risking potentially 6 more days of waiting in the uncertainty, which brings me back to your first suggestion of simply amend those lines and make him happy.

I guess logic tells me to keep my inner “super hero” away from saving the world and accept and obey the rules, despite it is a way of slavery and totally against my moral rights, we shall obey.

This is a very clever bit of code and would be very useful if you were selling the theme to a single client but it may not be best for multiple customers.

Lets say a customer copies the theme to their server but all the required files are not copied. With your code the theme will activate correctly and the user will think everything is good because they won’t get the fatal error. When they start to use the theme and see that some things are not working they will think the theme is faulty and leave a bad review.

If you want to use this function you will need another check to verify that all the required files are actually loaded after activation.

Thank you for your insight, I see what you mean, but how are those required files more important than “functions.php” or “index.php” for instance? Any file or folder within the theme is susceptible to not to be copied, and the theme will crash if that is the case.

The files belong to the theme and they are inside a theme folder, that seems a very unique case scenario. I cannot imagine a customer risking to copy only certain folders and if that is the case, the theme will crash anyway later on execution, since those files are equally required.

I cannot see why such a case is relevant, a user could eventually forget to copy any other folder of file and as I said the theme will crash anyway.

I think that’s what the reviewer is asking you. Your theme should throw some error if it’s missing required files. If you remove class-tgm-plugin-activation.php from the includes directory will your theme indicate that this file is missing and is necessary for the theme to function correctly?

I know the scenario may seem far-fetched but I’ve seen it a few times especially with those cheap hosting packages.