0.8.2 (BETA)

Post Reply
MassIV
Posts: 9
Joined: Mon Aug 04, 2014 7:05 am

0.8.2 (BETA)

Post by MassIV »

Found one of the reasons why people might be getting a 403.
It is a conflict between virtual url and actual url. Making a menu item called 'gallery' shows as www.example.com/gallery/ (note the last slash) if there is a folder in the root called 'gallery' (or even 'gallery01'). The new menu item will be trying to open an actual folder.

Also if you want plugins to use url to know where they are then it would be nice to have url defined in index.php

$url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];

That way you can php include based on a strpos if statement. Instead of loading everything and then hiding it with Jquery.
Also, in that case root and home should have the same url.

Many plugins that have been out there for a while run on older versions of jquery.min.js
Running 7 (most common) would make it a lot easier. And 8 is probably even compatible with your current version of editText plugin.
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: 0.8.2 (BETA)

Post by wiz »

Hello MassIV. I think that this one of the first reports for receiving 403 pages.

The problem might be in how WonderCMS handles pages/content, I'll try to explain briefly.

You add a new page in your settings menu.
1. If we get to the bare core of WonderCMS, even before .htaccess kicks in, all URL's would work like: http://example.com/index.php?page=PAGENAME.
2. PAGENAME (entered in your menu), gets saved in the /files/ folder as PAGENAME.
3. .htaccess makes the URL's cleaner: http://example.com/PAGENAME.
4. The menu function works adds <li><a href='PAGENAME'>PAGENAME</a></li> to the menu (between <ul></ul>).

I see how any folder that has the same PAGENAME would redirect to that (already existing) folder from your WonderCMS menu, and not to the actual page.
One way of solving this would be to take out the clean URL functionality, and changing the menu output from

Code: Select all

<li><a href='PAGENAME'>PAGENAME</a></li>
to

Code: Select all

<li><a href='index.php?page=PAGENAME'>PAGENAME</a></li>
The actual hostname is meant to be completely relative and domain independent, so WonderCMS defines its "root" wherever it's installed.
The menu has to be re-structured to create a folder for each page (so each page could have its own SEO settings and so on), but nobody has tackled this issue yet.

Thank you for the jQuery suggestion. If I understand correctly you suggest using version "jquery-1.7.2.min.js"?
I also found this, which might help with the discussion: http://blog.jquery.com/2014/01/14/jquer ... ot-served/.

A couple of questions:
1. Can you post the link to your website?
2. What version of PHP is your website running?
3. Have you made any changes to the .htaccess (or any other file)?

In some cases, .htaccess forces a 403 page when there aren't proper permissions. .htaccess also makes directories display a 403 error, which is probably the case with your website. However I would need more information to understand why renaming your gallery to gallery01 still isn't giving our the right results.
MassIV
Posts: 9
Joined: Mon Aug 04, 2014 7:05 am

Re: 0.8.2 (BETA)

Post by MassIV »

The problem might be in how WonderCMS handles pages/content
I thought i had seen another 403 topic, but i can't find it back.
What you described was indeed what i ran into. I worked around it by moving folders like gallery and images to a subfolder that is unlikely to be used for a menu item.
If I understand correctly you suggest using version "jquery-1.7.2.min.js
Something like that (think 2 of them are 1.7.1), but i need to spend a little more time looking into that. For now i worked around it by loading versions based on login status.
But how do your options look
Can you post the link to your website?
I can pm you.
What version of PHP is your website running?
php-5.3
Have you made any changes to the .htaccess (or any other file)?
Not to .htaccess. And i tested with a clean install of 0.8.2. All changes to index.php are mostly just added code, support for plugins.

I would need more information to understand why renaming your gallery to gallery01 still isn't giving our the right results.
You and me both. In the beginning i was messing around, mixing cms versions and js versions. The first two pages i tried to make were gallery and contact. Which resulted in the directory 403. After that, even with a new install on a clean server, and remaking them they keep being messed up. Now that i restructured some folders (of mine) they redirect properly but the text editor is weird. It's like they are somehow still in an array, and structured like the subside or something. When you edit them the wrapper is proper size but the editor is the size of the subside.


I'd also like to suggest variables to be more unique. E.g. instead of $title something like $w_title. So they won't accidentally be made as menu items. Though if things have their own folder in files, that would be less likely already.

Time for bed.
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: 0.8.2 (BETA)

Post by wiz »

MassIV wrote:
The problem might be in how WonderCMS handles pages/content
I thought i had seen another 403 topic, but i can't find it back.
What you described was indeed what i ran into. I worked around it by moving folders like gallery and images to a subfolder that is unlikely to be used for a menu item.
If I understand correctly you suggest using version "jquery-1.7.2.min.js
Something like that (think 2 of them are 1.7.1), but i need to spend a little more time looking into that. For now i worked around it by loading versions based on login status.
But how do your options look
Can you post the link to your website?
I can pm you.
What version of PHP is your website running?
php-5.3
Have you made any changes to the .htaccess (or any other file)?
Not to .htaccess. And i tested with a clean install of 0.8.2. All changes to index.php are mostly just added code, support for plugins.

I would need more information to understand why renaming your gallery to gallery01 still isn't giving our the right results.
You and me both. In the beginning i was messing around, mixing cms versions and js versions. The first two pages i tried to make were gallery and contact. Which resulted in the directory 403. After that, even with a new install on a clean server, and remaking them they keep being messed up. Now that i restructured some folders (of mine) they redirect properly but the text editor is weird. It's like they are somehow still in an array, and structured like the subside or something. When you edit them the wrapper is proper size but the editor is the size of the subside.


I'd also like to suggest variables to be more unique. E.g. instead of $title something like $w_title. So they won't accidentally be made as menu items. Though if things have their own folder in files, that would be less likely already.

Time for bed.
I tested out the problem with the gallery and gallery01 and could not repeat the problem, so I'm guessing it was probably just a temporary bug.

I found more information on the jQuery versions usage popularity (from this source).
Version 1.11 usage: 20.5% (which is the version in the latest beta, which means we have the most popular and likely cached version).
Version 1.7 usage: 19.2%

The WYSIWYG editor is still buggy and requires some work to be done.
I found the website prior to receiving the PM and I was amazed. Beautifully done.
P.S. Your contact form doesn't appear to work (The following errors occured: You must enter a valid email.) The email is valid from my side.
MassIV
Posts: 9
Joined: Mon Aug 04, 2014 7:05 am

Re: 0.8.2 (BETA)

Post by MassIV »

jQuery versions
Yes their usage is close and 11 wins. My point was that there is more old code floating in the wild to port.
Which led me to wonder if you needed something specific from 11? The way i was thinking was if it's not a lot of work and 11 was not chosen for the user but the cms then 11 could run in noConflict mode, leaving the user free to use plugins on any version they want.
But, either way it's not something one can't work around.
Your contact form doesn't appear to work
Did you set an email (to send to) in settings? As the form reads from /file and not from the preset variable.
Since i don't know the email you tried (in the form, as sender), can you spot where your email would trip?
http://pastebin.com/4EjaqbTV
The WYSIWYG editor is still buggy and requires some work to be done.
Can you be more specific on eta or where to start looking? Do you know of compatible alternatives that have source available? To have a peak under the hood..
I found the website prior to receiving the PM and I was amazed. Beautifully done.
:D Thnx. Just trying to see if i can make it do the things i need it to do. Still a couple of things i don't know the best solution to.
Like i currently have a gallery script which check the url and grabs from a corresponding folder. In the theme it includes based on a hardcoded name. But how to make that a straight forward end user option in settings? Don't think adding something to the menu name is a good solution. Buttons would also be a bit weird in that field, ect, ect.
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: 0.8.2 (BETA)

Post by wiz »

There is nothing specific from the 1.11 jQuery library that WonderCMS needs. Was this library giving you any issues from the start (if so, which ones)?
Did your jQuery library conflict because you needed another library (in this case, I'm interested what made you switch to another library).
Is 1.7 the best version in your opinion, or did I misunderstand your proposal?

And like you said, the workaround:

Code: Select all

<script src="jquery.js"></script> //lets say this is the current WonderCMS jQuery version
<script>
$.noConflict();
// Code that uses other library's $ can follow here.
</script>
The email was set when I checked. Right now I tried out the contact form again, this time it succeeded without a single problem, twice.

Unfortunately, I can not give out any ETAs, since its not up to anyone but the WonderCMS community to make the best of plugins and themes.
I personally think the (existing) buggy plugin is the best path to go (to download and look into it), since its probably the only WYSIWYG that even partially works (thanks to Luka Mrovlje).

As you have probably noticed by now, WonderCMS plugins work on so called "hooks". Check rte.php, which contains the content of the actual plugin.
Additional hooks will be implemented in the future as WonderCMS evolves.

At this stage, hard-coding it (like you did) is the best approach. This problem will be solved with the revamped files structure, which will allow you to support multiple custom content types by plugins.

The end user will not have to do anything, because they will be just adding custom elements to pages. The custom elements will be handled by the corresponding plugin.
MassIV
Posts: 9
Joined: Mon Aug 04, 2014 7:05 am

Re: 0.8.2 (BETA)

Post by MassIV »

Went over the differences, nothing that should cause my issues (besides 1.7.1 plugins not working). Then managed to resolve both (also width of editor) problems by starting over a second time and moving my changes one by one. Whatever the problem actually was led me to believe the conflicting versions were part of the problem. As one instead of the other relieved the symptoms, but probably not the cause.
The email was set when I checked.
If you didn't set it, it was only the placeholder. And in files there is 'email' the menu item, but it used 'w_email' the address. The second time you tried it had my email filled in so i got them. Anyway, happy it works.
As you have probably noticed by now, WonderCMS plugins work on so called "hooks".
Is this also why f.e. the gallery doesn't show when logged in? I'll read up on it.
This problem will be solved with the revamped files structure
Do you have time to go over one of the plugins with me, like the gallery f.e.? Like do's and don'ts, file structure based on menu, and hooking it up the way it should?
If so i can put it on git.
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: 0.8.2 (BETA)

Post by wiz »

As far as I can see you have figured it out perfectly on your website.
Amazing job done.

Please let us know if you are prepared to share your code publicly, as it could greatly benefit WonderCMS to expand faster with that type of work done and also help other users build from your code.
Post Reply