├── .gitignore ├── README.md ├── SECURITY.md ├── configs ├── babel.config.js ├── package.json ├── webpack.config.js ├── webpack.mu-plugins.config.js ├── webpack.plugins.config.js └── webpack.themes.config.js └── src ├── core └── wp-config-sample.php ├── mu-plugins ├── configs │ └── load.php └── plugins │ └── reactwp │ ├── js │ └── App.js │ ├── medias │ ├── Medias.js │ ├── audios │ │ └── .gitkeep │ ├── fonts │ │ └── .gitkeep │ ├── images │ │ └── .gitkeep │ ├── others │ │ └── .gitkeep │ └── videos │ │ └── .gitkeep │ ├── scss │ └── App.scss │ └── template │ ├── inc │ ├── firstload.php │ ├── render.php │ └── utils.php │ ├── index.php │ └── init.php ├── plugins ├── reactwp-accept-svg │ ├── js │ │ └── App.js │ ├── medias │ │ ├── Medias.js │ │ ├── audios │ │ │ └── .gitkeep │ │ ├── fonts │ │ │ └── .gitkeep │ │ ├── images │ │ │ └── .gitkeep │ │ ├── others │ │ │ └── .gitkeep │ │ └── videos │ │ │ └── .gitkeep │ ├── scss │ │ └── App.scss │ └── template │ │ ├── index.php │ │ ├── init.php │ │ └── uninstall.php ├── reactwp-acf-local-json │ ├── js │ │ └── App.js │ ├── medias │ │ ├── Medias.js │ │ ├── audios │ │ │ └── .gitkeep │ │ ├── fonts │ │ │ └── .gitkeep │ │ ├── images │ │ │ └── .gitkeep │ │ ├── others │ │ │ └── .gitkeep │ │ └── videos │ │ │ └── .gitkeep │ ├── scss │ │ └── App.scss │ └── template │ │ ├── index.php │ │ ├── init.php │ │ └── uninstall.php ├── reactwp-backend │ ├── js │ │ └── App.js │ ├── medias │ │ ├── Medias.js │ │ ├── audios │ │ │ └── .gitkeep │ │ ├── fonts │ │ │ └── .gitkeep │ │ ├── images │ │ │ └── .gitkeep │ │ ├── others │ │ │ └── .gitkeep │ │ └── videos │ │ │ └── .gitkeep │ ├── scss │ │ └── App.scss │ └── template │ │ ├── index.php │ │ ├── init.php │ │ └── uninstall.php ├── reactwp-frontend │ ├── js │ │ └── App.js │ ├── medias │ │ ├── Medias.js │ │ ├── audios │ │ │ └── .gitkeep │ │ ├── fonts │ │ │ └── .gitkeep │ │ ├── images │ │ │ └── .gitkeep │ │ ├── others │ │ │ └── .gitkeep │ │ └── videos │ │ │ └── .gitkeep │ ├── scss │ │ └── App.scss │ └── template │ │ ├── index.php │ │ ├── init.php │ │ └── uninstall.php ├── reactwp-images │ ├── js │ │ └── App.js │ ├── medias │ │ ├── Medias.js │ │ ├── audios │ │ │ └── .gitkeep │ │ ├── fonts │ │ │ └── .gitkeep │ │ ├── images │ │ │ └── .gitkeep │ │ ├── others │ │ │ └── .gitkeep │ │ └── videos │ │ │ └── .gitkeep │ ├── scss │ │ └── App.scss │ └── template │ │ ├── index.php │ │ ├── init.php │ │ └── uninstall.php └── reactwp-seo │ ├── js │ └── App.js │ ├── medias │ ├── Medias.js │ ├── audios │ │ └── .gitkeep │ ├── fonts │ │ └── .gitkeep │ ├── images │ │ └── .gitkeep │ ├── others │ │ └── .gitkeep │ └── videos │ │ └── .gitkeep │ ├── scss │ └── App.scss │ └── template │ ├── inc │ └── render.php │ ├── index.php │ ├── init.php │ └── uninstall.php └── themes └── reactwp ├── js ├── App.jsx ├── inc │ ├── Loader.js │ ├── Metas.jsx │ ├── PageTransition.js │ └── Scroller.js └── templates │ ├── Default.jsx │ ├── NotFound.jsx │ └── components │ ├── Button.jsx │ ├── Contents.jsx │ ├── Image.jsx │ ├── Video.jsx │ └── Wrapper.jsx ├── medias ├── Medias.js ├── audios │ └── .gitkeep ├── fonts │ └── .gitkeep ├── images │ └── .gitkeep ├── others │ └── .gitkeep └── videos │ └── .gitkeep ├── scss ├── App.scss ├── inc │ ├── _base.scss │ ├── _font-face.scss │ ├── _functions.scss │ ├── _mixins.scss │ └── _variables.scss └── templates │ ├── _footer.scss │ └── _header.scss └── template ├── 404.php ├── footer.php ├── functions.php ├── header.php ├── index.php └── style.css /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | package-lock.json 4 | wp-config.php 5 | .htaccess 6 | .npmrc -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![ReactWP](https://reactwp.com/github-image/banner-black.jpg) 2 | 3 | ![Built](https://img.shields.io/badge/Built-Webpack-blue) 4 | ![Multisite Ready](https://img.shields.io/badge/Work%20With%20Multisite-Yes-brightgreen) 5 | ![Server](https://img.shields.io/badge/Server-PHP-orange) 6 | 7 | 8 | ReactWP is a modern boilerplate for building full React-based themes inside WordPress, without going headless. 9 | 10 | 11 | # Why ReactWP exists 12 | 13 | Most WordPress developers face a tough choice: 14 | 15 | - Stick with their outdated stack 16 | - Jump into a fully headless setup with Next.js or Gatsby, which is often complex and useless 17 | 18 | ***ReactWP offers a middle path.*** You keep the WordPress ecosystem. You get the React developer experience. You skip the pain of APIs and complex setups. 19 | 20 | 21 | 22 | # The vision 23 | 24 | ReactWP doesn’t try to replace WordPress. It enhances it. 25 | 26 | You keep the CMS that works. You use the frontend tools you love. Your clients still get WordPress. Your devs get React. You get a smooth workflow that doesn’t fight the platform. 27 | 28 | 29 | # Useful links 30 | 31 | - [Demo](https://github.com/studiochampgauche/studiochampgauche-network) 32 | - [ReactWP website](https://reactwp.com) 33 | - [Documentations](https://reactwp.com/docs) (In progress) -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | security@reactwp.com -------------------------------------------------------------------------------- /configs/babel.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | presets: [ 3 | '@babel/preset-env', 4 | '@babel/preset-react' 5 | ] 6 | }; -------------------------------------------------------------------------------- /configs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "configs", 3 | "version": "1.0.0", 4 | "description": "", 5 | "type": "module", 6 | "scripts": { 7 | "build": "webpack --mode development", 8 | "build:themes": "webpack --mode development --config webpack.themes.config.js", 9 | "build:plugins": "webpack --mode development --config webpack.plugins.config.js", 10 | "build:mu-plugins": "webpack --mode development --config webpack.mu-plugins.config.js", 11 | "watch": "webpack --mode development --watch", 12 | "watch:themes": "webpack --mode development --config webpack.themes.config.js --watch", 13 | "watch:plugins": "webpack --mode development --config webpack.plugins.config.js --watch", 14 | "watch:mu-plugins": "webpack --mode development --config webpack.mu-plugins.config.js --watch", 15 | "prod": "webpack --mode production", 16 | "prod:themes": "webpack --mode production --config webpack.themes.config.js", 17 | "prod:plugins": "webpack --mode production --config webpack.plugins.config.js", 18 | "prod:mu-plugins": "webpack --mode production --config webpack.mu-plugins.config.js", 19 | "get:core": "curl -LO http://wordpress.org/latest.zip && cd ../ && mkdir dist && cd configs && mv latest.zip ../dist/ && unzip -d ../dist/ ../dist/latest.zip && rm ../dist/latest.zip && mv ../dist/wordpress/* ../dist/ && rm -rf ../dist/wordpress && rm -rf ../dist/wp-content/plugins/akismet && rm ../dist/wp-content/plugins/hello.php && rm -rf ../dist/wp-content/themes/twenty* && curl -LO http://reactwp.com/download/plugins/advanced-custom-fields-pro.zip && cd ../dist/wp-content && mkdir mu-plugins && cd ../../configs && mv advanced-custom-fields-pro.zip ../dist/wp-content/mu-plugins && unzip -d ../dist/wp-content/mu-plugins ../dist/wp-content/mu-plugins/advanced-custom-fields-pro.zip && rm ../dist/wp-content/mu-plugins/advanced-custom-fields-pro.zip" 20 | }, 21 | "devDependencies": { 22 | "@babel/core": "7.27.4", 23 | "@babel/preset-env": "7.27.2", 24 | "@babel/preset-react": "7.27.1", 25 | "@fortawesome/fontawesome-svg-core": "6.7.2", 26 | "@fortawesome/free-brands-svg-icons": "6.7.2", 27 | "@fortawesome/free-regular-svg-icons": "6.7.2", 28 | "@fortawesome/free-solid-svg-icons": "6.7.2", 29 | "@fortawesome/react-fontawesome": "0.2.2", 30 | "babel-loader": "10.0.0", 31 | "copy-webpack-plugin": "13.0.0", 32 | "file-loader": "6.2.0", 33 | "gsap": "^3.13.0", 34 | "image-minimizer-webpack-plugin": "4.1.3", 35 | "imagemin": "9.0.1", 36 | "imagemin-gifsicle": "7.0.0", 37 | "imagemin-jpegtran": "8.0.0", 38 | "imagemin-mozjpeg": "10.0.0", 39 | "imagemin-optipng": "8.0.0", 40 | "imagemin-pngquant": "10.0.0", 41 | "imagemin-svgo": "11.0.1", 42 | "path": "0.12.7", 43 | "react": "19.1.0", 44 | "react-dom": "19.1.0", 45 | "react-helmet-async": "2.0.5", 46 | "react-router-dom": "7.6.2", 47 | "sass": "1.89.1", 48 | "sass-loader": "16.0.5", 49 | "terser-webpack-plugin": "5.3.14", 50 | "url": "0.11.4", 51 | "webpack": "5.99.9", 52 | "webpack-cli": "6.0.1" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /configs/webpack.config.js: -------------------------------------------------------------------------------- 1 | import themes from './webpack.themes.config.js'; 2 | import plugins from './webpack.plugins.config.js'; 3 | import muPlugins from './webpack.mu-plugins.config.js'; 4 | 5 | export default [ 6 | themes, 7 | plugins, 8 | muPlugins 9 | ]; -------------------------------------------------------------------------------- /configs/webpack.mu-plugins.config.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { fileURLToPath } from 'url'; 3 | import CopyPlugin from 'copy-webpack-plugin'; 4 | import TerserPlugin from 'terser-webpack-plugin'; 5 | import ImageMinimizerPlugin from 'image-minimizer-webpack-plugin'; 6 | 7 | const __filename = fileURLToPath(import.meta.url); 8 | const __dirname = path.dirname(__filename); 9 | 10 | const plugins = [ 11 | 'reactwp' 12 | ]; 13 | 14 | const main = { 15 | cache: true, 16 | entry: plugins.reduce((entries, pluginName) => { 17 | 18 | entries[pluginName] = [ 19 | `../src/mu-plugins/plugins/${pluginName}/js/App.js`, 20 | `../src/mu-plugins/plugins/${pluginName}/scss/App.scss`, 21 | `../src/mu-plugins/plugins/${pluginName}/medias/Medias.js` 22 | ]; 23 | 24 | return entries; 25 | 26 | }, {}), 27 | output: { 28 | filename: '[name]/assets/js/[name].min.js', 29 | path: path.resolve(__dirname, '../dist/wp-content/mu-plugins/') 30 | }, 31 | module: { 32 | rules: [ 33 | { 34 | test: /\.jsx?$/, 35 | exclude: /node_modules/, 36 | use: { 37 | loader: 'babel-loader', 38 | }, 39 | }, 40 | { 41 | test: /\.s[ac]ss$/i, 42 | use: [ 43 | { 44 | loader: 'file-loader', 45 | options: { 46 | name: (file) => { 47 | 48 | 49 | const index = plugins.findIndex(plugin => file.includes(plugin)); 50 | const pluginName = plugins[index]; 51 | 52 | return `${pluginName}/assets/css/${pluginName}.min.css`; 53 | }, 54 | } 55 | }, 56 | 'sass-loader' 57 | ], 58 | }, 59 | { 60 | test: /\.(png|jpg|jpeg|gif|svg|webp)$/i, 61 | use: [ 62 | { 63 | loader: 'file-loader', 64 | options: { 65 | name: (file) => { 66 | 67 | const index = plugins.findIndex(plugin => file.includes(plugin)); 68 | const pluginName = plugins[index]; 69 | 70 | return `${pluginName}/assets/images/[name].[ext]`; 71 | } 72 | } 73 | } 74 | ] 75 | }, 76 | { 77 | test: /\.(mp4)$/i, 78 | use: [ 79 | { 80 | loader: 'file-loader', 81 | options: { 82 | name: (file) => { 83 | 84 | const index = plugins.findIndex(plugin => file.includes(plugin)); 85 | const pluginName = plugins[index]; 86 | 87 | return `${pluginName}/assets/videos/[name].[ext]`; 88 | } 89 | } 90 | } 91 | ] 92 | }, 93 | { 94 | test: /\.(mp3)$/i, 95 | use: [ 96 | { 97 | loader: 'file-loader', 98 | options: { 99 | name: (file) => { 100 | 101 | const index = plugins.findIndex(plugin => file.includes(plugin)); 102 | const pluginName = plugins[index]; 103 | 104 | return `${pluginName}/assets/audios/[name].[ext]`; 105 | } 106 | } 107 | } 108 | ] 109 | }, 110 | { 111 | test: /\.(woff|woff2|eot|ttf|otf)$/i, 112 | use: [ 113 | { 114 | loader: 'file-loader', 115 | options: { 116 | name: (file) => { 117 | 118 | const index = plugins.findIndex(plugin => file.includes(plugin)); 119 | const pluginName = plugins[index]; 120 | 121 | return `${pluginName}/assets/fonts/[name].[ext]`; 122 | } 123 | } 124 | } 125 | ] 126 | }, 127 | ], 128 | }, 129 | plugins: [ 130 | new CopyPlugin({ 131 | patterns: [ 132 | { 133 | from: '../src/mu-plugins/configs', 134 | to: path.resolve(__dirname, `../dist/wp-content/mu-plugins/`), 135 | noErrorOnMissing: true, 136 | }, 137 | ...plugins.map(pluginName => ({ 138 | from: path.resolve(__dirname, `../src/mu-plugins/plugins/${pluginName}/template`), 139 | to: path.resolve(__dirname, `../dist/wp-content/mu-plugins/${pluginName}`), 140 | noErrorOnMissing: true, 141 | })) 142 | ] 143 | }), 144 | ], 145 | optimization: { 146 | minimizer: [ 147 | new ImageMinimizerPlugin({ 148 | minimizer: { 149 | implementation: ImageMinimizerPlugin.imageminMinify, 150 | options: { 151 | plugins: [ 152 | ['gifsicle', { interlaced: true }], 153 | ['jpegtran', { progressive: true }], 154 | ['mozjpeg', { quality: 75 }], 155 | ['optipng', { optimizationLevel: 5 }], 156 | ['pngquant', { quality: [0.65, 0.90], speed: 4, }], 157 | ['svgo', { plugins: [{ name: 'preset-default', params: { overrides: { removeViewBox: false }}}]}] 158 | ], 159 | }, 160 | }, 161 | }), 162 | new TerserPlugin() 163 | ], 164 | }, 165 | resolve: { 166 | modules: [ 167 | path.resolve(__dirname, 'node_modules') 168 | ], 169 | extensions: ['.js', '.jsx'] 170 | } 171 | }; 172 | 173 | 174 | export default main; -------------------------------------------------------------------------------- /configs/webpack.plugins.config.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { fileURLToPath } from 'url'; 3 | import CopyPlugin from 'copy-webpack-plugin'; 4 | import TerserPlugin from 'terser-webpack-plugin'; 5 | import ImageMinimizerPlugin from 'image-minimizer-webpack-plugin'; 6 | 7 | const __filename = fileURLToPath(import.meta.url); 8 | const __dirname = path.dirname(__filename); 9 | 10 | const plugins = [ 11 | 'reactwp-frontend', 12 | 'reactwp-backend', 13 | 'reactwp-images', 14 | 'reactwp-accept-svg', 15 | 'reactwp-acf-local-json', 16 | 'reactwp-seo' 17 | ]; 18 | 19 | const main = { 20 | cache: true, 21 | entry: plugins.reduce((entries, pluginName) => { 22 | 23 | entries[pluginName] = [ 24 | `../src/plugins/${pluginName}/js/App.js`, 25 | `../src/plugins/${pluginName}/scss/App.scss`, 26 | `../src/plugins/${pluginName}/medias/Medias.js` 27 | ]; 28 | 29 | return entries; 30 | 31 | }, {}), 32 | output: { 33 | filename: '[name]/assets/js/[name].min.js', 34 | path: path.resolve(__dirname, '../dist/wp-content/plugins/') 35 | }, 36 | module: { 37 | rules: [ 38 | { 39 | test: /\.jsx?$/, 40 | exclude: /node_modules/, 41 | use: { 42 | loader: 'babel-loader', 43 | }, 44 | }, 45 | { 46 | test: /\.s[ac]ss$/i, 47 | use: [ 48 | { 49 | loader: 'file-loader', 50 | options: { 51 | name: (file) => { 52 | 53 | 54 | const index = plugins.findIndex(plugin => file.includes(plugin)); 55 | const pluginName = plugins[index]; 56 | 57 | return `${pluginName}/assets/css/${pluginName}.min.css`; 58 | }, 59 | } 60 | }, 61 | 'sass-loader' 62 | ], 63 | }, 64 | { 65 | test: /\.(png|jpg|jpeg|gif|svg|webp)$/i, 66 | use: [ 67 | { 68 | loader: 'file-loader', 69 | options: { 70 | name: (file) => { 71 | 72 | const index = plugins.findIndex(plugin => file.includes(plugin)); 73 | const pluginName = plugins[index]; 74 | 75 | return `${pluginName}/assets/images/[name].[ext]`; 76 | } 77 | } 78 | } 79 | ] 80 | }, 81 | { 82 | test: /\.(mp4)$/i, 83 | use: [ 84 | { 85 | loader: 'file-loader', 86 | options: { 87 | name: (file) => { 88 | 89 | const index = plugins.findIndex(plugin => file.includes(plugin)); 90 | const pluginName = plugins[index]; 91 | 92 | return `${pluginName}/assets/videos/[name].[ext]`; 93 | } 94 | } 95 | } 96 | ] 97 | }, 98 | { 99 | test: /\.(mp3)$/i, 100 | use: [ 101 | { 102 | loader: 'file-loader', 103 | options: { 104 | name: (file) => { 105 | 106 | const index = plugins.findIndex(plugin => file.includes(plugin)); 107 | const pluginName = plugins[index]; 108 | 109 | return `${pluginName}/assets/audios/[name].[ext]`; 110 | } 111 | } 112 | } 113 | ] 114 | }, 115 | { 116 | test: /\.(woff|woff2|eot|ttf|otf)$/i, 117 | use: [ 118 | { 119 | loader: 'file-loader', 120 | options: { 121 | name: (file) => { 122 | 123 | const index = plugins.findIndex(plugin => file.includes(plugin)); 124 | const pluginName = plugins[index]; 125 | 126 | return `${pluginName}/assets/fonts/[name].[ext]`; 127 | } 128 | } 129 | } 130 | ] 131 | }, 132 | ], 133 | }, 134 | plugins: [ 135 | new CopyPlugin({ 136 | patterns: [ 137 | ...plugins.map(pluginName => ({ 138 | from: path.resolve(__dirname, `../src/plugins/${pluginName}/template`), 139 | to: path.resolve(__dirname, `../dist/wp-content/plugins/${pluginName}`), 140 | noErrorOnMissing: true, 141 | })) 142 | ] 143 | }), 144 | ], 145 | optimization: { 146 | minimizer: [ 147 | new ImageMinimizerPlugin({ 148 | minimizer: { 149 | implementation: ImageMinimizerPlugin.imageminMinify, 150 | options: { 151 | plugins: [ 152 | ['gifsicle', { interlaced: true }], 153 | ['jpegtran', { progressive: true }], 154 | ['mozjpeg', { quality: 75 }], 155 | ['optipng', { optimizationLevel: 5 }], 156 | ['pngquant', { quality: [0.65, 0.90], speed: 4, }], 157 | ['svgo', { plugins: [{ name: 'preset-default', params: { overrides: { removeViewBox: false }}}]}] 158 | ], 159 | }, 160 | }, 161 | }), 162 | new TerserPlugin() 163 | ], 164 | }, 165 | resolve: { 166 | modules: [ 167 | path.resolve(__dirname, 'node_modules') 168 | ], 169 | extensions: ['.js', '.jsx'] 170 | } 171 | }; 172 | 173 | 174 | export default main; -------------------------------------------------------------------------------- /configs/webpack.themes.config.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { fileURLToPath } from 'url'; 3 | import CopyPlugin from 'copy-webpack-plugin'; 4 | import TerserPlugin from 'terser-webpack-plugin'; 5 | import ImageMinimizerPlugin from 'image-minimizer-webpack-plugin'; 6 | 7 | const __filename = fileURLToPath(import.meta.url); 8 | const __dirname = path.dirname(__filename); 9 | 10 | const themes = [ 11 | 'reactwp' 12 | ]; 13 | 14 | const main = { 15 | cache: true, 16 | entry: themes.reduce((entries, themeName) => { 17 | 18 | entries[themeName] = [ 19 | `../src/themes/${themeName}/js/App.jsx`, 20 | `../src/themes/${themeName}/scss/App.scss`, 21 | `../src/themes/${themeName}/medias/Medias.js` 22 | ]; 23 | 24 | return entries; 25 | 26 | }, {}), 27 | output: { 28 | filename: '[name]/assets/js/[name].min.js', 29 | path: path.resolve(__dirname, '../dist/wp-content/themes/') 30 | }, 31 | module: { 32 | rules: [ 33 | { 34 | test: /\.jsx?$/, 35 | exclude: /node_modules/, 36 | use: { 37 | loader: 'babel-loader', 38 | }, 39 | }, 40 | { 41 | test: /\.s[ac]ss$/i, 42 | use: [ 43 | { 44 | loader: 'file-loader', 45 | options: { 46 | name: (file) => { 47 | 48 | 49 | const index = themes.findIndex(theme => file.includes(theme)); 50 | const themeName = themes[index]; 51 | 52 | return `${themeName}/assets/css/${themeName}.min.css`; 53 | } 54 | } 55 | }, 56 | 'sass-loader' 57 | ], 58 | }, 59 | { 60 | test: /\.(png|jpg|jpeg|gif|svg|webp)$/i, 61 | use: [ 62 | { 63 | loader: 'file-loader', 64 | options: { 65 | name: (file) => { 66 | 67 | const index = themes.findIndex(theme => file.includes(theme)); 68 | const themeName = themes[index]; 69 | 70 | return `${themeName}/assets/images/[name].[ext]`; 71 | } 72 | } 73 | } 74 | ] 75 | }, 76 | { 77 | test: /\.(mp4)$/i, 78 | use: [ 79 | { 80 | loader: 'file-loader', 81 | options: { 82 | name: (file) => { 83 | 84 | const index = themes.findIndex(theme => file.includes(theme)); 85 | const themeName = themes[index]; 86 | 87 | return `${themeName}/assets/videos/[name].[ext]`; 88 | } 89 | } 90 | } 91 | ] 92 | }, 93 | { 94 | test: /\.(mp3)$/i, 95 | use: [ 96 | { 97 | loader: 'file-loader', 98 | options: { 99 | name: (file) => { 100 | 101 | const index = themes.findIndex(theme => file.includes(theme)); 102 | const themeName = themes[index]; 103 | 104 | return `${themeName}/assets/audios/[name].[ext]`; 105 | } 106 | } 107 | } 108 | ] 109 | }, 110 | { 111 | test: /\.(woff|woff2|eot|ttf|otf)$/i, 112 | use: [ 113 | { 114 | loader: 'file-loader', 115 | options: { 116 | name: (file) => { 117 | 118 | const index = themes.findIndex(theme => file.includes(theme)); 119 | const themeName = themes[index]; 120 | 121 | return `${themeName}/assets/fonts/[name].[ext]`; 122 | } 123 | } 124 | } 125 | ] 126 | }, 127 | ], 128 | }, 129 | plugins: [ 130 | new CopyPlugin({ 131 | patterns: [ 132 | { 133 | from: '../src/core', 134 | to: path.resolve(__dirname, '../dist'), 135 | noErrorOnMissing: true 136 | }, 137 | ...themes.map(themeName => ({ 138 | from: path.resolve(__dirname, `../src/themes/${themeName}/template`), 139 | to: path.resolve(__dirname, `../dist/wp-content/themes/${themeName}`), 140 | noErrorOnMissing: true, 141 | })) 142 | ] 143 | }), 144 | ], 145 | optimization: { 146 | minimizer: [ 147 | new ImageMinimizerPlugin({ 148 | minimizer: { 149 | implementation: ImageMinimizerPlugin.imageminMinify, 150 | options: { 151 | plugins: [ 152 | ['gifsicle', { interlaced: true }], 153 | ['jpegtran', { progressive: true }], 154 | ['mozjpeg', { quality: 75 }], 155 | ['optipng', { optimizationLevel: 5 }], 156 | ['pngquant', { quality: [0.65, 0.90], speed: 4, }], 157 | ['svgo', { plugins: [{ name: 'preset-default', params: { overrides: { removeViewBox: false }}}]}] 158 | ], 159 | }, 160 | }, 161 | }), 162 | new TerserPlugin() 163 | ], 164 | }, 165 | resolve: { 166 | modules: [ 167 | path.resolve(__dirname, 'node_modules') 168 | ], 169 | extensions: ['.js', '.jsx'] 170 | } 171 | }; 172 | 173 | 174 | export default main; -------------------------------------------------------------------------------- /src/core/wp-config-sample.php: -------------------------------------------------------------------------------- 1 | ['publish', 'draft']])->posts as $item){ 13 | 14 | wp_delete_post($item->ID, true); 15 | 16 | } 17 | 18 | 19 | /* 20 | * Create Home Page 21 | */ 22 | $homePageArgs = array( 23 | 'post_title' => CL === 'fr' ? 'Accueil' : 'Home', 24 | 'post_type' => 'page', 25 | 'post_content' => '', 26 | 'post_status' => 'publish', 27 | 'post_author' => 1, 28 | ); 29 | $homePage_id = wp_insert_post($homePageArgs); 30 | 31 | 32 | /* 33 | * Set home page as a Static Page 34 | */ 35 | update_option('show_on_front', 'page'); 36 | update_option('page_on_front', $homePage_id); 37 | 38 | 39 | /* 40 | * Update permalink Structure 41 | */ 42 | update_option('permalink_structure', '/%postname%/'); 43 | flush_rewrite_rules(); 44 | 45 | 46 | /* 47 | * Languages 48 | */ 49 | update_field('field_67a8554331600', [ 50 | [ 51 | 'name' => 'Français', 52 | 'locale' => 'fr_CA', 53 | 'code' => 'fr', 54 | ], 55 | [ 56 | 'name' => 'English', 57 | 'locale' => 'en_CA', 58 | 'code' => 'en', 59 | ] 60 | ], 'option'); 61 | 62 | 63 | /* 64 | * Theme locations 65 | */ 66 | update_field('field_678bca18008f5', [ 67 | [ 68 | 'name_fr' => 'Menu principal', 69 | 'name_en' => 'Main Menu', 70 | 'slug' => 'main_menu', 71 | ] 72 | ], 'option'); 73 | 74 | } 75 | 76 | }, 11); -------------------------------------------------------------------------------- /src/mu-plugins/plugins/reactwp/template/inc/render.php: -------------------------------------------------------------------------------- 1 | 'Site settings', 14 | 'menu_slug' => 'site-settings', 15 | 'position' => '', 16 | 'redirect' => false, 17 | )); 18 | 19 | 20 | /* 21 | * Add theme settings page 22 | */ 23 | acf_add_options_page(array( 24 | 'page_title' => 'Theme settings', 25 | 'menu_slug' => 'theme-settings', 26 | 'position' => '', 27 | 'redirect' => false, 28 | )); 29 | 30 | 31 | /* 32 | * Add languages to site-settings 33 | */ 34 | acf_add_local_field_group( array( 35 | 'key' => 'group_67a8554341c42', 36 | 'title' => 'Langues', 37 | 'fields' => array( 38 | array( 39 | 'key' => 'field_67a8554331600', 40 | 'label' => 'Langs', 41 | 'name' => 'langs', 42 | 'aria-label' => '', 43 | 'type' => 'repeater', 44 | 'instructions' => '', 45 | 'required' => 0, 46 | 'conditional_logic' => 0, 47 | 'wrapper' => array( 48 | 'width' => '', 49 | 'class' => '', 50 | 'id' => '', 51 | ), 52 | 'layout' => 'table', 53 | 'pagination' => 0, 54 | 'min' => 0, 55 | 'max' => 5, 56 | 'collapsed' => '', 57 | 'button_label' => 'Add lang', 58 | 'rows_per_page' => 20, 59 | 'sub_fields' => array( 60 | array( 61 | 'key' => 'field_67a8556a31601', 62 | 'label' => 'Name', 63 | 'name' => 'name', 64 | 'aria-label' => '', 65 | 'type' => 'text', 66 | 'instructions' => '', 67 | 'required' => 0, 68 | 'conditional_logic' => 0, 69 | 'wrapper' => array( 70 | 'width' => '', 71 | 'class' => '', 72 | 'id' => '', 73 | ), 74 | 'default_value' => '', 75 | 'maxlength' => '', 76 | 'allow_in_bindings' => 0, 77 | 'placeholder' => '', 78 | 'prepend' => '', 79 | 'append' => '', 80 | 'parent_repeater' => 'field_67a8554331600', 81 | ), 82 | array( 83 | 'key' => 'field_67a8558631603', 84 | 'label' => 'Code', 85 | 'name' => 'code', 86 | 'aria-label' => '', 87 | 'type' => 'text', 88 | 'instructions' => '', 89 | 'required' => 0, 90 | 'conditional_logic' => 0, 91 | 'wrapper' => array( 92 | 'width' => '', 93 | 'class' => '', 94 | 'id' => '', 95 | ), 96 | 'default_value' => '', 97 | 'maxlength' => '', 98 | 'allow_in_bindings' => 0, 99 | 'placeholder' => '', 100 | 'prepend' => '', 101 | 'append' => '', 102 | 'parent_repeater' => 'field_67a8554331600', 103 | ), 104 | ), 105 | ), 106 | ), 107 | 'location' => array( 108 | array( 109 | array( 110 | 'param' => 'options_page', 111 | 'operator' => '==', 112 | 'value' => 'site-settings', 113 | ), 114 | ), 115 | ), 116 | 'menu_order' => 10, 117 | 'position' => 'acf_after_title', 118 | 'style' => 'seamless', 119 | 'label_placement' => 'top', 120 | 'instruction_placement' => 'label', 121 | 'hide_on_screen' => '', 122 | 'active' => true, 123 | 'description' => '', 124 | 'show_in_rest' => 0, 125 | ) ); 126 | 127 | 128 | $langs = rwp::field('langs'); 129 | 130 | $themeLocationName = []; 131 | if($langs){ 132 | 133 | foreach($langs as $k => $v){ 134 | 135 | $themeLocationName[] = [ 136 | array( 137 | 'key' => 'field_67afdkj32nba' . $v['code'], 138 | 'label' => $v['name'], 139 | 'name' => '', 140 | 'aria-label' => '', 141 | 'type' => 'tab', 142 | 'instructions' => '', 143 | 'required' => 0, 144 | 'conditional_logic' => 0, 145 | 'wrapper' => array( 146 | 'width' => '', 147 | 'class' => '', 148 | 'id' => '', 149 | ), 150 | 'placement' => 'top', 151 | 'endpoint' => 0, 152 | 'selected' => 0 153 | ), 154 | array( 155 | 'key' => 'field_678bcjkhads3280' . $v['code'], 156 | 'label' => (CL === 'fr' ? 'Nom (' . $v['code'] . ')' : 'Name (' . $v['code'] . ')'), 157 | 'name' => 'name_' . $v['code'], 158 | 'aria-label' => '', 159 | 'type' => 'text', 160 | 'instructions' => '', 161 | 'required' => 0, 162 | 'conditional_logic' => 0, 163 | 'wrapper' => array( 164 | 'width' => '', 165 | 'class' => '', 166 | 'id' => '', 167 | ), 168 | 'default_value' => '', 169 | 'maxlength' => '', 170 | 'allow_in_bindings' => 0, 171 | 'placeholder' => '', 172 | 'prepend' => '', 173 | 'append' => '', 174 | 'parent_repeater' => 'field_678bca18008f5', 175 | ) 176 | ]; 177 | 178 | } 179 | 180 | 181 | $themeLocationName = call_user_func_array('array_merge', $themeLocationName); 182 | 183 | } 184 | 185 | /* 186 | * Add theme locations to site-settings 187 | */ 188 | acf_add_local_field_group( array( 189 | 'key' => 'group_678bca1894511', 190 | 'title' => 'Theme Locations', 191 | 'fields' => array( 192 | array( 193 | 'key' => 'field_678bca18008f5', 194 | 'label' => 'Theme Locations', 195 | 'name' => 'theme_locations', 196 | 'aria-label' => '', 197 | 'type' => 'repeater', 198 | 'instructions' => '', 199 | 'required' => 0, 200 | 'conditional_logic' => 0, 201 | 'wrapper' => array( 202 | 'width' => '', 203 | 'class' => '', 204 | 'id' => '', 205 | ), 206 | 'layout' => 'block', 207 | 'pagination' => 0, 208 | 'min' => 0, 209 | 'max' => 0, 210 | 'collapsed' => 'field_678bca4e008f7', 211 | 'button_label' => 'Ajouter un emplacement', 212 | 'rows_per_page' => 20, 213 | 'sub_fields' => array( 214 | array( 215 | 'key' => 'field_678bca4e008f7', 216 | 'label' => 'Slug', 217 | 'name' => 'slug', 218 | 'aria-label' => '', 219 | 'type' => 'text', 220 | 'instructions' => '', 221 | 'required' => 0, 222 | 'conditional_logic' => 0, 223 | 'wrapper' => array( 224 | 'width' => '33.3333333333', 225 | 'class' => '', 226 | 'id' => '', 227 | ), 228 | 'default_value' => '', 229 | 'maxlength' => '', 230 | 'allow_in_bindings' => 0, 231 | 'placeholder' => '', 232 | 'prepend' => '', 233 | 'append' => '', 234 | 'parent_repeater' => 'field_678bca18008f5', 235 | ), 236 | ...$themeLocationName 237 | ), 238 | ), 239 | ), 240 | 'location' => array( 241 | array( 242 | array( 243 | 'param' => 'options_page', 244 | 'operator' => '==', 245 | 'value' => 'site-settings', 246 | ), 247 | ), 248 | ), 249 | 'menu_order' => 11, 250 | 'position' => 'normal', 251 | 'style' => 'seamless', 252 | 'label_placement' => 'top', 253 | 'instruction_placement' => 'label', 254 | 'hide_on_screen' => '', 255 | 'active' => true, 256 | 'description' => '', 257 | 'show_in_rest' => 0, 258 | ) ); 259 | 260 | 261 | 262 | /* 263 | * Register theme locations 264 | */ 265 | $locations = rwp::field('theme_locations'); 266 | $__locations = []; 267 | 268 | if($locations){ 269 | 270 | foreach ($locations as $l) { 271 | $__locations[$l['slug']] = isset($l['name_' . CL]) ? $l['name_' . CL] : $l['slug']; 272 | } 273 | 274 | register_nav_menus($__locations); 275 | 276 | } 277 | 278 | 279 | /* 280 | * Medias groups field 281 | */ 282 | $postTypes = get_post_types(); 283 | 284 | $unsets = [ 285 | 'post', 286 | 'page', 287 | 'attachment', 288 | 'revision', 289 | 'nav_menu_item', 290 | 'custom_css', 291 | 'customize_changeset', 292 | 'oembed_cache', 293 | 'user_request', 294 | 'wp_block', 295 | 'wp_template', 296 | 'wp_template_part', 297 | 'wp_global_styles', 298 | 'wp_navigation', 299 | 'acf-field', 300 | 'acf-ui-options-page', 301 | 'acf-field-group', 302 | 'acf-post-type', 303 | 'acf-taxonomy', 304 | 'acf-field', 305 | 'wp_font_family', 306 | 'wp_font_face' 307 | ]; 308 | 309 | foreach ($unsets as $unset) { 310 | unset($postTypes[$unset]); 311 | } 312 | 313 | 314 | $mediaGroupsPostTypes = rwp::field('mediaGroups_post_types') ? rwp::field('mediaGroups_post_types') : []; 315 | 316 | 317 | $mediaGroupsPts = [ 318 | [ 319 | [ 320 | 'param' => 'post_type', 321 | 'operator' => '==', 322 | 'value' => 'post', 323 | ] 324 | ], 325 | [ 326 | [ 327 | 'param' => 'post_type', 328 | 'operator' => '==', 329 | 'value' => 'page', 330 | ] 331 | ], 332 | [ 333 | [ 334 | 'param' => 'user_form', 335 | 'operator' => '==', 336 | 'value' => 'all', 337 | ] 338 | ], 339 | [ 340 | [ 341 | 'param' => 'taxonomy', 342 | 'operator' => '==', 343 | 'value' => 'all', 344 | ] 345 | ] 346 | ]; 347 | 348 | 349 | if($mediaGroupsPostTypes){ 350 | foreach ($mediaGroupsPostTypes as $pt) { 351 | $mediaGroupsPts[] = [ 352 | [ 353 | 'param' => 'post_type', 354 | 'operator' => '==', 355 | 'value' => $pt, 356 | ] 357 | ]; 358 | } 359 | } 360 | 361 | 362 | acf_add_local_field_group( array( 363 | 'key' => 'acf-group_60983478kjhsad54323', 364 | 'title' => 'Media Groups Global Settings', 365 | 'fields' => array( 366 | array( 367 | 'key' => 'field_60983478kjhsad54324', 368 | 'label' => 'Media Groups Post Types', 369 | 'name' => 'mediaGroups_post_types', 370 | 'aria-label' => '', 371 | 'type' => 'checkbox', 372 | 'instructions' => (CL === 'fr' ? 'Les articles, les pages, les utilisateurs et les taxonomies ont le module. Si vous ne voyez pas de sélection, créez un nouveau type d\'article.' : 'Posts, pages, users and taxonomies have the module. If you don\'t see a selection, create a new post type.'), 373 | 'required' => 0, 374 | 'conditional_logic' => 0, 375 | 'wrapper' => array( 376 | 'width' => '33.3333333333', 377 | 'class' => '', 378 | 'id' => '', 379 | ), 380 | 'choices' => $postTypes, 381 | 'default_value' => array( 382 | ), 383 | 'return_format' => 'value', 384 | 'allow_custom' => 0, 385 | 'allow_in_bindings' => 0, 386 | 'layout' => 'vertical', 387 | 'toggle' => 0, 388 | 'save_custom' => 0, 389 | 'custom_choice_button_text' => 'Add new choice', 390 | ), 391 | ), 392 | 'location' => array( 393 | array( 394 | array( 395 | 'param' => 'options_page', 396 | 'operator' => '==', 397 | 'value' => 'site-settings', 398 | ), 399 | ), 400 | ), 401 | 'menu_order' => 12, 402 | 'position' => 'normal', 403 | 'style' => 'seamless', 404 | 'label_placement' => 'top', 405 | 'instruction_placement' => 'label', 406 | 'hide_on_screen' => '', 407 | 'active' => true, 408 | 'description' => '', 409 | 'show_in_rest' => 0, 410 | ) ); 411 | 412 | 413 | /* 414 | * Add medias Groups field 415 | */ 416 | acf_add_local_field_group( array( 417 | 'key' => 'group_67kjhb39087sdh233', 418 | 'title' => 'Media Groups', 419 | 'fields' => array( 420 | array( 421 | 'key' => 'field_67kjhb39087sdh234', 422 | 'label' => (CL === 'fr' ? 'Groupe de médias' : 'Media Groups'), 423 | 'name' => 'media_groups', 424 | 'aria-label' => '', 425 | 'type' => 'text', 426 | 'instructions' => '', 427 | 'required' => 0, 428 | 'conditional_logic' => 0, 429 | 'wrapper' => array( 430 | 'width' => '', 431 | 'class' => '', 432 | 'id' => '', 433 | ), 434 | 'default_value' => '', 435 | 'maxlength' => '', 436 | 'allow_in_bindings' => 0, 437 | 'placeholder' => '', 438 | 'prepend' => '', 439 | 'append' => '' 440 | ), 441 | ), 442 | 'location' => $mediaGroupsPts, 443 | 'menu_order' => 10, 444 | 'position' => 'side', 445 | 'style' => 'seamless', 446 | 'label_placement' => 'top', 447 | 'instruction_placement' => 'label', 448 | 'hide_on_screen' => '', 449 | 'active' => true, 450 | 'description' => '', 451 | 'show_in_rest' => 1, 452 | ) ); 453 | 454 | }); -------------------------------------------------------------------------------- /src/mu-plugins/plugins/reactwp/template/inc/utils.php: -------------------------------------------------------------------------------- 1 | &$value) { 29 | if (is_array($value)) { 30 | self::recursive($search, $replace, $array[$key]); 31 | } else { 32 | $array[$key] = !is_null($value) && !is_bool($value) ? (is_numeric($value) && !is_string($value) ? +str_replace($search, $replace, $value) : str_replace($search, $replace, $value)) : $value; 33 | } 34 | } 35 | } 36 | 37 | } 38 | 39 | class CustomPostType{ 40 | 41 | public static $defaults = []; 42 | public static $configs = []; 43 | 44 | public static function get($post_type = 'post', $args = []){ 45 | 46 | if(!is_array(self::$configs)) return; 47 | 48 | self::$configs = self::$defaults; 49 | 50 | if($args && is_array($args)){ 51 | foreach($args as $arg_key => $arg){ 52 | self::$configs[$arg_key] = $arg; 53 | } 54 | } 55 | 56 | if($post_type) 57 | self::$configs['post_type'] = $post_type; 58 | 59 | 60 | return new \WP_Query(self::$configs); 61 | 62 | } 63 | 64 | public static function default($parameter, $value){ 65 | 66 | self::$defaults[$parameter] = $value; 67 | 68 | } 69 | 70 | } 71 | 72 | class Menu{ 73 | 74 | public static $defaults = []; 75 | public static $configs = []; 76 | 77 | public static function get($theme_location = null, $args = []){ 78 | 79 | if(!is_array(self::$configs)) return; 80 | 81 | self::$configs = self::$defaults; 82 | 83 | if($args && is_array($args)){ 84 | foreach($args as $arg_key => $arg){ 85 | self::$configs[$arg_key] = $arg; 86 | } 87 | } 88 | 89 | 90 | if(isset(self::$configs['mobile_bars']) && (int)self::$configs['mobile_bars'] > 0){ 91 | 92 | $html = '
'; 93 | $html .= '
'; 94 | for ($i=0; $i < (int)self::$configs['mobile_bars']; $i++) { 95 | $html .= ''; 96 | } 97 | $html .= '
'; 98 | $html .= '
'; 99 | 100 | self::$configs['items_wrap'] = self::$configs['items_wrap'] . $html; 101 | 102 | } 103 | 104 | if($theme_location) 105 | self::$configs['theme_location'] = $theme_location; 106 | 107 | 108 | return wp_nav_menu(self::$configs); 109 | 110 | } 111 | 112 | public static function default($parameter, $value){ 113 | 114 | self::$defaults[$parameter] = $value; 115 | 116 | } 117 | 118 | } 119 | 120 | class Button{ 121 | 122 | public static $defaults = [ 123 | 'text' => null, 124 | 'href' => null, 125 | 'class' => null, 126 | 'attr' => null, 127 | 'before' => null, 128 | 'after' => null 129 | ]; 130 | 131 | 132 | public static $configs = []; 133 | 134 | public static function get($text = null, $args = []){ 135 | 136 | if(!is_array(self::$configs)) return; 137 | 138 | self::$configs = self::$defaults; 139 | 140 | if($args && is_array($args)){ 141 | foreach($args as $arg_key => $arg){ 142 | self::$configs[$arg_key] = $arg; 143 | } 144 | } 145 | 146 | if($text) 147 | self::$configs['text'] = $text; 148 | 149 | return self::$configs['href'] ? ' 150 | 151 | 152 | '. (self::$configs['before'] ? '
'. self::$configs['before'] .'
' : null) . (self::$configs['text'] ? ''. self::$configs['text'] .'' : null) . (self::$configs['after'] ? '
'. self::$configs['after'] .'
' : null) .' 153 | 154 |
155 | ' : ' 156 | 161 | '; 162 | 163 | } 164 | 165 | public static function default($parameter, $value){ 166 | 167 | self::$defaults[$parameter] = $value; 168 | 169 | } 170 | 171 | } 172 | 173 | class Source{ 174 | 175 | public static $defaults = [ 176 | 'base' => '/', 177 | 'path' => null, 178 | 'url' => false 179 | ]; 180 | 181 | public static $configs = []; 182 | 183 | public static function get($args = []){ 184 | 185 | if(!is_array(self::$configs)) return; 186 | 187 | self::$configs = self::$defaults; 188 | 189 | if($args && is_array($args)){ 190 | foreach($args as $arg_key => $arg){ 191 | self::$configs[$arg_key] = $arg; 192 | } 193 | } 194 | 195 | 196 | return self::$configs['url'] ? ((get_template_directory() === get_stylesheet_directory() ? get_template_directory_uri() : get_stylesheet_directory_uri()) . self::$configs['base'] . self::$configs['path']) : ((get_template_directory() === get_stylesheet_directory() ? get_template_directory() : get_stylesheet_directory()) . self::$configs['base'] . self::$configs['path']); 197 | 198 | } 199 | 200 | public static function default($parameter, $value){ 201 | 202 | self::$defaults[$parameter] = $value; 203 | 204 | } 205 | 206 | } -------------------------------------------------------------------------------- /src/mu-plugins/plugins/reactwp/template/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/mu-plugins/plugins/reactwp/template/init.php: -------------------------------------------------------------------------------- 1 | CL]); 33 | 34 | 35 | /* 36 | * System management 37 | */ 38 | wp_localize_script('rwp-main', 'SYSTEM', [ 39 | 'public' => get_option('blog_public'), 40 | 'baseUrl' => site_url(), 41 | 'adminUrl' => admin_url(), 42 | 'ajaxPath' => '/wp-admin/admin-ajax.php', 43 | 'restPath' => '/wp-json' 44 | ]); 45 | 46 | 47 | }, 11); 48 | 49 | 50 | /* 51 | * ACF Replace values from php functions 52 | */ 53 | add_filter('acf/format_value', function ($value, $post_id, $field){ 54 | 55 | $return = $value; 56 | 57 | if($return && is_array($return) && \ReactWP\Utils\Field::$elementsToReplace) 58 | \ReactWP\Utils\Field::recursive(\ReactWP\Utils\Field::$elementsToReplace[0], \ReactWP\Utils\Field::$elementsToReplace[1], $return); 59 | elseif($return && is_string($return) && \ReactWP\Utils\Field::$elementsToReplace) 60 | $return = str_replace(\ReactWP\Utils\Field::$elementsToReplace[0], \ReactWP\Utils\Field::$elementsToReplace[1], $return); 61 | 62 | 63 | return $return; 64 | 65 | }, 10, 3); 66 | 67 | 68 | 69 | /* 70 | * ACF Replace values from REST API 71 | */ 72 | add_filter('acf/settings/rest_api_format', function () { 73 | return 'standard'; 74 | }); 75 | 76 | add_filter('acf/rest/format_value_for_rest', function ($value_formatted, $post_id, $field, $value, $format){ 77 | 78 | $return = $value_formatted; 79 | 80 | if($return && is_array($return) && \ReactWP\Utils\Field::$elementsToReplace) 81 | \ReactWP\Utils\Field::recursive(\ReactWP\Utils\Field::$elementsToReplace[0], \ReactWP\Utils\Field::$elementsToReplace[1], $return); 82 | elseif($return && is_string($return) && \ReactWP\Utils\Field::$elementsToReplace) 83 | $return = str_replace(\ReactWP\Utils\Field::$elementsToReplace[0], \ReactWP\Utils\Field::$elementsToReplace[1], $return); 84 | 85 | 86 | return $return; 87 | 88 | }, 10, 5); 89 | 90 | 91 | } 92 | 93 | static function field($field, $id = false, $format = true, $escape = false){ 94 | 95 | return ReactWP\Utils\Field::get($field, $id, $format, $escape); 96 | 97 | } 98 | 99 | static function cpt($post_type = 'post', $args = []){ 100 | 101 | return ReactWP\Utils\CustomPostType::get($post_type, $args); 102 | 103 | } 104 | 105 | static function menu($theme_location = null, $args = []){ 106 | 107 | return ReactWP\Utils\Menu::get($theme_location, $args); 108 | 109 | } 110 | 111 | static function button($text = null, $args = []){ 112 | 113 | return ReactWP\Utils\Button::get($text, $args); 114 | 115 | } 116 | 117 | static function source($args = []){ 118 | 119 | return ReactWP\Utils\Source::get($args); 120 | 121 | } 122 | 123 | } 124 | 125 | class_alias('ReactWP', 'rwp'); 126 | 127 | new rwp(); -------------------------------------------------------------------------------- /src/plugins/reactwp-accept-svg/js/App.js: -------------------------------------------------------------------------------- 1 | 'use strict'; -------------------------------------------------------------------------------- /src/plugins/reactwp-accept-svg/medias/Medias.js: -------------------------------------------------------------------------------- 1 | 'use strict'; -------------------------------------------------------------------------------- /src/plugins/reactwp-accept-svg/medias/audios/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-accept-svg/medias/audios/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-accept-svg/medias/fonts/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-accept-svg/medias/fonts/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-accept-svg/medias/images/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-accept-svg/medias/images/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-accept-svg/medias/others/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-accept-svg/medias/others/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-accept-svg/medias/videos/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-accept-svg/medias/videos/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-accept-svg/scss/App.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-accept-svg/scss/App.scss -------------------------------------------------------------------------------- /src/plugins/reactwp-accept-svg/template/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/plugins/reactwp-accept-svg/template/init.php: -------------------------------------------------------------------------------- 1 | $filetype['ext'], 23 | 'type' => $filetype['type'], 24 | 'proper_filename' => $data['proper_filename'] 25 | ]; 26 | 27 | }, 10, 4); -------------------------------------------------------------------------------- /src/plugins/reactwp-accept-svg/template/uninstall.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/plugins/reactwp-acf-local-json/js/App.js: -------------------------------------------------------------------------------- 1 | 'use strict'; -------------------------------------------------------------------------------- /src/plugins/reactwp-acf-local-json/medias/Medias.js: -------------------------------------------------------------------------------- 1 | 'use strict'; -------------------------------------------------------------------------------- /src/plugins/reactwp-acf-local-json/medias/audios/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-acf-local-json/medias/audios/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-acf-local-json/medias/fonts/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-acf-local-json/medias/fonts/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-acf-local-json/medias/images/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-acf-local-json/medias/images/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-acf-local-json/medias/others/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-acf-local-json/medias/others/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-acf-local-json/medias/videos/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-acf-local-json/medias/videos/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-acf-local-json/scss/App.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-acf-local-json/scss/App.scss -------------------------------------------------------------------------------- /src/plugins/reactwp-acf-local-json/template/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/plugins/reactwp-acf-local-json/template/init.php: -------------------------------------------------------------------------------- 1 | 'datas/acf', 'url' => false]); 11 | 12 | /* 13 | * Create ACF JSON Area 14 | */ 15 | add_action('admin_init', function(){ 16 | 17 | global $acf_path; 18 | 19 | if(!file_exists($acf_path)){ 20 | mkdir($acf_path, 0777, true); 21 | fopen($acf_path . '/index.php', 'w'); 22 | } 23 | 24 | }); 25 | 26 | 27 | /* 28 | * Save 29 | */ 30 | add_filter('acf/settings/save_json', function($path){ 31 | 32 | global $acf_path; 33 | 34 | return $acf_path; 35 | 36 | }); 37 | 38 | 39 | /* 40 | * Load 41 | */ 42 | add_filter('acf/settings/load_json', function($paths){ 43 | 44 | global $acf_path; 45 | 46 | // Remove original path 47 | unset( $paths[0] ); 48 | 49 | // Append our new path 50 | $paths[] = $acf_path; 51 | 52 | return $paths; 53 | }); -------------------------------------------------------------------------------- /src/plugins/reactwp-acf-local-json/template/uninstall.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/plugins/reactwp-backend/js/App.js: -------------------------------------------------------------------------------- 1 | 'use strict'; -------------------------------------------------------------------------------- /src/plugins/reactwp-backend/medias/Medias.js: -------------------------------------------------------------------------------- 1 | 'use strict'; -------------------------------------------------------------------------------- /src/plugins/reactwp-backend/medias/audios/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-backend/medias/audios/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-backend/medias/fonts/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-backend/medias/fonts/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-backend/medias/images/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-backend/medias/images/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-backend/medias/others/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-backend/medias/others/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-backend/medias/videos/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-backend/medias/videos/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-backend/scss/App.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-backend/scss/App.scss -------------------------------------------------------------------------------- /src/plugins/reactwp-backend/template/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/plugins/reactwp-backend/template/init.php: -------------------------------------------------------------------------------- 1 | remove_node('wp-logo'); 83 | $wp_admin_bar->remove_node('site-name'); 84 | $wp_admin_bar->remove_node('comments'); 85 | $wp_admin_bar->remove_node('new-content'); 86 | 87 | 88 | if( 89 | !current_user_can('update_core') 90 | 91 | || 92 | 93 | !current_user_can('update_plugins') 94 | 95 | || 96 | 97 | !current_user_can('update_themes') 98 | 99 | ) { 100 | 101 | $wp_admin_bar->remove_node( 'updates' ); 102 | 103 | } 104 | 105 | 106 | /* 107 | * Add items 108 | */ 109 | $admin_url = admin_url(); 110 | 111 | // Home URL 112 | $args = [ 113 | 'id' => 'is-website', 114 | 'title' => get_bloginfo('name'), 115 | 'href' => '/', 116 | 'target' => '_blank', 117 | 'meta' => [ 118 | 'class' => 'is-website' 119 | ] 120 | ]; 121 | $wp_admin_bar->add_node($args); 122 | 123 | 124 | // Menus 125 | $args = array( 126 | 'id' => 'is-menus', 127 | 'title' => __('Menus', 'rwp-core'), 128 | 'href' => $admin_url . 'nav-menus.php', 129 | 'meta' => array( 130 | 'class' => 'is-menus' 131 | ) 132 | ); 133 | if(current_user_can('edit_theme_options') && rwp::field('theme_locations')) 134 | $wp_admin_bar->add_node($args); 135 | 136 | 137 | // Files 138 | $args = array( 139 | 'id' => 'is-files', 140 | 'title' => __('Images & files', 'rwp-core'), 141 | 'href' => $admin_url . 'upload.php', 142 | 'meta' => array( 143 | 'class' => 'is-files' 144 | ) 145 | ); 146 | if(current_user_can('upload_files')) 147 | $wp_admin_bar->add_node($args); 148 | 149 | 150 | // Users list and personal profile 151 | if(current_user_can('list_users')){ 152 | 153 | $args = array( 154 | 'id' => 'is-users-list', 155 | 'title' => __('Users', 'rwp-core'), 156 | 'href' => $admin_url . 'users.php', 157 | 'meta' => array( 158 | 'class' => 'is-users-list' 159 | ) 160 | ); 161 | $wp_admin_bar->add_node($args); 162 | 163 | 164 | $args = array( 165 | 'id' => 'is-users-profile', 166 | 'title' => __('Profile', 'rwp-core'), 167 | 'href' => $admin_url . 'profile.php', 168 | 'parent' => 'is-users-list', 169 | 'meta' => array( 170 | 'class' => 'is-users-profile' 171 | ) 172 | ); 173 | $wp_admin_bar->add_node($args); 174 | 175 | } else { 176 | 177 | $args = array( 178 | 'id' => 'is-users-profile', 179 | 'title' => __('Profile', 'rwp-core'), 180 | 'href' => $admin_url . 'profile.php', 181 | 'meta' => array( 182 | 'class' => 'is-users-profile' 183 | ) 184 | ); 185 | $wp_admin_bar->add_node($args); 186 | 187 | } 188 | 189 | 190 | // ReactWP Tab 191 | if(current_user_can('edit_theme_options')){ 192 | 193 | $args = array( 194 | 'id' => 'is-site', 195 | 'title' => __('ReactWP', 'rwp-core'), 196 | 'meta' => array( 197 | 'class' => 'is-site' 198 | ) 199 | ); 200 | $wp_admin_bar->add_node($args); 201 | 202 | 203 | // Site settings 204 | $args = array( 205 | 'id' => 'is-site-settings', 206 | 'title' => __('Site settings', 'rwp-core'), 207 | 'href' => $admin_url . 'admin.php?page=site-settings', 208 | 'parent' => 'is-site', 209 | 'meta' => array( 210 | 'class' => 'is-site-settings' 211 | ) 212 | ); 213 | $wp_admin_bar->add_node($args); 214 | 215 | 216 | // Theme settings 217 | $args = array( 218 | 'id' => 'is-theme-settings', 219 | 'title' => __('Theme settings', 'rwp-core'), 220 | 'href' => $admin_url . 'admin.php?page=theme-settings', 221 | 'parent' => 'is-site', 222 | 'meta' => array( 223 | 'class' => 'is-theme-settings' 224 | ) 225 | ); 226 | $wp_admin_bar->add_node($args); 227 | 228 | 229 | // Themes Management 230 | if(current_user_can('switch_themes')){ 231 | $args = array( 232 | 'id' => 'is-site-themes', 233 | 'title' => __('Themes', 'rwp-core'), 234 | 'href' => $admin_url . 'themes.php', 235 | 'parent' => 'is-site', 236 | 'meta' => array( 237 | 'class' => 'is-site-themes' 238 | ) 239 | ); 240 | $wp_admin_bar->add_node($args); 241 | 242 | 243 | 244 | // Edit Themes 245 | $args = array( 246 | 'id' => 'is-site-themes-editor', 247 | 'title' => __('Editor', 'rwp-core'), 248 | 'href' => $admin_url . 'theme-editor.php', 249 | 'parent' => 'is-site-themes', 250 | 'meta' => array( 251 | 'class' => 'is-site-themes-editor' 252 | ) 253 | ); 254 | if(current_user_can('edit_themes')) 255 | $wp_admin_bar->add_node($args); 256 | 257 | } 258 | 259 | 260 | // Plugins Management 261 | if(current_user_can('activate_plugins')){ 262 | 263 | $args = array( 264 | 'id' => 'is-site-plugins', 265 | 'title' => __('Plugins', 'rwp-core'), 266 | 'href' => $admin_url . 'plugins.php', 267 | 'parent' => 'is-site', 268 | 'meta' => array( 269 | 'class' => 'is-site-plugins' 270 | ) 271 | ); 272 | $wp_admin_bar->add_node($args); 273 | 274 | 275 | // Edit Plugins 276 | $args = array( 277 | 'id' => 'is-site-plugin-editor', 278 | 'title' => __('Editor', 'rwp-core'), 279 | 'href' => $admin_url . 'plugin-editor.php', 280 | 'parent' => 'is-site-plugins', 281 | 'meta' => array( 282 | 'class' => 'is-site-plugins-editor' 283 | ) 284 | ); 285 | if(current_user_can('edit_plugins')) 286 | $wp_admin_bar->add_node($args); 287 | 288 | 289 | // ACF PRO Management 290 | $args = array( 291 | 'id' => 'is-acf', 292 | 'title' => __('ACF', 'rwp-core'), 293 | 'href' => $admin_url . 'edit.php?post_type=acf-field-group', 294 | 'parent' => 'is-site', 295 | 'meta' => array( 296 | 'class' => 'is-acf' 297 | ) 298 | ); 299 | $wp_admin_bar->add_node($args); 300 | 301 | 302 | // Import Management 303 | $args = array( 304 | 'id' => 'is-site-import', 305 | 'title' => __('Import', 'rwp-core'), 306 | 'href' => $admin_url . 'import.php', 307 | 'parent' => 'is-site', 308 | 'meta' => array( 309 | 'class' => 'is-site-import' 310 | ) 311 | ); 312 | if(current_user_can('import')) 313 | $wp_admin_bar->add_node($args); 314 | 315 | 316 | // Export Management 317 | $args = array( 318 | 'id' => 'is-site-export', 319 | 'title' => __('Export', 'rwp-core'), 320 | 'href' => $admin_url . 'export.php', 321 | 'parent' => 'is-site', 322 | 'meta' => array( 323 | 'class' => 'is-site-export' 324 | ) 325 | ); 326 | if(current_user_can('export')) 327 | $wp_admin_bar->add_node($args); 328 | 329 | } 330 | 331 | } 332 | 333 | }, 99); 334 | 335 | 336 | /* 337 | * Remove Customize Elements 338 | */ 339 | add_action('customize_register', function($wp_customize){ 340 | 341 | $wp_customize->remove_panel('themes'); 342 | $wp_customize->remove_panel('nav_menus'); 343 | $wp_customize->remove_section('title_tagline'); 344 | $wp_customize->remove_section('static_front_page'); 345 | $wp_customize->remove_section('custom_css'); 346 | $wp_customize->remove_section('colors'); 347 | 348 | }, 20); 349 | 350 | 351 | /* 352 | * Add some styles 353 | */ 354 | add_action('admin_head', function(){ 355 | 356 | echo ''; 357 | 358 | }); -------------------------------------------------------------------------------- /src/plugins/reactwp-backend/template/uninstall.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/plugins/reactwp-frontend/js/App.js: -------------------------------------------------------------------------------- 1 | 'use strict'; -------------------------------------------------------------------------------- /src/plugins/reactwp-frontend/medias/Medias.js: -------------------------------------------------------------------------------- 1 | 'use strict'; -------------------------------------------------------------------------------- /src/plugins/reactwp-frontend/medias/audios/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-frontend/medias/audios/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-frontend/medias/fonts/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-frontend/medias/fonts/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-frontend/medias/images/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-frontend/medias/images/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-frontend/medias/others/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-frontend/medias/others/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-frontend/medias/videos/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-frontend/medias/videos/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-frontend/scss/App.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-frontend/scss/App.scss -------------------------------------------------------------------------------- /src/plugins/reactwp-frontend/template/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/plugins/reactwp-frontend/template/init.php: -------------------------------------------------------------------------------- 1 | 34 | */ 35 | add_action('wp_enqueue_scripts', function(){ 36 | 37 | wp_dequeue_style('global-styles'); 38 | 39 | wp_dequeue_style('wp-block-library'); 40 | 41 | wp_dequeue_style('classic-theme-styles'); 42 | 43 | }); 44 | 45 | 46 | remove_action('wp_head', 'rsd_link'); 47 | remove_action('wp_head', 'wp_generator'); 48 | remove_action('wp_head', 'index_rel_link'); 49 | remove_action('wp_head', 'wlwmanifest_link'); 50 | remove_action('wp_head', 'start_post_rel_link'); 51 | remove_action('wp_head', 'adjacent_posts_rel_link'); 52 | remove_action('wp_head', 'rest_output_link_wp_head'); 53 | remove_action('wp_head', 'wp_oembed_add_discovery_links'); 54 | remove_action('wp_head', 'rel_canonical'); 55 | remove_action('wp_head', 'feed_links', 2); 56 | remove_action('wp_head', 'feed_links_extra', 3); 57 | remove_action('wp_head', 'wp_resource_hints', 2); 58 | remove_action('wp_head', 'wp_shortlink_wp_head', 10); 59 | remove_action('wp_head', 'print_emoji_detection_script', 7); 60 | remove_action('wp_print_styles', 'print_emoji_styles'); 61 | remove_action('template_redirect', 'wp_shortlink_header', 11); -------------------------------------------------------------------------------- /src/plugins/reactwp-frontend/template/uninstall.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/plugins/reactwp-images/js/App.js: -------------------------------------------------------------------------------- 1 | 'use strict'; -------------------------------------------------------------------------------- /src/plugins/reactwp-images/medias/Medias.js: -------------------------------------------------------------------------------- 1 | 'use strict'; -------------------------------------------------------------------------------- /src/plugins/reactwp-images/medias/audios/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-images/medias/audios/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-images/medias/fonts/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-images/medias/fonts/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-images/medias/images/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-images/medias/images/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-images/medias/others/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-images/medias/others/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-images/medias/videos/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-images/medias/videos/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-images/scss/App.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-images/scss/App.scss -------------------------------------------------------------------------------- /src/plugins/reactwp-images/template/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/plugins/reactwp-images/template/init.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/plugins/reactwp-seo/js/App.js: -------------------------------------------------------------------------------- 1 | 'use strict'; -------------------------------------------------------------------------------- /src/plugins/reactwp-seo/medias/Medias.js: -------------------------------------------------------------------------------- 1 | 'use strict'; -------------------------------------------------------------------------------- /src/plugins/reactwp-seo/medias/audios/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-seo/medias/audios/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-seo/medias/fonts/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-seo/medias/fonts/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-seo/medias/images/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-seo/medias/images/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-seo/medias/others/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-seo/medias/others/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-seo/medias/videos/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-seo/medias/videos/.gitkeep -------------------------------------------------------------------------------- /src/plugins/reactwp-seo/scss/App.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/studiochampgauche/ReactWP/8d9b0217735299e3dd3399c44d5d8cb92708fc3a/src/plugins/reactwp-seo/scss/App.scss -------------------------------------------------------------------------------- /src/plugins/reactwp-seo/template/inc/render.php: -------------------------------------------------------------------------------- 1 | 'post_type', 86 | 'operator' => '==', 87 | 'value' => 'post', 88 | ] 89 | ], 90 | [ 91 | [ 92 | 'param' => 'post_type', 93 | 'operator' => '==', 94 | 'value' => 'page', 95 | ] 96 | ], 97 | [ 98 | [ 99 | 'param' => 'user_form', 100 | 'operator' => '==', 101 | 'value' => 'all', 102 | ] 103 | ], 104 | [ 105 | [ 106 | 'param' => 'taxonomy', 107 | 'operator' => '==', 108 | 'value' => 'all', 109 | ] 110 | ] 111 | ]; 112 | 113 | 114 | if($seoPostTypes){ 115 | foreach ($seoPostTypes as $pt) { 116 | $seoPts[] = [ 117 | [ 118 | 'param' => 'post_type', 119 | 'operator' => '==', 120 | 'value' => $pt, 121 | ] 122 | ]; 123 | } 124 | } 125 | 126 | $langs = \rwp::field('langs', 'option'); 127 | $fields = []; 128 | $global_fields = []; 129 | 130 | if($langs){ 131 | 132 | foreach ($langs as $k => $v) { 133 | 134 | $fields[] = [ 135 | array( 136 | 'key' => 'field_67a8981f520aa' . $v['code'], 137 | 'label' => $v['name'], 138 | 'name' => '', 139 | 'aria-label' => '', 140 | 'type' => 'tab', 141 | 'instructions' => '', 142 | 'required' => 0, 143 | 'conditional_logic' => 0, 144 | 'wrapper' => array( 145 | 'width' => '', 146 | 'class' => '', 147 | 'id' => '', 148 | ), 149 | 'placement' => 'top', 150 | 'endpoint' => 0, 151 | 'selected' => 0, 152 | ), 153 | array( 154 | 'key' => 'field_6hgwsei290' . $v['code'], 155 | 'label' => 'Title ('. $v['code'] .')', 156 | 'name' => 'title_' . $v['code'], 157 | 'aria-label' => '', 158 | 'type' => 'text', 159 | 'instructions' => '', 160 | 'required' => 0, 161 | 'conditional_logic' => 0, 162 | 'wrapper' => array( 163 | 'width' => '', 164 | 'class' => '', 165 | 'id' => '', 166 | ), 167 | 'default_value' => '', 168 | 'maxlength' => '', 169 | 'allow_in_bindings' => 0, 170 | 'placeholder' => '', 171 | 'prepend' => '', 172 | 'append' => '', 173 | ), 174 | array( 175 | 'key' => 'field_sadkljf9923jsd1' . $v['code'], 176 | 'label' => 'Description ('. $v['code'] .')', 177 | 'name' => 'description_' . $v['code'], 178 | 'aria-label' => '', 179 | 'type' => 'textarea', 180 | 'instructions' => '', 181 | 'required' => 0, 182 | 'conditional_logic' => 0, 183 | 'wrapper' => array( 184 | 'width' => '', 185 | 'class' => '', 186 | 'id' => '', 187 | ), 188 | 'default_value' => '', 189 | 'maxlength' => '', 190 | 'allow_in_bindings' => 0, 191 | 'rows' => 6, 192 | 'placeholder' => '', 193 | 'new_lines' => '', 194 | ), 195 | array( 196 | 'key' => 'field_sadkljasdaad312e23213' . $v['code'], 197 | 'label' => 'OG Title ('. $v['code'] .')', 198 | 'name' => 'og_title_' . $v['code'], 199 | 'aria-label' => '', 200 | 'type' => 'text', 201 | 'instructions' => '', 202 | 'required' => 0, 203 | 'conditional_logic' => 0, 204 | 'wrapper' => array( 205 | 'width' => '', 206 | 'class' => '', 207 | 'id' => '', 208 | ), 209 | 'default_value' => '', 210 | 'maxlength' => '', 211 | 'allow_in_bindings' => 0, 212 | 'placeholder' => '', 213 | 'prepend' => '', 214 | 'append' => '', 215 | ), 216 | array( 217 | 'key' => 'field_sadkljasdaf9923213' . $v['code'], 218 | 'label' => 'OG Description ('. $v['code'] .')', 219 | 'name' => 'og_description_' . $v['code'], 220 | 'aria-label' => '', 221 | 'type' => 'textarea', 222 | 'instructions' => '', 223 | 'required' => 0, 224 | 'conditional_logic' => 0, 225 | 'wrapper' => array( 226 | 'width' => '', 227 | 'class' => '', 228 | 'id' => '', 229 | ), 230 | 'default_value' => '', 231 | 'maxlength' => '', 232 | 'allow_in_bindings' => 0, 233 | 'rows' => 6, 234 | 'placeholder' => '', 235 | 'new_lines' => '', 236 | ), 237 | ]; 238 | 239 | 240 | $global_fields[] = [ 241 | array( 242 | 'key' => 'field_67a8981f520aa1' . $v['code'], 243 | 'label' => $v['name'], 244 | 'name' => '', 245 | 'aria-label' => '', 246 | 'type' => 'tab', 247 | 'instructions' => '', 248 | 'required' => 0, 249 | 'conditional_logic' => 0, 250 | 'wrapper' => array( 251 | 'width' => '', 252 | 'class' => '', 253 | 'id' => '', 254 | ), 255 | 'placement' => 'top', 256 | 'endpoint' => 0, 257 | 'selected' => 0, 258 | ), 259 | array( 260 | 'key' => 'field_sadkljf9923jsd11' . $v['code'], 261 | 'label' => 'Description ('. $v['code'] .')', 262 | 'name' => 'description_' . $v['code'], 263 | 'aria-label' => '', 264 | 'type' => 'textarea', 265 | 'instructions' => '', 266 | 'required' => 0, 267 | 'conditional_logic' => 0, 268 | 'wrapper' => array( 269 | 'width' => '', 270 | 'class' => '', 271 | 'id' => '', 272 | ), 273 | 'default_value' => '', 274 | 'maxlength' => '', 275 | 'allow_in_bindings' => 0, 276 | 'rows' => 6, 277 | 'placeholder' => '', 278 | 'new_lines' => '', 279 | ), 280 | array( 281 | 'key' => 'field_sadkljasdaad312e232131' . $v['code'], 282 | 'label' => 'OG Title ('. $v['code'] .')', 283 | 'name' => 'og_title_' . $v['code'], 284 | 'aria-label' => '', 285 | 'type' => 'text', 286 | 'instructions' => '', 287 | 'required' => 0, 288 | 'conditional_logic' => 0, 289 | 'wrapper' => array( 290 | 'width' => '', 291 | 'class' => '', 292 | 'id' => '', 293 | ), 294 | 'default_value' => '', 295 | 'maxlength' => '', 296 | 'allow_in_bindings' => 0, 297 | 'placeholder' => '', 298 | 'prepend' => '', 299 | 'append' => '', 300 | ), 301 | array( 302 | 'key' => 'field_sadkljasdaf99232131' . $v['code'], 303 | 'label' => 'OG Description ('. $v['code'] .')', 304 | 'name' => 'og_description_' . $v['code'], 305 | 'aria-label' => '', 306 | 'type' => 'textarea', 307 | 'instructions' => '', 308 | 'required' => 0, 309 | 'conditional_logic' => 0, 310 | 'wrapper' => array( 311 | 'width' => '', 312 | 'class' => '', 313 | 'id' => '', 314 | ), 315 | 'default_value' => '', 316 | 'maxlength' => '', 317 | 'allow_in_bindings' => 0, 318 | 'rows' => 6, 319 | 'placeholder' => '', 320 | 'new_lines' => '', 321 | ), 322 | ]; 323 | 324 | } 325 | 326 | $fields = call_user_func_array('array_merge', $fields); 327 | $global_fields = call_user_func_array('array_merge', $global_fields); 328 | 329 | } 330 | 331 | 332 | acf_add_local_field_group( array( 333 | 'key' => 'group_678c4a3132179', 334 | 'title' => 'SEO', 335 | 'fields' => array( 336 | array( 337 | 'key' => 'field_678c4b58ad753', 338 | 'label' => 'SEO', 339 | 'name' => 'seo', 340 | 'aria-label' => '', 341 | 'type' => 'group', 342 | 'instructions' => '', 343 | 'required' => 0, 344 | 'conditional_logic' => 0, 345 | 'wrapper' => array( 346 | 'width' => '', 347 | 'class' => '', 348 | 'id' => '', 349 | ), 350 | 'layout' => 'block', 351 | 'sub_fields' => array( 352 | array( 353 | 'key' => 'field_678c4a31abcb0', 354 | 'label' => 'Don\'t index', 355 | 'name' => 'do_not_index', 356 | 'aria-label' => '', 357 | 'type' => 'true_false', 358 | 'instructions' => '', 359 | 'required' => 0, 360 | 'conditional_logic' => 0, 361 | 'wrapper' => array( 362 | 'width' => '33.3333333333', 363 | 'class' => '', 364 | 'id' => '', 365 | ), 366 | 'message' => '', 367 | 'default_value' => 0, 368 | 'allow_in_bindings' => 0, 369 | 'ui_on_text' => '', 370 | 'ui_off_text' => '', 371 | 'ui' => 1, 372 | ), 373 | array( 374 | 'key' => 'field_678c4ab4abcb5', 375 | 'label' => 'OG Image', 376 | 'name' => 'og_image', 377 | 'aria-label' => '', 378 | 'type' => 'image', 379 | 'instructions' => '', 380 | 'required' => 0, 381 | 'conditional_logic' => 0, 382 | 'wrapper' => array( 383 | 'width' => '33.3333333333', 384 | 'class' => '', 385 | 'id' => '', 386 | ), 387 | 'return_format' => 'url', 388 | 'library' => 'all', 389 | 'min_width' => '', 390 | 'min_height' => '', 391 | 'min_size' => '', 392 | 'max_width' => '', 393 | 'max_height' => '', 394 | 'max_size' => '', 395 | 'mime_types' => '', 396 | 'allow_in_bindings' => 0, 397 | 'preview_size' => 'medium', 398 | ), 399 | ...$fields 400 | ), 401 | ), 402 | ), 403 | 'location' => $seoPts, 404 | 'menu_order' => 99, 405 | 'position' => 'normal', 406 | 'style' => 'seamless', 407 | 'label_placement' => 'top', 408 | 'instruction_placement' => 'label', 409 | 'hide_on_screen' => '', 410 | 'active' => true, 411 | 'description' => '', 412 | 'show_in_rest' => 1, 413 | ) ); 414 | 415 | acf_add_local_field_group( array( 416 | 'key' => 'acf-group_678bca1894522', 417 | 'title' => 'SEO Global Settings', 418 | 'fields' => array( 419 | array( 420 | 'key' => 'field_678bcff6f2484', 421 | 'label' => 'SEO', 422 | 'name' => 'seo', 423 | 'aria-label' => '', 424 | 'type' => 'group', 425 | 'instructions' => '', 426 | 'required' => 0, 427 | 'conditional_logic' => 0, 428 | 'wrapper' => array( 429 | 'width' => '', 430 | 'class' => '', 431 | 'id' => '', 432 | ), 433 | 'layout' => 'block', 434 | 'sub_fields' => array( 435 | array( 436 | 'key' => 'field_678c651684c05', 437 | 'label' => 'Post types', 438 | 'name' => 'post_types', 439 | 'aria-label' => '', 440 | 'type' => 'checkbox', 441 | 'instructions' => (CL === 'fr' ? 'Les articles, les pages, les utilisateurs et les taxonomies ont le module. Si vous ne voyez pas de sélection, créez un nouveau type d\'article.' : 'Posts, pages, users and taxonomies have the module. If you don\'t see a selection, create a new post type.'), 442 | 'required' => 0, 443 | 'conditional_logic' => 0, 444 | 'wrapper' => array( 445 | 'width' => '33.3333333333', 446 | 'class' => '', 447 | 'id' => '', 448 | ), 449 | 'choices' => $postTypes, 450 | 'default_value' => array( 451 | ), 452 | 'return_format' => 'value', 453 | 'allow_custom' => 0, 454 | 'allow_in_bindings' => 0, 455 | 'layout' => 'vertical', 456 | 'toggle' => 0, 457 | 'save_custom' => 0, 458 | 'custom_choice_button_text' => 'Add new choice', 459 | ), 460 | array( 461 | 'key' => 'field_678bd0cce3947', 462 | 'label' => 'Favicon', 463 | 'name' => 'favicon', 464 | 'aria-label' => '', 465 | 'type' => 'image', 466 | 'instructions' => '192 x 192', 467 | 'required' => 0, 468 | 'conditional_logic' => 0, 469 | 'wrapper' => array( 470 | 'width' => '33.3333333333', 471 | 'class' => '', 472 | 'id' => '', 473 | ), 474 | 'return_format' => 'url', 475 | 'library' => 'all', 476 | 'min_width' => 192, 477 | 'min_height' => 192, 478 | 'min_size' => '', 479 | 'max_width' => 192, 480 | 'max_height' => 192, 481 | 'max_size' => '', 482 | 'mime_types' => '', 483 | 'allow_in_bindings' => 0, 484 | 'preview_size' => 'medium', 485 | ), 486 | array( 487 | 'key' => 'field_lkjeqweoihjjws54324314', 488 | 'label' => 'OG Image', 489 | 'name' => 'og_image', 490 | 'aria-label' => '', 491 | 'type' => 'image', 492 | 'instructions' => '', 493 | 'required' => 0, 494 | 'conditional_logic' => 0, 495 | 'wrapper' => array( 496 | 'width' => '33.3333333333', 497 | 'class' => '', 498 | 'id' => '', 499 | ), 500 | 'return_format' => 'url', 501 | 'library' => 'all', 502 | 'min_width' => '', 503 | 'min_height' => '', 504 | 'min_size' => '', 505 | 'max_width' => '', 506 | 'max_height' => '', 507 | 'max_size' => '', 508 | 'mime_types' => '', 509 | 'allow_in_bindings' => 0, 510 | 'preview_size' => 'medium', 511 | ), 512 | ...$global_fields 513 | ), 514 | ), 515 | ), 516 | 'location' => array( 517 | array( 518 | array( 519 | 'param' => 'options_page', 520 | 'operator' => '==', 521 | 'value' => 'site-settings', 522 | ), 523 | ), 524 | ), 525 | 'menu_order' => 99, 526 | 'position' => 'normal', 527 | 'style' => 'seamless', 528 | 'label_placement' => 'top', 529 | 'instruction_placement' => 'label', 530 | 'hide_on_screen' => '', 531 | 'active' => true, 532 | 'description' => '', 533 | 'show_in_rest' => 1, 534 | ) ); 535 | 536 | } 537 | 538 | } 539 | 540 | new Render(); -------------------------------------------------------------------------------- /src/plugins/reactwp-seo/template/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/plugins/reactwp-seo/template/init.php: -------------------------------------------------------------------------------- 1 | ID)) 33 | 34 | || 35 | 36 | ((is_category() || is_tag() || is_tax()) && \ReactWP\Utils\Field::get('seo_do_not_index', 'term_' . $obj->term_id)) 37 | 38 | || 39 | 40 | ($obj && $obj->ID && \ReactWP\Utils\Field::get('seo_do_not_index', $obj->ID)) 41 | 42 | || 43 | 44 | (!get_option('blog_public') && !is_search()) 45 | ) { 46 | 47 | $robots['noindex'] = true; 48 | $robots['nofollow'] = true; 49 | $robots['index'] = false; 50 | $robots['follow'] = false; 51 | 52 | } elseif(is_search()) { 53 | 54 | $robots['noindex'] = true; 55 | $robots['nofollow'] = false; 56 | $robots['index'] = false; 57 | $robots['follow'] = true; 58 | 59 | } 60 | 61 | $robots['max-image-preview'] = 'large'; 62 | 63 | return $robots; 64 | 65 | }); 66 | 67 | add_filter('rwp_wp_head', function($wp_heads){ 68 | 69 | $obj = get_queried_object(); 70 | 71 | 72 | $wp_heads['charset'] = ''; 73 | $wp_heads['compatible'] = ''; 74 | $wp_heads['viewport'] = ''; 75 | $wp_heads['title'] = ''. self::title() .''; 76 | 77 | 78 | if(self::description()) 79 | $wp_heads['description'] = ''; 80 | 81 | 82 | $wp_heads['og_type'] = ''; 83 | 84 | if(self::og_type() === 'profile'){ 85 | 86 | if($obj->user_firstname) 87 | $wp_heads['og_profile_first_name'] = ''; 88 | 89 | if($obj->user_lastname) 90 | $wp_heads['og_profile_last_name'] = ''; 91 | 92 | if($obj->user_nicename) 93 | $wp_heads['og_profile_username'] = ''; 94 | 95 | 96 | } elseif(self::og_type() === 'article'){ 97 | 98 | $wp_heads['og_article_published_time'] = ''; 99 | 100 | $wp_heads['og_article_modified_time'] = ''; 101 | 102 | $wp_heads['og_article_author'] = ''; 103 | 104 | } 105 | 106 | 107 | if(self::og_url()) 108 | $wp_heads['og_url'] = ''; 109 | 110 | if(self::og_site_name()) 111 | $wp_heads['og_site_name'] = ''; 112 | 113 | if(self::og_title()) 114 | $wp_heads['og_title'] = ''; 115 | 116 | if(self::og_description()) 117 | $wp_heads['og_description'] = ''; 118 | 119 | if(self::og_image()) 120 | $wp_heads['og_image'] = ''; 121 | 122 | 123 | $fav = \ReactWP\Utils\Field::get('seo_favicon'); 124 | 125 | if($fav) 126 | $wp_heads['favicon'] = ''; 127 | 128 | 129 | return $wp_heads; 130 | 131 | }); 132 | 133 | } 134 | 135 | public static function site_name(){ 136 | 137 | return get_bloginfo('name'); 138 | 139 | } 140 | 141 | public static function title(){ 142 | 143 | $obj = get_queried_object(); 144 | 145 | if(is_search()) 146 | return (CL === 'fr' ? 'Résultat(s) de recherche pour' : 'Search result(s) for') . ' \'' . $_GET['s'] . '\'' . ' - ' . self::site_name(); 147 | 148 | elseif(is_404()) 149 | return (CL === 'fr' ? 'Erreur 404' : '404 Error') . ' - ' . self::site_name(); 150 | 151 | elseif(is_author()) 152 | return (\ReactWP\Utils\Field::get('seo_title_' . CL, 'user_' . $obj->ID) ? \ReactWP\Utils\Field::get('seo_title_' . CL, 'user_' . $obj->ID) : (CL === 'fr' ? 'Publication(s) de' : 'Post(s) of') . ' ' . $obj->display_name . ' - ' . self::site_name()); 153 | 154 | elseif(is_category() || is_tag() || is_tax()) 155 | return (\ReactWP\Utils\Field::get('seo_title_' . CL, 'term_' . $obj->term_id) ? \ReactWP\Utils\Field::get('seo_title_' . CL, 'term_' . $obj->term_id) : $obj->name . ' - ' . self::site_name()); 156 | 157 | elseif($obj && $obj->ID && \ReactWP\Utils\Field::get('seo_title_' . CL, $obj->ID)) 158 | return \ReactWP\Utils\Field::get('seo_title_' . CL, $obj->ID); 159 | 160 | elseif($obj && $obj->ID) 161 | return get_the_title($obj->ID) . ' - ' . self::site_name(); 162 | 163 | 164 | return null; 165 | 166 | } 167 | 168 | public static function description(){ 169 | 170 | $obj = get_queried_object(); 171 | 172 | if(is_author() && \ReactWP\Utils\Field::get('seo_description_' . CL, 'user_' . $obj->ID)) 173 | return \ReactWP\Utils\Field::get('seo_description_' . CL, 'user_' . $obj->ID); 174 | 175 | elseif((is_category() || is_tag() || is_tax()) && \ReactWP\Utils\Field::get('seo_description_' . CL, 'term_' . $obj->term_id)) 176 | return \ReactWP\Utils\Field::get('seo_description_' . CL, 'term_' . $obj->term_id); 177 | 178 | elseif($obj && $obj->ID && \ReactWP\Utils\Field::get('seo_description_' . CL, $obj->ID)) 179 | return \ReactWP\Utils\Field::get('seo_description_' . CL, $obj->ID); 180 | 181 | 182 | 183 | return \ReactWP\Utils\Field::get('seo_description_' . CL); 184 | 185 | } 186 | 187 | public static function og_type(){ 188 | 189 | if(is_singular(['post'])) 190 | return 'article'; 191 | elseif(is_author()) 192 | return 'profile'; 193 | 194 | return 'website'; 195 | 196 | } 197 | 198 | public static function og_site_name(){ 199 | 200 | return self::site_name(); 201 | 202 | } 203 | 204 | public static function og_title(){ 205 | 206 | $obj = get_queried_object(); 207 | 208 | 209 | if(is_author()) 210 | return (\ReactWP\Utils\Field::get('seo_og_title_' . CL, 'user_' . $obj->ID) ? \ReactWP\Utils\Field::get('seo_og_title_' . CL, 'user_' . $obj->ID) : (\ReactWP\Utils\Field::get('seo_og_title_' . CL) ? \ReactWP\Utils\Field::get('seo_og_title_' . CL) : __('Publications de', 'cg-core-plugin') . ' ' . $obj->display_name . ' - ' . self::site_name())); 211 | 212 | elseif(is_category() || is_tag() || is_tax()) 213 | return (\ReactWP\Utils\Field::get('seo_og_title_' . CL, 'term_' . $obj->term_id) ? \ReactWP\Utils\Field::get('seo_og_title_' . CL, 'term_' . $obj->term_id) : (\ReactWP\Utils\Field::get('seo_og_title_' . CL) ? \ReactWP\Utils\Field::get('seo_og_title_' . CL) : $obj->name . ' - ' . self::site_name())); 214 | 215 | elseif($obj && $obj->ID) 216 | return (\ReactWP\Utils\Field::get('seo_og_title_' . CL, $obj->ID) ? \ReactWP\Utils\Field::get('seo_og_title_' . CL, $obj->ID) : (\ReactWP\Utils\Field::get('seo_og_title_' . CL) ? \ReactWP\Utils\Field::get('seo_og_title_' . CL) : self::title())); 217 | 218 | 219 | 220 | return self::title(); 221 | 222 | } 223 | 224 | 225 | 226 | public static function og_description(){ 227 | 228 | 229 | $obj = get_queried_object(); 230 | 231 | if(is_author() && \ReactWP\Utils\Field::get('seo_og_description_' . CL, 'user_' . $obj->ID)) 232 | return \ReactWP\Utils\Field::get('seo_og_description_' . CL, 'user_' . $obj->ID); 233 | 234 | elseif((is_category() || is_tag() || is_tax()) && \ReactWP\Utils\Field::get('seo_og_description_' . CL, 'term_' . $obj->term_id)) 235 | return \ReactWP\Utils\Field::get('seo_og_description_' . CL, 'term_' . $obj->term_id); 236 | 237 | elseif($obj && $obj->ID && \ReactWP\Utils\Field::get('seo_og_description_' . CL, $obj->ID)) 238 | return \ReactWP\Utils\Field::get('seo_og_description_' . CL, $obj->ID); 239 | 240 | 241 | 242 | return \ReactWP\Utils\Field::get('seo_og_description_' . CL) ? \ReactWP\Utils\Field::get('seo_og_description_' . CL) : self::description(); 243 | 244 | } 245 | 246 | public static function og_image(){ 247 | 248 | 249 | $obj = get_queried_object(); 250 | 251 | if(is_author() && \ReactWP\Utils\Field::get('seo_og_image', 'user_' . $obj->ID)) 252 | return \ReactWP\Utils\Field::get('seo_og_image', 'user_' . $obj->ID); 253 | 254 | elseif((is_category() || is_tag() || is_tax()) && \ReactWP\Utils\Field::get('seo_og_image', 'term_' . $obj->term_id)) 255 | return \ReactWP\Utils\Field::get('seo_og_image', 'term_' . $obj->term_id); 256 | 257 | elseif($obj && $obj->ID && \ReactWP\Utils\Field::get('seo_og_image', $obj->ID)) 258 | return \ReactWP\Utils\Field::get('seo_og_image', $obj->ID); 259 | 260 | 261 | 262 | return \ReactWP\Utils\Field::get('seo_og_image'); 263 | 264 | } 265 | 266 | public static function og_url(){ 267 | 268 | global $wp; 269 | 270 | return home_url(add_query_arg((isset($_GET) ? $_GET : []), $wp->request)); 271 | 272 | } 273 | } 274 | new Seo(); -------------------------------------------------------------------------------- /src/plugins/reactwp-seo/template/uninstall.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/themes/reactwp/js/App.jsx: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import React, { StrictMode, useEffect, useState } from 'react'; 3 | import { createRoot } from 'react-dom/client'; 4 | import { createBrowserRouter, RouterProvider, Routes, Route, Outlet } from 'react-router-dom'; 5 | import { HelmetProvider } from 'react-helmet-async'; 6 | import NotFoundTemplate from './templates/NotFound'; 7 | import DefaultTemplate from './templates/Default'; 8 | import PageTransition from './inc/PageTransition'; 9 | import Metas from './inc/Metas'; 10 | import './inc/Loader'; 11 | import './inc/Scroller'; 12 | 13 | const templates = { 14 | DefaultTemplate 15 | }; 16 | 17 | const App = () => { 18 | 19 | const [isLoaded, setLoaded] = useState(false); 20 | 21 | useEffect(() => { 22 | setLoaded(true); 23 | }, []); 24 | 25 | return ( 26 | <> 27 | 28 | 29 | 30 | ); 31 | 32 | }; 33 | 34 | 35 | const router = createBrowserRouter([ 36 | { 37 | path: "/", 38 | element: , 39 | children: [ 40 | ...ROUTES.map((route, i) => { 41 | const Template = templates[route.template] || templates['DefaultTemplate']; 42 | 43 | route.seo.pageTitle = route.pageName; 44 | 45 | return { 46 | path: route.path, 47 | element: ( 48 | <> 49 | 50 |