Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discussion] WonderCMS future improvements/requests #21

Closed
robiso opened this issue Mar 25, 2017 · 39 comments
Closed

[Discussion] WonderCMS future improvements/requests #21

robiso opened this issue Mar 25, 2017 · 39 comments

Comments

@robiso
Copy link
Collaborator

robiso commented Mar 25, 2017

This thread is closed. NEW DISCUSSION THREAD: #41

Hello everyone. We need your help with improving WonderCMS.

Roadmap

  1. Spread the word about WonderCMS.
  2. Add special section on WonderCMS website for plugins and themes
  • Automate the process of reading themes/plugins from GitHub and display them on the WonderCMS website in a searchable and paginated way (numbered pages).
  1. Additional code review/optimisation
  • WonderCMS index.php is around 550 lines of PHP long
    • WonderCMS runs on 51 functions

Finished improvements from roadmap

1. Clean(er) URL's (short problem description: spaces and special characters URL handling + saving to database and displaying them in menu)
Long problem description and example:
When an user enters "my new page" in their menu at their example.com domain, spaces aren't stripped and the URL is example.com/my new page. The solution would be to replace spaces with the "-" character so the URL would be example.com/my-new-page.
1a. But what about all other special characters? And what "URL" are we going to save in the database in those cases.
1b. Once we update WonderCMS with this feature, how do we handle the user page names in their database.js to avoid an upgrading mess?
1c. After all this, we still need to display pages in the menu exactly the user entered them.
EDIT: this looks promising: http://cubiq.org/the-perfect-php-clean-url-generator
**IN WORK: @wdj-ac has started working on this, contribute if you can: https://github.com/wdj-ac/wondercms/issues/
- DONE, thanks to @wdj-ac (Pascal Jordin)

2. Display all pages in the settings panel and additionally include some "hide from menu" functionality.
Problem: There's currently no "full list" of pages in the settings. A solution to this would be to view the database.js but that's definitely a hassle. We need a simple way to display all pages and a checkbox in the current page settings menu, that would enabe the user to hide the page from the menu.
**IN WORK: @wdj-ac has started working on this, contribute if you can: https://github.com/wdj-ac/wondercms/issues/
- DONE, thanks to @wdj-ac (Pascal Jordin)

3. Enable users to install plugins via the settings panel. (Almost done, test version in near the end)
3a. This should be an input text field, which would take a ZIP link (allowed only from github.com domain) and extract it to the users plugin folder.
3b. Enable users to update their plugin with a new ZIP link (if the plugin name is the same).
3c. Simple plugin list (list all plugins from plugins folder)
3d. Enable users to easily remove a plugin (from the plugin list, a small "X" would do and a confirm dialog).
3e. Same functionality for themes (we will probably need an extra field for this, possibly a check box to choose between installing a plugin or a theme to avoid two text fields).

The solution to the possible improvements should be small and clean in terms of code.

If you find an awesome solution, we will gladly list you and your website on wondercms.com/special-contributors and the official WonderCMS download page wondercms.com/latest. If our donation fund isn't empty, you're also rewarded with a donation.

@robiso robiso added this to 2.0.2 roadmap in Roadmap Mar 31, 2017
@nightillusions
Copy link

@robiso I'm nearly done with 1. and 2.
There are a few improvements that have to be made and the code must be shortened too, but I think in a couple of days it will be finish. Just have a look: nightillusions@ec20716

@robiso
Copy link
Collaborator Author

robiso commented Apr 17, 2017

@wdj-ac thank you for attending these issues, looks really good!

A few notes/headsup:

  • return the old URL function to avoid breaking WonderCMS on subdomains (and probably other issues): yourwebsite.com/wondercmsInstalledHere would cause trouble loggin in and out, for example -> without the commented out part, yourwebsite.com/wondecmsInstalledHere/login link becomes yourwebsite.com/login (and same for logging out) (this explains your to do // why) 👍

Side note, as a supporter your name+website is now listed on

Additionally, your status in the WonderCMS community is changed to Supporter/Developer.

@nightillusions
Copy link

nightillusions commented Apr 17, 2017

return the old URL function to avoid breaking WonderCMS on subdomains (and probably other issues): yourwebsite.com/wondercmsInstalledHere would cause trouble loggin in and out, for example -> without the commented out part, yourwebsite.com/wondecmsInstalledHere/login link becomes yourwebsite.com/login (and same for logging out) (this explains your to do // why

Thanks for this explanation. For my environment this part cause problems and return urls like: cms.domain.dev/var/www/wondercms/login. But it should be cms.domain.dev/login.
I will try to find a solution for it after this all here :).

Side note, as a supporter your name+website is now listed on

Thank you very much!

@Alamantus
Copy link
Contributor

Alamantus commented Apr 24, 2017

For my environment this part cause problems and return urls like: cms.domain.dev/var/www/wondercms/login. But it should be cms.domain.dev/login.
I will try to find a solution for it after this all here :).

@wdj-ac @robiso I submitted a pull request ( #28 ) that updates the wCMS::url() method to use relative links (./) instead of full absolute links. This solves the problem of WonderCMS being installed in a subdirectory because all pages are on the top level of the installation anyway. Even if sub-pages are added, then it will just be a matter of using wCMS::url('location/subdirectory'). I believe relative links are better because it is lighter on the server (rather than making calls to $_SERVER variables), and it automatically matches the protocol and install location.

@robiso
Copy link
Collaborator Author

robiso commented Apr 30, 2017

Just to continue this discussion and keep everyone posted on what is developing and where we're headed.

  1. @Alamantus has provided us with a better update system (file_get_contents to cURL) and fixed absolute URLs to relative ones which enables WonderCMS a broader audience. Additionally, he provided us with an another display login URL fix. Thank you Robbie!

I'll update my first post to reflect what's in the works.

@robiso
Copy link
Collaborator Author

robiso commented May 21, 2017

To revisit this issue (relative / absolute links) due to some issues described below.

@Alamantus can you please help me out regarding your url function:

public static function url($location = '') {
	return './' . $location;
}

When visiting example.com/somePage/testPage, it incorrectly loads the CSS file and doesn't display the page properly. In the old system we had, those files always loaded correctly (even when visiting example.com/test/test1/test2. The old working function:

public static function url($location = '') {
	return 'http' . (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . str_replace($_SERVER['DOCUMENT_ROOT'], '', str_replace('\\', '/', __DIR__)) . '/' . $location;
}

Here's another solution with using dirname($_SERVER['SCRIPT_NAME']) below
@wdj-ac can you please test out the bottom function and see if pages are loaded correctly? (This is the old system with. Hopefully this works on your system.

public static function url($location = '') {
        return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . str_replace($_SERVER['DOCUMENT_ROOT'], '', str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']))) . "/{$location}";
 }

@Alamantus
Copy link
Contributor

@robiso yeah, that's one of the shortcomings of my function, but when I was adding it, all pages were only at the top level so it wasn't a problem. But if you're adding sub-page functionality, you'll need to revert to an earlier solution.

It's just a matter of figuring out how to make it work consistently... maybe by forcing only the CSS and important links within the template to pull from the absolute link (maybe add an "absoluteURL" method for templates to use?), then relative links could continue to be used, but I know your goal is to keep the total number of functions and lines as low as possible, so maybe you won't like that.

What do you think?

@robiso
Copy link
Collaborator Author

robiso commented May 21, 2017

@Alamantus thank you for your input. The pages are still only at the top level (nothing changed, I only now noticed it, this is only a slight annoyance to have CSS load incorrectly at any stage after /. Do you think we shouldn't worry about it? Maybe we should leave it the way it is, but I can't help and feel weird leaving this as it is.

Reverting is still an option, but I wanted to avoid issues like @wdj-ac had (incorrect host name) and some windows issues: #18 (hopefully the code above works on wdj's setup). The old solution that would work everywhere would be perfect.

I like you suggestion but like you already know, I'm inclined towards less code. :) So you current solution is already awesome, just looking to see if I'm the only one bothered by this, or does this look unprofessional on a developer level (leaving things like this because of code size or etc..)?

@robiso
Copy link
Collaborator Author

robiso commented May 22, 2017

@Alamantus, you also had problems with the old function, can you please the function with SCRIPT_NAME as pasted below and report back if it still returns insanely long URLs?
@wdj-ac does this work for you?

public static function url($location = '') {
        return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . str_replace($_SERVER['DOCUMENT_ROOT'], '', str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']))) . "/{$location}";
 }

@robiso
Copy link
Collaborator Author

robiso commented May 24, 2017

@Alamantus @wdj-ac please let me know about the above url function when/if you can, if it doesn't work as intended we'll just keep with Robbies solution and push out 2.1.0 (still trying to push this "bug fix" before releasing 2.1.0 with @wdj-ac new menu functionality).

Additionally, can you guys somehow forward us your PayPal email addresses? There's been a small donation, and as promised we'd like to forward it to you two.

@Alamantus
Copy link
Contributor

I'll check when I can, but I haven't been able to use my own computer away from work for a while. Hopefully soon—maybe this weekend? That solution looks pretty similar to the original code that gave me problems, but I'll let you know what I find out!

And wow! That's cool that someone donated. I just learned about the new PayPal.me thing, so this link should do the trick:
https://paypal.me/RobbieAntenesse

@robiso
Copy link
Collaborator Author

robiso commented May 25, 2017

It is indeed really similar, only uses the $_SERVER['SCRIPT_NAME'] param. Like mentioned, if this doesn't fix issues, we'll just keep using your solution and push out 2.1.0.

@Alamantus - donation sent, thank you again for your support.

@robiso
Copy link
Collaborator Author

robiso commented May 27, 2017

Revamped function thanks to Luka Mrovlje - if you're testing please test the latest function pasted below.

    public static function url($location = '') {
      return 'http' . (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '') . '://' . $_SERVER['SERVER_NAME'].((dirname($_SERVER['SCRIPT_NAME']) == '/')? '' : dirname($_SERVER['SCRIPT_NAME'])) . '/' . $location;
    }

@nightillusions
Copy link

nightillusions commented May 28, 2017

@wdj-ac can you please test out the bottom function and see if pages are loaded correctly? (This is the old system with. Hopefully this works on your system.

Sorry for my late response, very busy last time.

Revamped function thanks to Luka Mrovlje - if you're testing please test the latest function pasted below.

Tested, and it works fine on my envoirement.
You can try it here http://wondercms.jordin.eu/ (resets every 15 min.)

There's been a small donation, and as promised we'd like to forward it to you two.

Wow sounds great, thank you 😃
https://paypal.me/PascalJordin

@robiso
Copy link
Collaborator Author

robiso commented May 30, 2017

Thank you Pascal, the donation has been sent.
Awesome for setting up the environment.

The commit for 2.1.0 has been made, but the update has not been pushed out yet, this will happen in the next 24 hours.
648bfad
(if anyone can run an additional test of the whole index.php would be awesome within these 24 hours - but I'm almost sure everything is good since we've tested it to no avail! 👍 )

Thanks to everyone for participating, we have successfully solved problems 1 and 2 - an additional thanks to Pascal Jordan @wdj-ac for making this possible.

@Alamantus
Copy link
Contributor

Alamantus commented May 30, 2017

Sorry for the late reply on the URL update, but I was finally able to test in a couple different environments just now and it looks like it works perfectly! Great job, everyone! Also, the new menu/page editor is very nice! Much more user-friendly. 👍

@robiso
Copy link
Collaborator Author

robiso commented Jun 3, 2017

Striking out problems 1 and 2, amazing job everyone!

Special thanks to Pascal Jordin (@wdj-ac) for taking the time to contribute to the WonderCMS project in such a great deal. Additional thanks to Robbie Alamantus (@Alamantus) and Dannis Danylenko (turboblack).

@robiso robiso changed the title WonderCMS future improvements and issues (help us) WonderCMS future improvements and issues (help us - UPDATED) Jun 3, 2017
@dvago
Copy link

dvago commented Jul 26, 2017

@robiso I found your project interesting, is there any chance to contribute on your project in terms of UI design? It could be really great with a small but elegant UI :)

@robiso
Copy link
Collaborator Author

robiso commented Jul 26, 2017

@dvago thank you, always open for suggestions.

To clarify, do you want to contribute to the "settings panel" or the default WonderCMS theme?

These are two different things:

  • the default theme and CSS reside in the default themes folder
  • the "settings panel" is changed in index.php (which the user shouldn't normally edit, as it overwrites itself with each WonderCMS update)

We'll be able to point you in the correct direction after the above question is answered.

Short guidelines if you want to change the default theme/create a new one

  • you will be editing theme.php and style.css (not index.php)
  • make sure your new theme.php and style.css don't exceed the current size of the theme, as we're trying to keep it as compact as it gets
  • create your own theme folder, publish it on GitHub
    • if positive feedback is received, we'll switch over to the new theme, if not - we will simply add your theme to our plugins repository

Short guidelines if you want to change the settings panel:

  • you will be editing index.php (not theme.php and style.css)
  • editing of the css function will be required in index.php
  • editing of the settings function will be required in index.php
  • the same rule as editing the main theme - keep it as small, or smaller than before
    • if positive feedback is received, we'll switch over to the new "settings panel" theme

@dvago
Copy link

dvago commented Jul 26, 2017

@robiso I was refering to the settings panel, which is basically the administration of the "CMS".
I was wondering if having a sort of brand identity inside the "CMS" itself could bring more attention from the outside, so more reviews, more usage, more contributors (plugins/themes) etc.

@robiso
Copy link
Collaborator Author

robiso commented Jul 26, 2017

@dvago for now (or since the beginning), our brand identity on the distributed CMS itself has been in the lines of:

  • ultra light (the settings panel has around 15 CSS properties)
  • nonintrusive
  • as white label as it gets (no WonderCMS logos, backlinks) to give users as much freedom possible
  • good look with minimum code

I'm really interested in your idea of how this could be solved with our vision. If you don't feel comfortable editing the index.php, you can simply throw the CSS and HTML of the settings panel on GitHub and we'll apply it to the CMS itself, if enough positive feedback is received.

Do you think the brand identity can be achieved with as little code or possibly less code?

--

Edit: We're in the process of doing the plugins/themes installer mentioned in the first post.
We modified the settings panel styles minimally. While this is probably not what you had in mind, it's a preview of what's happening. Let me know what you think - https://www.wondercms.com/221.

If anyone is willing to test out the new WonderCMS version with the themes/plugins ZIP installer from URL, shoot a message below.

@robiso
Copy link
Collaborator Author

robiso commented Jul 26, 2017

@dvago forgot to add, in any case we'll publicly credit you as we have every WonderCMS contributor.

@dvago
Copy link

dvago commented Jul 27, 2017

@robiso, I'm sorry for the delayed reply.

I do understand you want to keep the "core" of the CMS as small as possible and I also understand you want to provide a white labelled experience with a learning curve ultra fast.

But, I also believe that the "administration" of the CMS must be detached from the "production asset" as you don't want to load extra functionalities during the "guest" journey.

Since WonderCMS is "selling" itself as a fast flat file CMS I suppose the output of the site it's just a router for the navigation and a bunch of plain HTML files.

This means that you can easily create some sort of "cached" version of the production site storing your HTML inside some sort of "cache" folder and that might be have some sort of versioning based on the last update.

Moving forward with this concept you could easily brand your CMS as much as you like (giving him the possibility to compete with bigger projects, ex. GRAV, I'm not selling it as I do think is not so easy to use, that's why they have an huge documentation).

Quick note: I've tried to upload your project into my debian server with sites in production running PHP but I get errors related to require_once functions and the .htaccess (which basically wants the root folder instead of a subfolder)

@robiso
Copy link
Collaborator Author

robiso commented Jul 27, 2017

@dvago The administration itself is completely detached and not tied to themes/theme. Admin CSS/JS and HTML is not loaded when visitors check out a WonderCMS page, only when the admin logs in. WonderCMS basically runs on the core file index.php, and uses an users custom theme to display content, the index uses less than 50 functions, and $_REQUESTS, $_POSTS and etc are kept at the minimum.

The cached versions or old revisions of content will probably come into the future in a form of a plug in, which I personally think is great, both the idea and the plugin itself.

Would you be prepared to show us an example of your idea, of how this should look like?

What version of PHP is your server running and are you running Apache/NGINX/IIS? Can you additionally check if you have cURL and mbstring extensions (https://www.wondercms.com/requirements).

@dvago
Copy link

dvago commented Jul 27, 2017

@robiso ok, I'll try to give you something visual in the next few days

related to my problem, i'm running on:


Apache 2.0
PHP Version 5.6.30-0+deb8u1
Multibyte (japanese) regex support | enabled
Multibyte regex (oniguruma) version | 5.9.5
mbstring.detect_order | no value 
mbstring.encoding_translation | Off
mbstring.func_overload | 0
mbstring.http_input | no value 
mbstring.http_output | no value
mbstring.http_output_conv_mimetypes | ^(text/\|application/xhtml\+xml) | 
mbstring.internal_encoding | no value
mbstring.language | neutral
mbstring.strict_detection | Off
mbstring.substitute_character | no value
cURL support | enabled
cURL Information | 7.38.0
Age | 3

mod rewrite is also loaded

@robiso
Copy link
Collaborator Author

robiso commented Jul 27, 2017

Looks good, can you post the exact errors? We've tested it in multiple scenarios where it works in subdomains/subfolders and anywhere you upload it. Would love to solve this mystery.

@dvago
Copy link

dvago commented Jul 27, 2017

Tried to set as 775 and 777 the index.php and the theme/ content, no luck

[Thu Jul 27 23:23:05.916983 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Warning:  mkdir(): Permission denied in /var/www/www.example.com/httpdocs/wonder/index.php on line 300
[Thu Jul 27 23:23:05.985181 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Warning:  file_put_contents(/var/www/www.example.com/httpdocs/wonder/database.js): failed to open stream: Permission denied in /var/www/www.example.com/httpdocs/wonder/index.php on line 146
[Thu Jul 27 23:23:06.074334 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Warning:  file_put_contents(.htaccess): failed to open stream: Permission denied in /var/www/www.example.com/httpdocs/wonder/index.php on line 18
[Thu Jul 27 23:23:06.074375 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Warning:  unlink(database.js): No such file or directory in /var/www/www.example.com/httpdocs/wonder/index.php on line 19
[Thu Jul 27 23:23:06.142556 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Warning:  file_put_contents(/var/www/www.example.com/httpdocs/wonder/database.js): failed to open stream: Permission denied in /var/www/www.example.com/httpdocs/wonder/index.php on line 146
[Thu Jul 27 23:23:06.142597 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 22
[Thu Jul 27 23:23:06.142603 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 22
[Thu Jul 27 23:23:06.142612 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Warning:  Creating default object from empty value in /var/www/www.example.com/httpdocs/wonder/index.php on line 22
[Thu Jul 27 23:23:06.142618 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 24
[Thu Jul 27 23:23:06.142623 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 24
[Thu Jul 27 23:23:06.142628 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 25
[Thu Jul 27 23:23:06.142632 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 25
[Thu Jul 27 23:23:06.142636 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 26
[Thu Jul 27 23:23:06.142662 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 26
[Thu Jul 27 23:23:06.142668 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 27
[Thu Jul 27 23:23:06.142673 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 27
[Thu Jul 27 23:23:06.142678 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 28
[Thu Jul 27 23:23:06.142683 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 29
[Thu Jul 27 23:23:06.142688 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 29
[Thu Jul 27 23:23:06.142694 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Warning:  Creating default object from empty value in /var/www/www.example.com/httpdocs/wonder/index.php on line 29
[Thu Jul 27 23:23:06.142699 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 30
[Thu Jul 27 23:23:06.142704 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 30
[Thu Jul 27 23:23:06.142709 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Warning:  Creating default object from empty value in /var/www/www.example.com/httpdocs/wonder/index.php on line 30
[Thu Jul 27 23:23:06.142744 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Warning:  file_put_contents(/var/www/www.example.com/httpdocs/wonder/database.js): failed to open stream: Permission denied in /var/www/www.example.com/httpdocs/wonder/index.php on line 146
[Thu Jul 27 23:23:06.142752 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 33
[Thu Jul 27 23:23:06.142764 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 33
[Thu Jul 27 23:23:06.142770 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 37
[Thu Jul 27 23:23:06.142775 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Warning:  Invalid argument supplied for foreach() in /var/www/www.example.com/httpdocs/wonder/index.php on line 37
[Thu Jul 27 23:23:06.142779 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Warning:  Attempt to modify property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 46
[Thu Jul 27 23:23:06.142785 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Warning:  Creating default object from empty value in /var/www/www.example.com/httpdocs/wonder/index.php on line 48
[Thu Jul 27 23:23:06.142819 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Warning:  file_put_contents(/var/www/www.example.com/httpdocs/wonder/database.js): failed to open stream: Permission denied in /var/www/www.example.com/httpdocs/wonder/index.php on line 146
[Thu Jul 27 23:23:06.142841 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 124
[Thu Jul 27 23:23:06.142864 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 124
[Thu Jul 27 23:23:06.142879 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 123
[Thu Jul 27 23:23:06.142893 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 124
[Thu Jul 27 23:23:06.142899 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 124
[Thu Jul 27 23:23:06.142917 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 124
[Thu Jul 27 23:23:06.142922 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 124
[Thu Jul 27 23:23:06.142941 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 124
[Thu Jul 27 23:23:06.142953 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Notice:  Trying to get property of non-object in /var/www/www.example.com/httpdocs/wonder/index.php on line 124
[Thu Jul 27 23:23:06.142975 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Warning:  require_once(/var/www/www.example.com/httpdocs/wonder/themes//theme.php): failed to open stream: No such file or directory in /var/www/www.example.com/httpdocs/wonder/index.php on line 65
[Thu Jul 27 23:23:06.143010 2017] [:error] [pid 27488] [client XX.XX.XX.XX:52558] PHP Fatal error:  require_once(): Failed opening required '/var/www/www.example.com/httpdocs/wonder/themes//theme.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/www.example.com/httpdocs/wonder/index.php on line 65

@robiso
Copy link
Collaborator Author

robiso commented Jul 27, 2017

Try changing file permissions 644 to the next files:

  • index.php
  • theme.php
  • .htaccess

Set ALL folder permissions to 755.

On another note, here's an example of a dev that made a customized settings panel with a plugin:
https://github.com/prakai/wcms-_modern_settings

@dvago
Copy link

dvago commented Jul 28, 2017

Hi @robiso, thanks for your reply, I managed to solve the problem changing the owner to www-data.

Meanwhile I started thinking about some improvements, let me know if it's worth.
I was thinking to split the interface based on a context, the site settings section is related to generic information like the login/admin account, favicon, manifest.json details which are supposed to be in common across the entire site.

The admin panel is trigged by a not intrusive float button which is fixed on top of the website:

logged - first screen

Once clicked, this could be an ipotetic interface which sits on top of the page, the dark overlay remove the scroll of the entire page so you can just scroll within the admin "modal".

logged - settings panel

@robiso
Copy link
Collaborator Author

robiso commented Jul 29, 2017

@dvago awesome for solving the problem, I'll keep this in mind if anyone runs into the same problem.

Thank you for the mock up. I absolutely love the design and the concept of the modal window, however I find a couple drawbacks (please mind this is my personal taste/opinion):

  • everything that was one click away is now two clicks away, which reminds me of:
    • most CMS-es with sub-menus
  • we lose the "everything in once place feel" we've kept since the first version of this CMS

Other things I'm concerned about:

  • CMS size (JS switching functionality, Bootstrap modal HTML which isn't small in terms of code)
  • what would happen when fields are saved - page refreshes and modal re-initiates?
  • we don't want to over bloat the CMS with features, but want to provide everything with themes and plugins (a plugin for media, favicon, etc) and keep modular, this is why I believe we could stick to the one page or single window settings without switchable menus. This is why we can't wait to release the upcoming version that will enable theme and plugins installing from the settings panel (link sent a couple of posts back /221).

A lighter version of this would be awesome, but we are in no client/customer relationship so I wouldn't dare of asking for a re-design. Love your work 👍

Can anyone else please chip in with their opinion?

@Alamantus
Copy link
Contributor

I think it looks gorgeous and makes it feel more like an admin panel than the current one. But you make good points about the CMS goals.

Toggling a JS modal in PHP takes a lot more code than it feels like it should, so whenever something changes, it might be difficult to keep the codebase small while also having the modal re-open whenever it saves. One way to fix this could be to have a single "save" button, so you make all the changes you need, then click "Save", which would save the changes and initiate the reload which would close the admin panel instead of reloading after every change. I think this might be a slightly better (or more expected) user experience, although it adds an extra step for the user (which I don't think is entirely bad).

Having "everything in one place" wouldn't be a problem if instead of tabs, all the options were on a single scrolling screen in the modal.

As for the size, if we load in Bootstrap via a CDN link, then that's only one line of extra code for Bootstrap, which isn't too bad and opens up a lot of possibilities for more modern-looking themes/admin panel designs.

It's definitely a tradeoff, but I think taking some of the changes I listed above into consideration would help keep the codebase small while adding the new admin panel. We'd have to check to see how much bigger making these changes causes the codebase to be, however. Depending on how that pans out, it might be a dealbreaker.

Maybe we could include admin panel styling options in themes? So a given theme could have this modal styling without expanding the codebase?

@dvago
Copy link

dvago commented Jul 31, 2017

Hi there,

At the lights of your comments, I think I'm totally missing the "goal" of your CMS then.

WonderCMS looks like a small utility to build simple websites made with flat files (1 level deep, for few pages) which is easy to use as you don't need to learn a lot in terms of templating.

Within this "CMS" you have a settings page which is able to generate an admin user that can fire a sort of "admin" to add new pages in the main navigation (only one), select the custom template and add a couple of meta tags.

Correct me if I'm missing something.

I read several time the "keep the codebase smallest possible" through your comments, which is something I don't get.

  • Is the output of the site a bunch of flat files?
    If so, who cares about the number of lines of your backend administration?

the administration panel is going to be triggered from admin purpose only so it's not going to affect the page load for a client.

  • Are you afraid about the loading time of the admin panel? Is what an admin user is going to evaluate?

As an admin user, I'm expecting to have a good user experience with the more features as possible to build a website and keep it updated without touching code and have the possibility to deploy the best optimised site

  • If the answer of the previous question is "yes", why you guys loads jquery and bootstrap?

jquery is an huge lib which is largely avoided in corporates (I'm working for an huge company who works on vanillaJS and few frameworks for specific projects), bootstrap is not needed to build a simple website, you don't really need bootstrap if the purpose of the project is to build 1 - 10 pages with simple layouts.

  • @Alamantus you don't need to reload and reopen the "admin modal", you can easily save your settings via AJAX and update the view with some visual feedback like a message

  • How you think to expand the CMS to be able to build professional quality websites using just an HUGE page with everything in it? When I speak about features I mean:

  1. The media manager is your current file gallery, which you would like to make more rich in an ideal world (example: possibility to sort the images within subfolders, possibility to add alt description on each one, possibility to crop/resize/shrink with a tool).
  2. Menus - you might want to think about something that could manage multiple menus, multiple levels, so an admin user could trigger the menu list into his own template just calling the name of the menu (let's say: I want A,B,C into my main menu and I want B,C,D, D1,D2,D3 into a footer navigation and maybe also a in page navigation too)
  3. You might want to split the pages into partial views, let's say I'm building 8 pages on my site and 6 of them share the header, the footer but 2 of them are sharing another header and footer, maybe I would like to build a partial content and inject it into my templates
  4. Plugins - You are planning to give the possibility to embed plugins, how you like to embed them? I suppose you would love to have a section where you can search from a repository (using some sort of API that returns a json list) within your admin panel, download the selected plugin and embed into your "partial views" using some sort of easy snippet (example:{{ supercoolslider | loop: true, navigation: true, arrows: true, direction: vertical}})
  5. You might want to give the possibility to generate a manifest.json to build a sort of PWA which gives the site more score in search engines (check Google lighthouse).
  6. Versioning - You might want to give the possibility to create a backup (which save your flat files into a specific folder) and select a previous version of the site within the admin panel. Furthermore, You would love to set the maximum backups for the site and how many times per week.

I can really go on and on, but I'm probably missing your goals, what you'd like to achieve within 1 year, what do you like to build, what's your user (the admin) wants etc.

@robiso
Copy link
Collaborator Author

robiso commented Jul 31, 2017

@Alamantus your input is always high appreciated. I'd just like to add that we already load Bootstrap in the default theme, this is why the default website has only 12 CSS properties, and the settings panel has 19 CSS properties.

@dvago I'd like to once again thank you for sharing your time with us on this project.

Is the output of the site a bunch of flat files?

The output is a single database.js - everything gets saved in this file.

If so, who cares about the number of lines of your backend administration?

I believe this is one of the most wonderful things this project brings, a really small code base, as opposing to any other CMS.
Other good things this brings

  • easy code review if you know PHP
  • you know exactly what's going on without having to struggle through files or a large code base
  • it's a good skeleton for those wanting to learn and build anything themselves

One of the main ideas behind WonderCMS is to provide a great and stable (need I say small?) skeleton, and everything else with plugins.

As an admin user, I'm expecting to have a good user experience with the more features as possible to build a website and keep it updated without touching code and have the possibility to deploy the best optimised site

I partially agree with this and we're slowly getting there (you should see older versions of WonderCMS), as mentioned, I personally believe this should be headed in a direction where you get a simple core, and can later cram it with plugins and features plugins bring built into them.

Loading Boostrap in my opinion isn't a problem, we've also made websites/apps for large corporations and we never hesitated using it, also always used it with small websites (even one pagers). We generally have good SEO results. As far as I can tell, with the current setup, WonderCMS is receiving high ranks on Google.

One thing I'm torn about is whether jQuery should be loaded when the user is not logged in. This will probably change in the upcoming versions (along with autosize.js).

All of these libraries are minified and loaded through CDN's for extra optimization.

--
Correct me if I'm wrong, all these features you're talking about are already available in other CMS-es, and I don't believe chasing that direction is the correct one, I will add some short comments regarding.

  1. Media manager (partially solved with a plugin)
    • summernote editor plugin has a file manager and enables resizing of pictures, uploading etc
      • we're still missing the ability to delete files, this feature request has been sent to the plugin author
  2. Menus (can be solved with a plugin)
    • we have the wanted basic "pages" covered
  3. Can be done with a plugin
  4. Sent link to possible preview of how the installers will work /221)
    • the ideal way would be to present them on the WonderCMS website in a searchable manner from GitHub and not inside the WonderCMS panel - please check https://wondercms.com/221 for a sneak preview of the installer
  5. WonderCMS can be additionally extended for this feature with a plugin.
  6. Versioning is the correct way, but again, with terms of a backup plugin.

I hope this makes it easier to understand, that however pointless it may seem to some, size matters in this case. We really want to provide a powerful and basic core, that is extendible to any direction.

  • WonderCMS uses a ridiculously small number of REQUESTS, POSTS, GETS,
    • this probably gives it value to our current 20k+ users

Our mission isn't to take over the world with a new CMS, but provide a very needed simple alternative for those who seek.

All features you've mentioned can be already found somewhere else, which doesn't mean we won't have them - this just means we want to provide them in a more "unforced" nature, as most of our user base probably doesn't require it by default.

What would be awesome achieving in the future:

  • more plugins
  • more themes
  • larger community
  • retain small core
  • easy way to remove plugins/themes
  • repeat top 4 :)

I generally agree with @Alamantus, we would really have to test this to see what it would make to the core size.
@dvago I don't think you missed the point and I also don't want to give an impression like we're resisting features. Like I said, I would still love to see a "modular" approach to the settings panel in action.

Thank you both.

WonderCMS 2.3.0 test version

@Alamantus can you please the themes/plugins installer (WonderCMS 2.3.0 test version attached below) on your server?

Other features in this test release

  • install themes from URL
  • install plugins from URL
  • tab (indentation) support
  • "visit page" link next to each page in menu
  • logout link moved to top right corner (fixed position)
  • minor design touch-ups in the settings panel
  • js files loaded only if the user is logged in
  • minor text fixes

WonderCMS-230-test-version.zip

@Alamantus
Copy link
Contributor

@robiso I tested the 2.3.0 changes just now, and it all looks good! Being able to install themes and plugins from the panel is nice, but it makes me wish I could also uninstall them from there. :) Other than that, the indentation support is much appreciated, though I noticed that tabs on the first line of a block are trimmed. Not important, since this will usually be the "base" html piece, but still good to note.

One bug that I noticed is that the theme I installed (Paper Landscape) prevents the "Close Settings" button from working. Not a big deal, since it is not the default theme, but still potentially a problem.

Also, the links to the "Theme ZIP links • Plugin ZIP links" section should use target="_blank" to force them to open in a new window/tab.

👍

@robiso
Copy link
Collaborator Author

robiso commented Aug 10, 2017

@Alamantus thank you.

Here's an update to the previous 2.3.0 TEST version. This version includes

  • theme/plugin removing
  • file uploader/remover
  • re-styled settings panel into a modal window (inspired by @dvago)
  • moved back to loading jQuery even if the user is not logged in, due to some themes requiring .js for visitors too, not only the admin
  • fixed first line tab
  • ZIP links open in a new tab
  • safe check to prevent currently active theme from being deleted
  • other minor logic fixes

Here's the 2.3.0 test ZIP. Let me know what you think. If you run into any errors, please report them here. It was a wild ride ironing everything out on this one.
WonderCMS-2-3-0-TEST-version.zip

// Robbie, if you're using the paper-l theme, you might have to rename
.navbar-right li a:hover, .navbar-right li.active a
to
ul.nav.navbar-nav.navbar-right li a:hover, ul.nav.navbar-nav.navbar-right li.active a
for the buttons in your settings panel not to get "too bad".

What do you think about the settings panel?

I have a feeling the next most requested feature is "when an error happens - open the modal at the same location", I already had this solved, but the "alerts" in the background made a mess and were practically invisible (behind the modal), so that's why I averted this feature.

EDIT:
I'd like to add that after using this modal panel for a while and having multi menus (after adding a theme/plugin installer + remover + file uploader/remover), it feels better than it did before. @dvago, I was wrong on this one when I said it would be harder if functions are two clicks away, you were also completely correct on the feel of the detached admin. When we go live with this version, we would still like to publicly credit you on our https://www.wondercms.com/special-contributors page and on our /whatsnew page (Robbie also deserves a mention, yet again :)

Thank you for sharing your opinion and making this project better!

@Alamantus
Copy link
Contributor

These updates are excellent! I love the new modal admin panel and how the categories are separated, and the new features and file manager are great! It all looks very, very nice!

Some minor notes on themes/plugins user experience:

  • I'm glad you included a check to prevent the current theme from being deleted, but if there's a way to make it more clear that it won't/can't delete that theme, it might be a little bit better for the user. Maybe make a check against the current theme and exclude the red X by the side?
  • I like the convenience of being able to add themes and plugins by link, but it might be helpful to allow users to upload zip folders as well, in case they are less experienced and download the file instead of knowing to right click and copy the link.

Other than that, this is wonderful, and it really lifts WonderCMS up to other CMS standards! Very impressive! 👏👏👏

@robiso
Copy link
Collaborator Author

robiso commented Aug 12, 2017

Thank you Robbie, really appreciated.

Some fine tuning is still happening. I added another condition to hide the "X", but we still need the logic to actually prevent this from being deleted (double code for almost the same thing). After this change, it looks a bit weird since it sorts the themes by alphabetical order and in the end, it looks miss-aligned since one theme doesn't have an X (kind of like a bug :)
Thinking about additional scenarios about this from an users perspective:

  • looks like theme cant be deleted, user doesn't know why // end
  • looks like theme can be deleted, user tries, gets explanation why it can't be deleted, can change to another theme as a result of knowing how to fix this // end
    I'm inclined towards using it without the extra if statement. Maybe we need better wording than "Cannot remove currently active theme."?

I was playing with the possibility of uploading folders, but came to the conclusion that it wasn't worth the code enlargement it brought along. We can make this easier for users by showing them the full URL instead of "Download" links to the ZIP files in the WonderCMS themes repository. (So they would only have to select it, not right click.)

What do you think?
// Edit
Even if they download the file, they can use the file uploader, as it supports all file types, and link to the file from their uploads folder.
// Edit 2
Added more clear instructions for default WonderCMS installations, on the example page.

<h3>How to install themes and plugins</h3>
<p>1. Copy link to ZIP file of theme or plugin.</p>
<p>2. Paste link in <i>Settings -> Themes and plugins</i>.</p>

@robiso
Copy link
Collaborator Author

robiso commented Aug 22, 2017

New version released: https://wondercms.com/whatsnew
Publicly thanked you guys, as always, couldn't have done it without you.

Changing first post to reflect new changes.

@robiso robiso changed the title WonderCMS future improvements and issues (help us - UPDATED) [Discussion] WonderCMS future improvements Aug 24, 2017
@robiso robiso changed the title [Discussion] WonderCMS future improvements [Discussion] WonderCMS future improvements/requests Sep 19, 2017
@robiso
Copy link
Collaborator Author

robiso commented Sep 19, 2017

Closing discussion, new one here:
#41

@robiso robiso closed this as completed Sep 19, 2017
@robiso robiso removed this from 2.x.x roadmap in Roadmap Oct 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants