Skip to content

Commit 8f5cad6

Browse files
Merge pull request #99 from devgateway/task/DVIZ-61/worpress-cleanup
chore(DVIZ-61): General Wordpress cleanup
2 parents 0f3cc00 + c971cf7 commit 8f5cad6

7,355 files changed

Lines changed: 4013 additions & 1452854 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,38 @@
11
wp-theme/_functions.php
22
wp-content/debug.log
33
wp-content/uploads
4+
# Exclude node_modules (289MB+ directories that shouldn't be in build context)
45
node_modules/
6+
data/
57
.git
8+
9+
# Build artifacts
610
dist
11+
*.tgz
12+
13+
# Packages not needed in container
714
packages/create-wp-customizer/
815
packages/upgrade-wp-customizer/
9-
# Log files
10-
*.log
16+
packages/*/node_modules
17+
plugins/*/node_modules
18+
plugins/*/*/node_modules
19+
20+
# Development files
1121
.vscode/
1222
.github/
1323
.idea/
24+
.changeset/
25+
*.log
26+
.env
27+
.env.*
28+
29+
# Docker files
1430
nginx/
15-
docker-compose.*
16-
.changeset/
31+
docker-compose*
32+
Dockerfile*
33+
.dockerignore
34+
35+
# Documentation
36+
README.md
37+
*.md
38+
!wp-theme/README.md

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ dist/
1212
data/
1313
wp-content/uploads/
1414
wp-content/plugins
15+
wp-content/

Dockerfile

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,32 @@ RUN echo "Installing corepack..."
66
ENV COREPACK_INTEGRITY_KEYS=0
77
RUN corepack enable
88

9-
COPY . /app
109
WORKDIR /app
1110

11+
1212
FROM base AS builder
1313
ENV NODE_ENV=production
1414

15+
COPY pnpm-lock.yaml /app/pnpm-lock.yaml
16+
COPY pnpm-workspace.yaml /app/pnpm-workspace.yaml
17+
COPY package.json /app/package.json
18+
19+
#Packages
20+
COPY packages/commons/package.json /app/packages/commons/package.json
21+
COPY plugins/wp-react-blocks-plugin/blocks/package.json /app/plugins/wp-react-blocks-plugin/blocks/package.json
22+
1523
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
16-
--mount=type=bind,source=package.json,target=package.json \
17-
--mount=type=bind,source=pnpm-lock.yaml,target=pnpm-lock.yaml \
18-
--mount=type=bind,source=packages/commons/package.json,target=packages/commons/package.json \
19-
pnpm install --frozen-lockfile
24+
pnpm install --frozen-lockfile --shamefully-hoist
25+
26+
WORKDIR /app
27+
COPY . /app
28+
2029

2130
# Build the plugins
2231
RUN BLOCKS_CATEGORY=wp-react-lib-blocks BLOCKS_NS=viz \
23-
pnpm --filter="@devgateway/dvz-wp-commons" --filter="dg-react-blocks" build
32+
pnpm -r --filter="@devgateway/dvz-wp-commons" --filter="dg-react-blocks" build
2433

2534
# Organize WordPress files to the container
26-
COPY wp-content wp-content
2735
COPY wp-theme wp-content/themes/dg-semantic
2836

2937
# Copy built plugins from workspace into wp-content so built assets are included
@@ -34,7 +42,7 @@ RUN mkdir -p wp-content/plugins \
3442
RUN chown -R 82:82 wp-content \
3543
&& tar -caf /wp-content.tgz --exclude="**/node_modules" wp-content
3644

37-
FROM wordpress:6.8.2-fpm-alpine AS runtime
45+
FROM wordpress:6.9.1-fpm-alpine AS runtime
3846
LABEL org.opencontainers.image.description="WordPress image for Data Viz"
3947
LABEL org.opencontainers.image.authors="Development Gateway <info@developmentgateway.org>"
4048
LABEL org.opencontainers.image.url="https://github.com/devgateway/data-viz-wordpress"
@@ -48,5 +56,7 @@ COPY --chmod=755 wordpress.sh /usr/local/sbin/
4856

4957
EXPOSE 80 443
5058

59+
USER www-data
60+
5161
ENTRYPOINT ["/usr/local/sbin/wordpress.sh"]
5262
CMD ["php-fpm"]

custom/custom.ini

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1-
upload_max_filesize = 20M
2-
post_max_size = 21M
1+
; File upload limits (match nginx client_max_body_size)
2+
upload_max_filesize = 100M
3+
post_max_size = 100M
4+
5+
6+
; Security hardening
7+
expose_php = Off
8+
; display_errors = Off
9+
; log_errors = On

docker-compose.override.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ services:
55
- 80:80
66
volumes:
77
- ./data/wordpress:/var/www/html:ro
8-
- ./wp-content:/var/www/html/wp-content
8+
# - ./wp-content:/var/www/html/wp-content
99
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
1010
- ./plugins/wp-react-blocks-plugin:/var/www/html/wp-content/plugins/wp-react-blocks-plugin
1111
- ./plugins/wp-react-blocks-plugin/blocks/build:/var/www/html/wp-content/plugins/wp-react-blocks-plugin/blocks/build
1212
- ./plugins/wp-react-custom-rest-menu:/var/www/html/wp-content/plugins/wp-react-custom-rest-menu
13-
- ./plugins/wp-react-custom-multilang:/var/www/html/wp-content/plugins/wp-multilang
1413
- ./wp-theme:/var/www/html/wp-content/themes/dg-semantic
1514
depends_on:
1615
- wordpress
@@ -21,14 +20,13 @@ services:
2120
dockerfile: Dockerfile
2221
volumes:
2322
- ./data/wordpress:/var/www/html
24-
- ./wp-content:/var/www/html/wp-content
23+
# - ./wp-content:/var/www/html/wp-content
2524
- ./plugins/wp-react-blocks-plugin:/var/www/html/wp-content/plugins/wp-react-blocks-plugin
2625
- ./plugins/wp-react-blocks-plugin/blocks/build:/var/www/html/wp-content/plugins/wp-react-blocks-plugin/blocks/build
27-
- ./plugins/wp-react-custom-rest-menu:/var/www/html/wp-content/plugins/wp-react-custom-rest-menu
28-
- ./plugins/wp-react-custom-multilang:/var/www/html/wp-content/plugins/wp-multilang
26+
- ./plugins/wp-react-custom-rest-menu:/var/www/html/wp-content/plugins/wp-react-custom-rest-menu
2927
- ./wp-theme:/var/www/html/wp-content/themes/dg-semantic
3028
environment:
31-
environment:
29+
SKIP_WP_UPDATE: true
3230
WORDPRESS_DB_HOST: mysql
3331
WORDPRESS_DB_USER: wordpress
3432
WORDPRESS_DB_PASSWORD: wordpress

docker-compose.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ services:
1616
volumes:
1717
- wordpress:/var/www/html
1818
environment:
19-
environment:
2019
WORDPRESS_DB_HOST: mysql
2120
WORDPRESS_DB_USER: wordpress
2221
WORDPRESS_DB_PASSWORD: wordpress
2322
WORDPRESS_DB_NAME: wordpress
2423
depends_on:
25-
- mysql
24+
mysql:
25+
condition: service_healthy
26+
restart: unless-stopped
2627

2728
mysql:
2829
image: mariadb:10.7-focal
@@ -33,7 +34,8 @@ services:
3334
MYSQL_DATABASE: wordpress
3435
MYSQL_USER: wordpress
3536
MYSQL_PASSWORD: wordpress
37+
restart: unless-stopped
3638

3739
volumes:
38-
wordpress_data:
40+
wordpress:
3941
mysql:

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"packageManager": "pnpm@10.18.1",
3434
"devDependencies": {
3535
"@changesets/changelog-github": "^0.5.1",
36-
"@changesets/cli": "^2.29.7"
36+
"@changesets/cli": "^2.29.7",
37+
"@wordpress/scripts": "^30.25.0"
3738
}
3839
}

plugins-required.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# WordPress Plugins
2+
3+
## wp-content/plugins
4+
- Advanced Custom Fields
5+
- Akismet Anti-spam
6+
- Better Search Replace
7+
- Custom Post Type Permalinks
8+
- Custom Post Type UI
9+
- Custom Taxonomy Order NE
10+
- Duplicate WP Page Post
11+
- Flexible Table Block
12+
- Folders
13+
- Hyperlink Group Block
14+
- Intuitive Custom Post Order
15+
- Menu Image
16+
- Post Types Order
17+
- Simple Post Type Permalinks
18+
- SVG Support
19+
- WordPress Importer
20+
- Yoast SEO
21+
- WP Database Backup
22+
23+
## wp-theme/plugins
24+
- Advanced Custom Fields
25+
- Akismet Anti-spam
26+
- Better Search Replace
27+
- Custom Post Type Permalinks
28+
- Custom Post Type UI
29+
- Duplicate WP Page Post
30+
- SVG Support
31+
- WordPress Importer
32+
- Yoast SEO
33+
- WP Multilang
Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,2 @@
11
<?php
2-
/**
3-
* Plugin Name: React Components
4-
* Plugin URI: https://github.com/devgateway/wp-rteact-lib
5-
* Description: Custom UI Components for viz.
6-
* Version: 0.1.2
7-
* Author: Sebastian Dimunzio
8-
* @package dg
9-
*/
10-
defined( 'ABSPATH' ) || exit;
11-
12-
function add_custom_block_categories( $categories, $post ) {
13-
return array_merge(
14-
$categories,
15-
array(
16-
array(
17-
'slug' => 'wp-react-lib-blocks',
18-
'title' => __( 'React Blocks', 'wp-react-lib-blocks' ),
19-
),
20-
)
21-
);
22-
}
23-
add_filter( 'block_categories', 'add_custom_block_categories', 10, 2);
24-
25-
26-
function register_scripts(){
27-
wp_register_script( 'dummy-handle-header2', '' );
28-
29-
30-
wp_enqueue_script( 'dummy-handle-header2' );
31-
32-
if (function_exists('wpm_get_language')) {
33-
wp_add_inline_script( 'dummy-handle-header2', '
34-
console.log("----- Language -----'.wpm_get_language().'----------") ;
35-
console.log("---- -User Language -----'.wpm_get_user_language().'----------") ;
36-
window._user_locale="'.wpm_get_user_language().'" ;
37-
window._page_locale="'.wpm_get_language().'" ;' );
38-
}else{
39-
wp_add_inline_script( 'dummy-handle-header2', '
40-
console.log("---------- en ----------") ;
41-
console.log("---------- en ----------") ;
42-
window._user_locale="en" ;
43-
window._page_locale="en" ;' );
44-
45-
}
46-
47-
}
48-
add_action( 'admin_enqueue_scripts', 'register_scripts' );
49-
50-
51-
52-
53-
include 'blocks/index.php';
54-
2+
// Silence is golden.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
/**
3+
* Plugin Name: React Components
4+
* Plugin URI: https://github.com/devgateway/wp-rteact-lib
5+
* Description: Custom UI Components for viz.
6+
* Version: 0.1.2
7+
* Author: Sebastian Dimunzio
8+
* @package dg
9+
*/
10+
defined( 'ABSPATH' ) || exit;
11+
12+
function add_custom_block_categories( $categories, $post ) {
13+
return array_merge(
14+
$categories,
15+
array(
16+
array(
17+
'slug' => 'wp-react-lib-blocks',
18+
'title' => __( 'React Blocks', 'wp-react-lib-blocks' ),
19+
),
20+
)
21+
);
22+
}
23+
add_filter( 'block_categories', 'add_custom_block_categories', 10, 2);
24+
25+
26+
function register_scripts(){
27+
wp_register_script( 'dummy-handle-header2', '' );
28+
29+
30+
wp_enqueue_script( 'dummy-handle-header2' );
31+
32+
if (function_exists('wpm_get_language')) {
33+
wp_add_inline_script( 'dummy-handle-header2', '
34+
console.log("----- Language -----'.wpm_get_language().'----------") ;
35+
console.log("---- -User Language -----'.wpm_get_user_language().'----------") ;
36+
window._user_locale="'.wpm_get_user_language().'" ;
37+
window._page_locale="'.wpm_get_language().'" ;' );
38+
}else{
39+
wp_add_inline_script( 'dummy-handle-header2', '
40+
console.log("---------- en ----------") ;
41+
console.log("---------- en ----------") ;
42+
window._user_locale="en" ;
43+
window._page_locale="en" ;' );
44+
45+
}
46+
47+
}
48+
add_action( 'admin_enqueue_scripts', 'register_scripts' );
49+
50+
51+
52+
53+
include 'blocks/index.php';
54+

0 commit comments

Comments
 (0)