I need help in developing my plugin

TheDoggyBrad Software Lab Posted in Component Development 1 year ago

Links first before the context:
https://github.com/thedoggybrad/thedoggybrad/tree/main/experiments/speedtest (Folder View)
https://github.com/thedoggybrad/thedoggybrad/raw/main/experiments/speedtest.zip (ZIP)

I have gained a copy of https://www.opensource-socialnetwork.org/component/view/5254/google then I modified it and attempted to make a speedtest thing based on the same code. Now, I have some problems or rather big problems. It does not work, just a gray screen. I just need some help. I am willing to give credits for those who can help me make this component work. I mean everything matches, I have reviewed the code but still was not able to fix it. Also, the icon does not work.

History before I go to the gray screen:
1.) Before I edited the code it says HTTP Error 404.
2.) After matching the values of each declarations and folders it just show a gray screen.

Hope that anyone can help me.

Lastly, I am using the OSSN v 7.0.

ph TheDoggyBrad Software Lab Replied 1 year ago

Why do this happens?
The reason is simple, I did not checked and cleanedup my code. I tend to remove elements or functionalities in my project and never removed the values it was assigned on, like my other web project that I discovered that my older now unused css codes (I used them before but replaced with a modern function) are there for almost a year without me noticing it and causing a waste of bandwidth to my users.

ph TheDoggyBrad Software Lab Replied 1 year ago

Thanks for applying the first fixes.
Still in place: that obsolete $guid = $pages; please remove it.

Finally removed this one.

So, why do you have that extra switch which is comparing again on 'speedtest' ?
A switch only makes sense if you are expecting different cases you need to handle.

This one has been also fixed.

ph TheDoggyBrad Software Lab Replied 1 year ago

Thanks. Immediately renamed the file and will release 1.1 also fixing the earlier issue about passing the guid to ossnpluginview which is unecessary.

German Michael Zülsdorff Replied 1 year ago

development isn't based on believing but exactly knowing what you do.
So please verify and update your component according to what I wrote.
Aside from that it's time to have a look into https://www.opensource-socialnetwork.org/wiki/view/739/naming-convention-for-components-and-themes
Using 'ossn' outside of the core system is a no-go, and you can be sure your component will be removed if you don't apply the necessary fixes.

ph TheDoggyBrad Software Lab Replied 1 year ago

I do believe it is a left over of my modification to the Google component plugin (https://www.opensource-socialnetwork.org/component/view/5254/google). And more likely that I have leftover values that are not used. If I have time I should better check if every value has a usage. It seems like that I do not remove values that are not used by any file or element.

German Michael Zülsdorff Replied 1 year ago

Ok, so next question:
Why are you passing that value of $guid to ossn_plugin_view at all?
(because I can't find any line in spte.php which is making use of it.)

ph TheDoggyBrad Software Lab Replied 1 year ago

@Michael Zülsdorff Thanks for that.

German Michael Zülsdorff Replied 1 year ago

I just wanted to help you understand your code, because it may lead to unexpected or even dangerous results if you don't.
So again: Why are you passing the value of one variable to another one?
That's like
1. you ordered a pair of BLUE JEANS from a webshop
2. but the postman (always in a hurry) delivered the parcel to your neighbour
3. and that neighbour (kind and honest enough) handed that parcel over to you.

Thus, in the end the BLUE JEANS is still the same BLUE JEANS, yes, but all in all it was a waste of time and resources.
From the aspect of developing that means: using more memory than needed and slowing down execution time.

ph TheDoggyBrad Software Lab Replied 1 year ago


ph TheDoggyBrad Software Lab Replied 1 year ago

Hey it works now!
enter image description here