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

Don't rely on plugin_basename( WP_STREAM_DIR ) to define the db versions option_name #388

Closed
c3mdigital opened this issue Apr 4, 2014 · 1 comment · Fixed by #387
Closed

Comments

@c3mdigital
Copy link

Working on #387 I realized that if the plugin directory changes for any reason and you update no previous stored version will be found because we are defining and querying for the option_name using plugin_basename( WP_STREAM_DIR ) . '_db';

If a user downloads the zip from git_hub the directory will be wp-stream-xxxxx where xxxxx is either the branch or tag. If the user updates to a newer version via the dashboard the stream tables could be overwritten.

I think we should just define as a constant somewhere and use the same prefix as the settings wp_stream_db. We would have run a check for the old name somehow before migrating old installation to the new key. Maybe a $wpdb-> query for `option_name LIKE '%wp-stream%' or something.

@frankiejarrett
Copy link
Contributor

@c3mdigital Really good thinking on this 👍

c3mdigital pushed a commit that referenced this issue Apr 6, 2014
- Changed option_name to class KEY const = wp_stream_db
- Added get_db_version method to query for any nonstandard option_name if version is 1.3.0 or earlier
- If old option_name found update to new option name
- Fixes #388
c3mdigital pushed a commit that referenced this issue Apr 7, 2014
- Update db version option key in uninstall routine
- Fixes #388
@c3mdigital c3mdigital mentioned this issue Apr 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants