https://redmine.gc.cuny.edu/https://redmine.gc.cuny.edu/favicon.ico2016-08-08T16:49:33ZCUNY Graduate Center - Project Tracking SystemCUNY Academic Commons - Bug #5874: Statpress error noticeshttps://redmine.gc.cuny.edu/issues/5874?journal_id=246642016-08-08T16:49:33ZRaymond Hoh
<ul></ul><p>The plugin dev on the wp.org forums suggests deactivating and reactivating the plugin to update the DB schema upgrade.</p>
<p>I manually deactivating and reactivated StatPress Visitors for site ID 695 and there was the following notice:</p>
<blockquote>
<p>Settings activated: Statpress Vistors database updated</p>
</blockquote>
<p>Hopefully that fixes the problem. Not sure why this doesn't happen transparently.</p>
<p>Is the error message posted by Lihua only specific to site ID 695? Or are there more sites affected by this?</p> CUNY Academic Commons - Bug #5874: Statpress error noticeshttps://redmine.gc.cuny.edu/issues/5874?journal_id=246682016-08-08T17:45:28ZBoone Gorgesboone@gorg.es
<ul></ul><p>Thanks, Ray. I don't have access to the full logs, but I'm assuming it's not limited to that one site.</p>
<p>Does Statpress set a flag after the update is complete? Can you write a script that I can run (wp eval-file) at deployment to loop through all sites using statpress and run the upgrade routine where necessary? Or perhaps there can be some automated detection of whether the upgrade has taken place, with the update being run if the DB is found to be out of date? (Not sure if the latter is safe.)</p> CUNY Academic Commons - Bug #5874: Statpress error noticeshttps://redmine.gc.cuny.edu/issues/5874?journal_id=246692016-08-08T19:59:58ZRaymond Hoh
<ul></ul><p><a href="https://gist.github.com/r-a-y/da5311f64b6befd0e44eea84f76d80a2" class="external">Here's a quick script</a> for wp-cli.</p>
<p>Couldn't use StatPress' built-in DB function since it uses a constant to set the DB table prefix.</p>
<p>For the <code>$site_ids</code> variable, I installed the <a href="https://wordpress.org/plugins/plugin-activation-status/" class="external">Plugin Activation Status</a> plugin (not in Git), activated it on the development server and copied the site IDs. Dev server should use the most recent DB data, so we should be safe here right?</p> CUNY Academic Commons - Bug #5874: Statpress error noticeshttps://redmine.gc.cuny.edu/issues/5874?journal_id=247002016-08-11T18:31:22ZBoone Gorgesboone@gorg.es
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Target version</strong> set to <i>Not tracked</i></li></ul><p>Thanks, Ray!</p>
<blockquote>
<p>For the $site_ids variable, I installed the Plugin Activation Status plugin (not in Git), activated it on the development server and copied the site IDs. Dev server should use the most recent DB data, so we should be safe here right?</p>
</blockquote>
<p>Dev server uses DB data from the last sync, which was on Friday of last week. Close enough :-D</p>
<p>I just ran the routine and it appears to have worked. At least, it succeeded in changing the schema on some out-of-date tables. I assume this means that the notices will no longer appear. Let's mark resolved.</p>