Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+10 votes
1.3k views
in Q2A Core by

I couldn't help noticing how little are people (users/admins/developers/me) involved in testing newly released versions of Q2A. The more people who test, the faster releases are created and the more quality they have. I also noticed many people take but very few people give. I hope I could be proven wrong.

Feature requests have 121 answers (up to now): http://www.question2answer.org/qa/31514 . This means around 100 different users. I wonder how many of them/us are willing to spend some time in helping with the testing. There is only one way to find this out.

I did some coding today that might be merged to the core. The changes are relatively minor:

  1. Plugin, themes and language files now have a metadata.json file that contains the metadata (name, version, author, etc) of the addon
  2. The core will try to fetch data from them first and then, if the files are not found, will fall back to the qa-plugin.php (for plugins) and qa-styles.css (for themes). Language files didn't use to have metadata up to version 1.7-beta-1 in which the metadata.php file was added but this change will replace it.
  3. Plugins and Themes are now sorted alphabetically by name rather than directory name. This also tries to take the data from the metadata.json file and, if not there, then the appropriate file is fetched.

This should simplify plugin metadata processing and should mean a faster processing as less regular expressions will be needed to be compiled to parse the files that are loaded in every request to the server.

So I was wondering if someone was interested in testing these changes. The testing should answer questions such as, but not limited to:

  1. If metadata.json files for themes and plugins are not found, are metadata fields taken from the qa-plugin.php or qa-styles.css files?
  2. Are metadata.json files being properly fetched from an update URL? For example, you can download this plugin https://github.com/pupi1985/q2a-random-avatar which already has metadata support. Once you download it, in the metadata.json file, change the version from 1.0.1 to 1.0.0. If when browsing the plugins section, the plugin claims there is a newer version to download the tests succeeeds
  3. Similarly to previous question, does the system also work for themes? This one you can use the metadata.json file I added to the branch itself, which is here https://raw.githubusercontent.com/pupi1985/question2answer/patch-45/qa-theme/SnowFlat/metadata.json . Again, the logic is the same as in previous item: you have to download the file and decrese the version to 1.3 so that the update is fired. Also you'll have to set the "update" item in the metadata.json file to the link I've just pasted so that it can find the online metadata.json file with the 1.4 version
  4. Are plugins ordered by directory name or plugin name?
    1. What happens if the metadata.json file is not found? Are plugins sorted by the name in qa-plugin.php?
    2. What happens if a plugin name is empty ("")?
    3. What happens if the plugin line witht he "name" is removed from the metadata.json file?
  5. What is the answer to the same questions in the previous item but this time for themes and qa-styles.css files? This one refers to the combobox in the admin/general section with the list of themes
  6. Are languages displayed with the appropriate name in the combobox admin/general section? They can be tested by using the qa-lang/en-GB directory and the metadata.json in it
    1. Does changing the metadata.json file "display_name" key change the display name in the combo too?
    2. Are languages affected in any way if the folder in which they reside is renamed?

How to test this branch (https://github.com/pupi1985/question2answer/commits/patch-45):

  1. Backup your current Q2A files (actually you should test this in a testing environment... so this step shouldn't be performed at all, right?)
  2. Replace them with the ones  you can download in the zip file here https://github.com/pupi1985/question2answer/tree/patch-45 . Note no database upgrade will be performed
  3. Test them answering the questions and try to break things :)
  4. Take note of the answers to the questions and questions you formulate yourself and add them here
  5. Restore your original Q2A files (again, this should be unnecessary)

I started the chain. Let's see if someone else continues it :)

Q2A version: 1.7-beta-1
by
nice one! =)
by
@Pupi this is great news, I have always been there for testing, paying and anything I could do, I am just so so swamped right now as all of the sadden I lost my job and have to prepare for interviews. but the moment i get a new job I will be back for testing or anything I can.
Great initiative!
by
Thanks guys.
@Waterfr Villa I'm sad to hear that. Feel free to be excused from this one. Best of luck on the interviews! :)

1 Answer

+2 votes
by
edited by

Can't say about everyone but I am certainly going to test your changes. I'll test it on my test site and will show you the changes that happen and try to answer every question you asked above.

I am not a developer but this can be my contribution to q2a.

 

After Testing

  1. I don't know how check whether metadata fields are taken from the qa-plugin.php or qa-styles.css files
  2. Metadata file in plugin is detected see in the pic below

          3. I don't think your change is catching metadata file for theme. See the pic below

           4. Plugins are all ordered by name, whether they are having metadata file or not

           5. All themes are also ordered alphabetically

           6. Don't know how to test this one, but everything seems to be good for this section on my site.

by
"I am not a developer but this can be my contribution to q2a" -> That is exactly the attitude most users should have :) Answering your questions:

1. The trick here is to change the values in those 3 files. Firstly, metadata.json files will be looked for (they're already there). If not found the qa-plugin.php file in plugins will be searched. Now, if you change the name (or any other value) from metadata.json from X to Y you should see Y, regardless of the value in qa-plugin.php, which should be X. If you remove metadata.json file, as it is not found, you should see X as it is taking it from a the qa-plugin.php file (old way). Same thing with qa-styles.css. Just change the values and remove metadata.json files

3. I see v1.3 so you have changed the metadata.json version key properly. But have you changed the "update" key to the link I've provided? I noticed core plugins/theme do not have "by default" the update key set so I didn't add it to use the same logic. That's why you have to manually add it. Make sure it is there and try again.

6. This one is actually the easiest to test :) In the default installation you'll find English UK (the one you've set in the screenshot). Browse to the qa-lang/en-GB directory. In there you'll find the metadata.json file. The text should be the one in the combo. Does changing it also change the combo? What if the whole "display_line" is not there and there is only curly braces? What if the file is empty? What if the file is not there? Does changing the directory name from en-GB into es-AR make any difference at all? Just some ideas.

Thanks for taking the time to test this :)
...