Skip to content
This repository has been archived by the owner on Apr 16, 2021. It is now read-only.

Fixed the autologout problem #18

Closed
wants to merge 1 commit into from
Closed

Fixed the autologout problem #18

wants to merge 1 commit into from

Conversation

kylegundersen
Copy link

A logout was occurring when the menu page was clicked due to the fact that a period was used in the plugin name. Because the period is used for concatenation natively in PHP it is unsafe to use in that manner. I have hence changed all the "wp-code-highlight.js" to "wp-code-highlight-js".

A logout was occurring when the menu page was clicked due to the fact that a period was used in the plugin name. Because the period is used for concatenation natively in PHP it is unsafe to use in that manner. I have hence changed all the "wp-code-highlight.js" to "wp-code-highlight-js".
@owent
Copy link
Owner

owent commented Feb 3, 2017

@kylegundersen Can you show which menu will cause autologout please? I want to recreate this problem because this never happened before.

I found all period symbols your PR replaced are in string, and all those string are the name of i18n dictionary name except one URL in comment. They should not cause any problem.And if we accept this PR, we have to move project repository and we should also update the translation file.

@kylegundersen
Copy link
Author

I am using the newest version of WordPress as well as PHP 7. That would be a good place to start recreating this problem. The automatic logout was happening almost every request, but I noticed when I disabled the plugin it stopped happening. So that is about the time that I pinpointed the culprit being the period.

Also I experienced this problem via DreamHost's managed WordPress but I doubt that has anything to do with it.

@owent
Copy link
Owner

owent commented Feb 13, 2017

@kylegundersen I deploy a temporary wordpress site at http://45.76.102.215 . I have post a article and create a link in menu, but this problem can not be recreated.
Could you please install your other plugins and try again and tell me the steps?

Username: admin
Password: testbugs

The environment is LNMP(centos 7,php 7,nginx 1.10.3, mariadb and php 7.1)
See http://45.76.102.215/wp-admin/options-general.php?page=updraftplus for detail.

@kylegundersen
Copy link
Author

I don't think its a plugin or theme conflict I defaulted all my settings back to no plugins and the default 2017 theme if you want to recreate it. I personally think it is either the varnish or server config that could be causing the issue. If you would like to recreate it then goto DreamHost purchase a month of dreampress and install your plugin and that should be it.

@owent
Copy link
Owner

owent commented Feb 19, 2017

@kylegundersen

It's still can not be recreated in dreamhost managed wordpress.
URL: http://testbugs.owent.net/
username and password is the same to http://45.76.102.215

@kylegundersen
Copy link
Author

kylegundersen commented Feb 19, 2017

I just installed it from the WordPress Repo on my other VPS instance of dream press and the same auto logout problem occurs. SO now its just connecting the reasons to why this is occurring. Do you think this is caused by the SSL? Both of the instances I have spun up both have SSL certs signed different providers. I am going to do some comparisons today and see if I can pinpoint the exact issue.

@kylegundersen
Copy link
Author

The version of DreamPress you have does not have varnish, which I now believe to be the main cause of the Auto-Logout associated with the naming convention of this plugin. If you would like to experience this issue first hand I will create you a temp admin account to one of my sites and you will see for yourself. what is happening.

@owent
Copy link
Owner

owent commented Feb 20, 2017

@kylegundersen

I think I know what's the problem. Maybe some software(varnish for example) have configured all the URLs end with '.js' are treated as static files. But this plugin's configuration page has a parameter and make the URL has the '.js' suffix. I will just change the URL by change

add_options_page(__('WP Code Highlight.js Settings'), __('WP Code Highlight.js'), 'manage_options', 'wp-code-highlight.js', 'hljs_settings_page');
$links[] = '<a href="options-general.php?page=wp-code-highlight.js">' . __('Settings') . '</a>';

to

add_options_page(__('WP Code Highlight.js Settings'), __('WP Code Highlight.js'), 'manage_options', 'wp-code-highlight-js', 'hljs_settings_page');
$links[] = '<a href="options-general.php?page=wp-code-highlight-js">' . __('Settings') . '</a>';

and this problem should be solved.

@kylegundersen
Copy link
Author

Yea that would work, My commit was lazier cause I just did a find and replace on all instances, but yea that should 100% work to prevent conflicts. :)

@owent
Copy link
Owner

owent commented Feb 21, 2017

Thanks and all the test environment will be closed soon.

@owent owent closed this Feb 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants