Speedtest Download 1.8

5.0
ph TheDoggyBrad Software Lab 11 months ago

•Component Name: Speedtest
•ID: speedtest
•Menu Name: OpenSpeedTest
•Author: TheDoggyBrad
•Description: Offer speedtest to your users, powered by OpenSpeedTest
•License: OSSN License v4
•Author URL: https://github.com/thedoggybrad/
•License URL: https://www.opensource-socialnetwork.org/licence/v4.0.html
•Latest Version: 1.8 (Available here on OSSN Website and on Github)
•Older Versions: 1.7, 1.6, 1.5.1, 1.5, 1.4, 1.3, 1.2, 1.1 and 1.0 (Available only on Github)
•Requires OSSN: version 5.6
•Tested up to: OSSN version 7.0

Alternate Download Link: https://github.com/thedoggybrad/speedtest-ossn/releases/download/1.8/speedtest.zip

Screenshot on a PC as of v1.7
This component is 100% stable and working in OSSN version 7.0. But, please always use the latest version to avoid any problems. By the way, the older versions are not maintained on this listing but they are available on my Github repository.

Note: I am willing to fix any problems related to this component, just please let me know.

Very Special Thanks to
https://www.opensource-socialnetwork.org/u/arsalanshah
https://www.opensource-socialnetwork.org/u/zetman

Comments
ph TheDoggyBrad Software Lab Replied 11 months ago

But I do think that it is fine to actually even I initially register it to everyone.

Since this line exists:

if (ossn_isLoggedin())

ph TheDoggyBrad Software Lab Replied 11 months ago

if(!ossnisLoggedin()) {
ossn
error_page();
}

Ah! this one. What should I do about the register you are saying?

ph TheDoggyBrad Software Lab Replied 11 months ago

Line 43 ({) and 57 (}) - Opening and Closing this:

$title = ossnprint('com:ossn:speedtest');
$contents['content'] = ossn
pluginview('pages/speedtest', array(
));
$content = ossn
setpagelayout('newsfeed', $contents);
echo ossnviewpage($title, $content);

German Michael Zülsdorff Replied 11 months ago

Next:
What are these strange curly braces on line 43 and 57 good for?

And:
Since you don't seem to want logged-off users to execute your speedtest page - why do you initially register that page for everyone?

If you would register that page for logged-in user only (as you did for the menu) you would not need that extra check inside your speedtest_pages function

ph TheDoggyBrad Software Lab Replied 11 months ago

Version 1.3 - Made the URL from https://example.com/speedtest/speedtest to just simply https://example.com/speedtest

Version 1.2 will be recalled to avoid user problems. But the older versions 1.0 to 1.2 will still be available on my Github repository.

ph TheDoggyBrad Software Lab Replied 11 months ago

Version 1.2 removes:
$guid = $pages;

and

switch($pages[0])
case 'speedtest':

And still results into a functional component.

ph TheDoggyBrad Software Lab Replied 11 months ago

Version 1.2
Fixes issues reported by https://www.opensource-socialnetwork.org/u/zetman

Version 1.1 has been taken down by me.

Thanks to @Michael Zülsdorff

German Michael Zülsdorff Replied 11 months ago

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

Then, let's go ahead and see what's still strange:
You coded: ossn_register_page('speedtest', 'speedtest_pages');

That is, whenever you enter https://somesite/speedtest in your browser, your accompanying function speedtest_pages() will be reliably executed.

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.

ph TheDoggyBrad Software Lab Replied 11 months ago

The original version 1.0 has been taken down by me just for you not to download the version with component naming issues.

ph TheDoggyBrad Software Lab Replied 11 months ago

Version 1.1 - Fixes unecessary passing of guid to ossnpluginview and component naming issues
Thanks to Michael Zülsdorff

Component

Developer: TheDoggyBrad
License ossnv4
Type: Third Party integrations
Requires Ossn Version : 7.0
Latest Version: 1.8
Last Updated 11 months ago
Repository Url View Repository

Versions