diff --git a/.env.example-full b/.env.example-full index 6ab3e0a6ae..5b10b5e286 100644 --- a/.env.example-full +++ b/.env.example-full @@ -15,18 +15,6 @@ GRAPHER_TEST_DB_PASS=graphertest GRAPHER_TEST_DB_HOST=127.0.0.1 GRAPHER_TEST_DB_PORT=3308 -WORDPRESS_DB_NAME=wordpress -WORDPRESS_DB_USER=wordpress -WORDPRESS_DB_PASS=wordpress -WORDPRESS_DB_HOST=127.0.0.1 -# Should be the same as GRAPHER_DB_PORT in almost all cases -WORDPRESS_DB_PORT=3307 - -# Enable linkage between grapher and wordpress -WORDPRESS_URL=http://localhost:8080 -WORDPRESS_API_USER=admin@example.com -WORDPRESS_API_PASS=admin - GDOCS_PRIVATE_KEY='' GDOCS_CLIENT_EMAIL='' GDOCS_CLIENT_ID='' @@ -53,4 +41,4 @@ ALGOLIA_INDEX_PREFIX='' # optional ALGOLIA_SECRET_KEY='' # optional ALGOLIA_INDEXING=false # optional -DATA_API_URL='' # optional \ No newline at end of file +DATA_API_URL='' # optional diff --git a/.eslintignore b/.eslintignore index 4667d8bf13..de55771e24 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,12 +7,6 @@ jest.config.js knexfile.ts ormconfig.js postcss.config.js -wordpress/web/wp/wp-includes/** -wordpress/web/wp/wp-admin/** -wordpress/web/app/plugins/** -wordpress/web/wp/wp-content/** -!wordpress/web/app/plugins/owid/**/*.js -wordpress/vendor/** packages/@ourworldindata/*/dist/ dist/ .vscode/ diff --git a/.prettierignore b/.prettierignore index e37f3f047b..ba0bf298fc 100644 --- a/.prettierignore +++ b/.prettierignore @@ -6,11 +6,6 @@ itsJustJavascript package.json /.storybook/build coverage -/wordpress/vendor -/wordpress/web/wp -/wordpress/web/app/plugins/* -!/wordpress/web/app/plugins/owid -/wordpress/web/app/uploads packages/@ourworldindata/*/dist/ dist/ grapherData/ diff --git a/.rsync-ignore b/.rsync-ignore index b337496395..939cf515d8 100644 --- a/.rsync-ignore +++ b/.rsync-ignore @@ -12,7 +12,6 @@ tmp *.test.tsx .queue .pending -/wordpress .env clientSettings.json serverSettings.json diff --git a/.vscode/launch.json b/.vscode/launch.json index 0d98f6f557..183e3b26d8 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -111,22 +111,5 @@ "request": "attach", "restart": true }, - { - "name": "Listen for XDebug", - "type": "php", - "request": "launch", - "port": 9003, - "pathMappings": { - "/app/": "${workspaceFolder}/wordpress" - } - }, - { - "name": "Launch currently open script", - "type": "php", - "request": "launch", - "program": "${file}", - "cwd": "${fileDirname}", - "port": 9000 - } ] } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index fd9ce82507..06b9aa1aaa 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -22,7 +22,9 @@ "label": "startTscServer", "type": "shell", "command": "yarn startTscServer", - "problemMatcher": ["$tsc-watch"], + "problemMatcher": [ + "$tsc-watch" + ], "isBackground": true, "presentation": { "group": "watch" @@ -39,7 +41,11 @@ }, { "label": "start (remote)", - "dependsOn": ["buildLerna", "startTscServer", "startSiteFront"], + "dependsOn": [ + "buildLerna", + "startTscServer", + "startSiteFront" + ], "dependsOrder": "sequence", "problemMatcher": [] }, @@ -54,32 +60,6 @@ "dependsOrder": "sequence", "problemMatcher": [] }, - { - "label": "download wordpress database", - "type": "shell", - "command": "./devTools/docker/download-wordpress-mysql.sh" - }, - { - "label": "download wordpress uploads", - "type": "shell", - "command": "./devTools/docker/download-wordpress-uploads.sh" - }, - { - // This tasks refreshes the wordpress DB as well as wordpress uploads. - // Common scenarios: - // option 1 (default): download new db dump and refresh local db. Download uploads. - // option 2: partial fast refresh (update DB only) - // - comment out "download wordpress uploads" below - "label": "refresh wordpress", - "type": "shell", - "command": "docker compose -f docker-compose.full.yml run --rm db-load-data /app/refresh-wordpress-data.sh", - "dependsOrder": "parallel", - "dependsOn": [ - // "download wordpress database" - // "download wordpress uploads" - ], - "problemMatcher": [] - }, { "label": "download grapher metadata", "type": "shell", diff --git a/Makefile b/Makefile index 4816db61c9..521b9fbae5 100644 --- a/Makefile +++ b/Makefile @@ -28,16 +28,15 @@ help: @echo ' make down stop any services still running' @echo ' make refresh (while up) download a new grapher snapshot and update MySQL' @echo ' make refresh.pageviews (while up) download and load pageviews from the private datasette instance' + @echo ' make refresh.full (while up) run refresh and refresh.pageviews and sync images from R2' @echo ' make migrate (while up) run any outstanding db migrations' @echo ' make test run full suite (except db tests) of CI checks including unit tests' @echo ' make dbtest run db test suite that needs a running mysql db' @echo ' make svgtest compare current rendering against reference SVGs' @echo - @echo ' GRAPHER + WORDPRESS (staff-only)' + @echo ' GRAPHER + CLOUDFLARE (staff-only)' @echo ' make up.full start dev environment via docker-compose and tmux' @echo ' make down.full stop any services still running' - @echo ' make refresh.wp download a new wordpress snapshot and update MySQL' - @echo ' make refresh.full do a full MySQL update of both wordpress and grapher' @echo ' make sync-images sync all images from the remote master' @echo ' make update.chart-entities update the charts_x_entities join table' @echo ' make reindex reindex (or initialise) search in Algolia' @@ -103,7 +102,7 @@ up.devcontainer: create-if-missing.env.devcontainer tmp-downloads/owid_metadata. up.full: export DEBUG = 'knex:query' -up.full: require create-if-missing.env.full ../owid-content wordpress/.env tmp-downloads/owid_metadata.sql.gz tmp-downloads/live_wordpress.sql.gz wordpress/web/app/uploads/2022 +up.full: require create-if-missing.env.full ../owid-content tmp-downloads/owid_metadata.sql.gz @make validate.env.full @make check-port-3306 @@ -111,11 +110,10 @@ up.full: require create-if-missing.env.full ../owid-content wordpress/.env tmp-d yarn install yarn lerna run build yarn run tsc -b - yarn buildWordpressPlugin @echo '==> Starting dev environment' tmux new-session -s grapher \ - -n docker 'docker compose -f docker-compose.full.yml up' \; \ + -n docker 'docker compose -f docker-compose.grapher.yml up' \; \ set remain-on-exit on \; \ set-option -g default-shell $(SCRIPT_SHELL) \; \ new-window -n admin \ @@ -138,8 +136,6 @@ migrate: @echo '==> Running DB migrations' rm -rf itsJustJavascript && yarn && yarn buildLerna && yarn buildTsc && yarn runDbMigrations -refresh.full: refresh refresh.wp sync-images - refresh: @echo '==> Downloading chart data' ./devTools/docker/download-grapher-metadata-mysql.sh @@ -154,22 +150,13 @@ refresh.pageviews: @echo '==> Refreshing pageviews' yarn && yarn buildLerna && yarn buildTsc && yarn refreshPageviews -refresh.wp: - @echo '==> Downloading wordpress data' - ./devTools/docker/download-wordpress-mysql.sh - - @echo '==> Updating wordpress data' - @. ./.env && DATA_FOLDER=tmp-downloads ./devTools/docker/refresh-wordpress-data.sh - - @echo '!!! WARNING !!!' - @echo 'If you run this for staging WP, you have to set !Account password! for' - @echo 'tech@ourworldindata.org user to the value from `.env:WORDPRESS_API_PASS`' - @echo 'at https://staging.owid.cloud/wp/wp-admin/user-edit.php?user_id=35' - sync-images: sync-images.preflight-check @echo '==> Syncing images to R2' @. ./.env && ./devTools/docker/sync-s3-images.sh +refresh.full: refresh refresh.pageviews sync-images + @echo '==> Full refresh completed' + sync-images.preflight-check: @echo '==> Checking for rclone' @which rclone >/dev/null 2>&1 || (echo "ERROR: please install rclone -- e.g. brew install rclone"; exit 1) @@ -239,18 +226,6 @@ tmp-downloads/owid_metadata.sql.gz: @echo '==> Downloading metadata' ./devTools/docker/download-grapher-metadata-mysql.sh -tmp-downloads/live_wordpress.sql.gz: - @echo '==> Downloading wordpress data' - ./devTools/docker/download-wordpress-mysql.sh - -wordpress/.env: - @echo 'Copying wordpress/.env.example --> wordpress/.env' - @cp -f wordpress/.env.example wordpress/.env - -wordpress/web/app/uploads/2022: - @echo '==> Downloading wordpress uploads' - ./devTools/docker/download-wordpress-uploads.sh - deploy: @echo '==> Starting from a clean slate...' rm -rf itsJustJavascript diff --git a/README.md b/README.md index c60f108b0a..21fa8b604c 100644 --- a/README.md +++ b/README.md @@ -46,29 +46,19 @@ Each explorer can be configured via a [panel](explorerAdminServer/) in the admin - A [server-side](adminSiteServer/) project that manages the MySQL database used by graphers. -### [WordPress](wordpress/) - -The CMS we use to manage articles published on Our World in Data. It's a relatively stock setup, with a custom plugin to provide additional blocks for the Gutenberg editor. - -Our Wordpress content and configuration is stored in a MySQL database, which currently isn't shared publicly. - -We are currently in the process of migrating off of WordPress to a publishing flow based on [ArchieML](https://archieml.org) with Google Docs. See the [Site README](site/README.md) for more information. - ### [Baker](baker/) -A [PM2](https://github.com/Unitech/pm2) project that builds a static copy of the Our World in Data website by merging the content authored in Wordpress with the grapher charts created in Grapher Admin. +A [PM2](https://github.com/Unitech/pm2) project that builds a static copy of the Our World in Data website by merging the content authored in Gdocs with the grapher charts created in Grapher Admin. ### [Site](site/) The React code for rendering our content in pages, used by the Grapher Admin and Baker. -As of March 2023, code exists for rendering both WordPress posts and Google Docs as we work on the transition away from WordPress. - ## Tooling Much of our code is based around [reactive programming](https://en.wikipedia.org/wiki/Reactive_programming) using [React](https://reactjs.org/) and [Mobx](http://github.com/mobxjs/mobx). -All non-WordPress code is written in [TypeScript](https://www.typescriptlang.org/). +All code is written in [TypeScript](https://www.typescriptlang.org/). If you want to enable pre-commit hooks, run `yarn husky`. diff --git a/adminSiteClient/AdminLayout.tsx b/adminSiteClient/AdminLayout.tsx index bc083bd906..0d8515742d 100644 --- a/adminSiteClient/AdminLayout.tsx +++ b/adminSiteClient/AdminLayout.tsx @@ -107,15 +107,6 @@ export class AdminLayout extends React.Component<{ FAQ -
  • - - Wordpress - -