cotech / website

The Cooperative Technologists WordPress website
https://www.coops.tech/
GNU General Public License v3.0
24 stars 5 forks source link

Updating wordpress and plugins to later versions #110

Closed harryrobbins closed 5 years ago

harryrobbins commented 5 years ago

Made some updates to plugins for security fixes, etc.

fixed a bug where the email for co-op was always expected to always be populated.

chriscroome commented 5 years ago

The dev site appear to be working OK but the update script still generates errors:

bash ./bin/update 
No local changes to save
Already up-to-date.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Nothing to install or update
Generating autoload files
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
yarn global v1.12.1
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "npm@6.4.1" with binaries:
      - npm
      - npx
Done in 2.97s.
npm WARN tar ENOENT: no such file or directory, open '/home/cotechdev/sites/web/app/themes/coop-tech-oowp-theme/node_modules/.staging/source-map-60e9912b/dist/source-map.js'
npm WARN tar ENOENT: no such file or directory, open '/home/cotechdev/sites/web/app/themes/coop-tech-oowp-theme/node_modules/.staging/ajv-c7f24b96/dist/ajv.min.js.map'
npm ERR! path /home/cotechdev/sites/web/app/themes/coop-tech-oowp-theme/node_modules/.staging/gulp-c4313336/node_modules/ansi-gray
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/home/cotechdev/sites/web/app/themes/coop-tech-oowp-theme/node_modules/.staging/gulp-c4313336/node_modules/ansi-gray' -> '/home/cotechdev/sites/web/app/themes/coop-tech-oowp-theme/node_modules/.staging/ansi-gray-4c4f781b'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/cotechdev/.npm/_logs/2018-11-05T16_57_36_828Z-debug.log
gulp[3965]: ../src/node_contextify.cc:629:static void node::contextify::ContextifyScript::New(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `args[1]->IsString()' failed.
 1: node::Abort() [gulp]
 2: 0x880665 [gulp]
 3: node::contextify::ContextifyScript::New(v8::FunctionCallbackInfo<v8::Value> const&) [gulp]
 4: v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo*) [gulp]
 5: 0xaed4ef [gulp]
 6: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [gulp]
 7: 0xb7db0e0427d
./bin/update: line 31:  3965 Aborted                 gulp
Success: WordPress database already at latest db version 38590.

It has been like this for a while... so we can probably ignore it and try updating the live site?

harryrobbins commented 5 years ago

I have no idea what I'm doing tbh.

I find git incredibly boring and confusing at the same time.

Apologies to the proper devs if I've broken this somehow!

chriscroome commented 5 years ago

Thanks @harryrobbins that latest update seems to have helped, I had to manually remove the web/app/themes/coop-tech-oowp-theme/yarn.lock before a git pull would run, the https://www.dev.coops.tech/ site is looking good in terms of functionality now but it is still on an old version of WordPress:

wp core version      
4.9.4
wp core check-update 
+---------+-------------+-----------------------------------------------------------------------+
| version | update_type | package_url                                                           |
+---------+-------------+-----------------------------------------------------------------------+
| 4.9.8   | minor       | https://downloads.wordpress.org/release/wordpress-4.9.8-partial-4.zip |
+---------+-------------+-----------------------------------------------------------------------+

Would it be safe to edit this line to:

    "johnpbloch/wordpress": "4.9.8"
harryrobbins commented 5 years ago

It would I believe. I did have it in the latest version but I did one of the merges the wrong way or some such nonsense.

On Tue, 6 Nov 2018, 16:17 Chris Croome <notifications@github.com wrote:

Thanks @harryrobbins https://github.com/harryrobbins that latest update seems to have helped, I had to manually remove the web/app/themes/coop-tech-oowp-theme/yarn.lock before a git pull would run, the https://www.dev.coops.tech/ site is looking good in terms of functionality now but it is still on an old version of WordPress:

wp core version 4.9.4 wp core check-update +---------+-------------+-----------------------------------------------------------------------+| version | update_type | package_url | +---------+-------------+-----------------------------------------------------------------------+| 4.9.8 | minor | https://downloads.wordpress.org/release/wordpress-4.9.8-partial-4.zip | +---------+-------------+-----------------------------------------------------------------------+

Would it be safe to edit this line https://github.com/cotech/website/blob/dev/composer.json#L51 to:

"johnpbloch/wordpress": "4.9.8"

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cotech/website/pull/110#issuecomment-436312161, or mute the thread https://github.com/notifications/unsubscribe-auth/ABob-WT3JmnNfGA-6jSnFwFHDsZTYiJTks5usbYVgaJpZM4YOslT .

chriscroome commented 5 years ago

I did one of the merges the wrong way

I did wonder about that… is this something we should be concerned about?

chriscroome commented 5 years ago

I undid this merge because it resulted in the live site not working, with this error in the apache logs:

PHP Fatal error:  Uncaught Error: Call to undefined function acf_add_options_page() in /home/cotech/sites/web/app/plugins/acf-options-page/acf-options-page.php:60\nStack trace:\n#0 /home/cotech/sites/web/app/plugins/acf-options-page/acf-options-page.php(170): acf_plugin_options_page->__construct()\n#1 /home/cotech/sites/web/wp/wp-settings.php(305): include_once('/home/cotech/si...')\n#2 /home/cotech/sites/web/wp-config.php(9): require_once('/home/cotech/si...')\n#3 /home/cotech/sites/web/wp/wp-load.php(42): require_once('/home/cotech/si...')\n#4 /home/cotech/sites/web/wp/wp-blog-header.php(13): require_once('/home/cotech/si...')\n#5 /home/cotech/sites/web/index.php(5): require('/home/cotech/si...')\n#6 {main}\n  thrown in /home/cotech/sites/web/app/plugins/acf-options-page/acf-options-page.php on line 60

It appears to me that a plugin might have been installed using the web interface on the dev site but not added to the composer.json file so the live site didn't get the plugin installed?

Perhaps this one?

chriscroome commented 5 years ago

The plugins installed on the dev site:


wp plugin list
+--------------------------+----------+-----------+---------+
| name                     | status   | update    | version |
+--------------------------+----------+-----------+---------+
| acf-to-rest-api          | active   | none      | 3.1.0   |
| advanced-custom-fields   | active   | none      | 5.7.7   |
| acf-flexible-content     | active   | none      | 2.1.0   |
| acf-options-page         | active   | none      | 2.1.0   |
| acf-repeater             | active   | none      | 2.1.0   |
| contact-form-7           | inactive | none      | 5.0.5   |
| contact-form-7-recaptcha | inactive | none      | 1.2.0   |
| custom-post-type-ui      | active   | none      | 1.6.0   |
| database-sync            | active   | none      | 0.5.1   |
| email-subscribers        | inactive | none      | 3.5.15  |
| flamingo                 | active   | none      | 1.9     |
| posts-to-posts           | active   | none      | 1.6.5   |
| wordpress-importer       | active   | none      | 0.6.4   |
| wp-piwik                 | active   | none      | 1.0.19  |
| wp-fail2ban              | active   | available | 3.5.3   |
| wp-sync-db-media-files   | inactive | none      | 1.1.4b1 |
| bedrock-autoloader       | must-use | none      | 1.0.0   |
| disallow-indexing        | must-use | none      | 1.0.0   |
| register-theme-directory | must-use | none      | 1.0.0   |
+--------------------------+----------+-----------+---------+

The plugins installed on the live site:

wp plugin list
+--------------------------+----------+-----------+---------+
| name                     | status   | update    | version |
+--------------------------+----------+-----------+---------+
| acf-to-rest-api          | active   | none      | 3.1.0   |
| advanced-custom-fields   | active   | available | 4.4.12  |
| acf-flexible-content     | active   | none      | 1.1.1   |
| acf-options-page         | active   | none      | 1.2.0   |
| acf-repeater             | active   | none      | 1.1.1   |
| contact-form-7           | inactive | available | 5.0     |
| contact-form-7-recaptcha | inactive | none      | 1.2.0   |
| custom-post-type-ui      | active   | available | 1.5.6   |
| database-sync            | active   | none      | 0.5.1   |
| email-subscribers        | inactive | available | 3.4.8   |
| flamingo                 | active   | available | 1.8     |
| posts-to-posts           | active   | none      | 1.6.5   |
| wordpress-importer       | active   | available | 0.6.3   |
| wp-piwik                 | active   | none      | 1.0.19  |
| wp-fail2ban              | active   | available | 3.5.3   |
| wp-sync-db-media-files   | inactive | none      | 1.1.4b1 |
| bedrock-autoloader       | must-use | none      | 1.0.0   |
| disallow-indexing        | must-use | none      | 1.0.0   |
| register-theme-directory | must-use | none      | 1.0.0   |
+--------------------------+----------+-----------+---------+

The lists are identical so it doesn't appear that the live site is missing a plugin…