Conversation
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".
@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. |
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. |
@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.
The environment is LNMP(centos 7,php 7,nginx 1.10.3, mariadb and php 7.1) |
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. |
It's still can not be recreated in dreamhost managed wordpress. |
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. |
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. |
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. |
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. :) |
Thanks and all the test environment will be closed soon. |
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".