├── .env.base
├── .gitignore
├── .lando.base.yml
├── .vscode
└── settings.json
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── bin
├── install-dependencies.sh
├── setup-wordpress.sh
├── svn-git-up
├── tail-php-error-log.sh
├── xdebug-off.sh
├── xdebug-on.sh
└── xdebug-resume.sh
├── php.ini
├── public
├── content
│ ├── mu-plugins
│ │ ├── .gitkeep
│ │ ├── allow-using-default-themes.php
│ │ └── wp-admin-redirect.php
│ ├── plugins
│ │ └── .gitkeep
│ └── themes
│ │ └── .gitkeep
├── functions.php
├── index.php
├── wp-config.php
└── wp-tests-config.php
└── wp-cli.yml
/.env.base:
--------------------------------------------------------------------------------
1 | # WordPressDev, Copyright 2019 Google LLC
2 | #
3 | # This program is free software: you can redistribute it and/or modify
4 | # it under the terms of the GNU General Public License as published by
5 | # the Free Software Foundation, either version 2 of the License, or
6 | # (at your option) any later version.
7 | #
8 | # This program is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU General Public License for more details.
12 | #
13 | # DO NOT MODIFY THIS FILE! Please create a .env file for overrides. That file is git-ignored.
14 |
15 | # Location of WordPress core develop directory
16 | WP_DEVELOP_DIR=/app/public/core-dev/
17 |
18 | # Location of WordPress core directory to run from
19 | WP_CORE_DIR=/app/public/core-dev/build/
20 |
21 | # Location of WordPress core test suite
22 | WP_TESTS_DIR=/app/public/core-dev/tests/phpunit/
23 |
24 | # Node version to use globally
25 | NODE_MAJOR=20
26 |
27 | # PHPUnit version to use globally
28 | PHPUNIT_MAJOR=9
29 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # WordPressDev, Copyright 2019 Google LLC
2 | #
3 | # This program is free software: you can redistribute it and/or modify
4 | # it under the terms of the GNU General Public License as published by
5 | # the Free Software Foundation, either version 2 of the License, or
6 | # (at your option) any later version.
7 | #
8 | # This program is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU General Public License for more details.
12 |
13 | public
14 | !public/functions.php
15 | !public/index.php
16 | !public/wp-config.php
17 | !public/wp-tests-config.php
18 | !public/content/mu-plugins/.gitkeep
19 | !public/content/mu-plugins/allow-using-default-themes.php
20 | !public/content/mu-plugins/wp-admin-redirect.php
21 | !public/content/plugins/.gitkeep
22 | !public/content/themes/.gitkeep
23 |
24 | .env
25 |
26 | [Tt]humbs.db
27 | [Dd]esktop.ini
28 | *.DS_store
29 | .DS_store?
30 | .lando.local.yml
31 | .lando.yml
32 | .idea
33 |
34 | wp-config-local.php
35 | wp-tests-config-local.php
36 | wp-cli.local.yml
37 |
38 | # This file is added by xdebug-on.sh; when present, Xdebug is re-enabled
39 | # after rebuilding.
40 | .xdebug-enabled
41 |
42 | # Ignored file allowing for additional dependencies to be installed.
43 | /bin/install-local-dependencies.sh
44 |
--------------------------------------------------------------------------------
/.lando.base.yml:
--------------------------------------------------------------------------------
1 | # WordPressDev, Copyright 2019 Google LLC
2 | #
3 | # This program is free software: you can redistribute it and/or modify
4 | # it under the terms of the GNU General Public License as published by
5 | # the Free Software Foundation, either version 2 of the License, or
6 | # (at your option) any later version.
7 | #
8 | # This program is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU General Public License for more details.
12 |
13 | name: wordpressdev
14 |
15 | recipe: wordpress
16 |
17 | config:
18 | php: 8.2
19 | via: nginx
20 | webroot: public
21 | database: mariadb
22 | composer_version: 2
23 | xdebug: false # This needs to be false initially because otherwise provisioning takes much longer.
24 | config:
25 | php: php.ini
26 |
27 | env_file:
28 | - .env.base
29 | - .env
30 |
31 | proxy:
32 | appserver_nginx:
33 | - wordpressdev.lndo.site
34 | - "*.wordpressdev.lndo.site"
35 |
36 | services:
37 | appserver:
38 | overrides:
39 | environment:
40 | # Support debugging with XDEBUG.
41 | PHP_IDE_CONFIG: "serverName=wordpressdev.lndo.site"
42 | install_dependencies_as_root:
43 | - bash bin/install-dependencies.sh
44 | run:
45 | - bash bin/setup-wordpress.sh
46 | run_as_root:
47 | - bash /app/bin/xdebug-resume.sh
48 |
49 | tooling:
50 | npm:
51 | service: appserver
52 | npx:
53 | service: appserver
54 | yarn:
55 | service: appserver
56 | grunt:
57 | service: appserver
58 | cmd: "npx grunt"
59 | gulp:
60 | service: appserver
61 | cmd: "npx gulp"
62 | composer:
63 | service: appserver
64 | git:
65 | service: appserver
66 | svn:
67 | service: appserver
68 | phpunit:
69 | service: appserver
70 | log:
71 | service: appserver
72 | cmd: bash /app/bin/tail-php-error-log.sh
73 | wp:
74 | service: appserver
75 | xdebug-on:
76 | service: appserver
77 | description: Enable Xdebug for nginx.
78 | cmd: bash /app/bin/xdebug-on.sh
79 | user: root
80 | xdebug-off:
81 | service: appserver
82 | description: Disable Xdebug for nginx.
83 | cmd: bash /app/bin/xdebug-off.sh
84 | user: root
85 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "files.exclude": {
3 | "public/core-dev/build": true
4 | },
5 | "search.useIgnoreFiles": false
6 | }
7 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contribute to WordPressDev
2 |
3 | Bug reports, patches, and other contributions are very welcome. When contributing, please ensure you stick to the following guidelines.
4 |
5 | ## Writing a Bug Report
6 |
7 | When writing a bug report...
8 |
9 | * [open an issue](https://github.com/GoogleChromeLabs/wordpressdev/issues/new)
10 | * clearly explain what you're experiencing and include relevant details about your environment
11 |
12 | ## Contributing Code
13 |
14 | When contributing code...
15 |
16 | * fork the `master` branch of the repository on GitHub
17 | * make changes to the forked repository
18 | * when writing PHP code, make sure you stick to the [WordPress](https://make.wordpress.org/core/handbook/best-practices/coding-standards/) coding standards
19 | * make sure you document the code properly
20 | * when committing, in addition to a note about the fix, please reference your issue (if present)
21 | * push the changes to your fork and [submit a pull request](https://github.com/GoogleChromeLabs/wordpressdev/compare) to the `master` branch
22 |
23 | ### Contributor License Agreement
24 |
25 | Contributions to this project must be accompanied by a Contributor License
26 | Agreement. You (or your employer) retain the copyright to your contribution;
27 | this simply gives us permission to use and redistribute your contributions as
28 | part of the project. Head over to to see
29 | your current agreements on file or to sign a new one.
30 |
31 | You generally only need to submit a CLA once, so if you've already submitted one
32 | (even if it was for a different project), you probably don't need to do it
33 | again.
34 |
35 | ### Code reviews
36 |
37 | All submissions, including submissions by project members, require review. We
38 | use GitHub pull requests for this purpose. Consult
39 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
40 | information on using pull requests.
41 |
42 | ## Community Guidelines
43 |
44 | This project follows
45 | [Google's Open Source Community Guidelines](https://opensource.google.com/conduct/).
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 |
294 | Copyright (C)
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | , 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # WordPressDev Environment
2 |
3 | This is a [WordPress development](https://make.wordpress.org) environment based on [Lando](https://docs.devwithlando.io/). It allows for [core development](https://make.wordpress.org/core/), [plugin development](https://make.wordpress.org/plugins/), and [theme development](https://make.wordpress.org/themes/). It is intended to largely be a Docker-based port of [VVV](https://varyingvagrantvagrants.org/).
4 |
5 | **Disclaimer:** There is no official support for this environment. Our team at Google is using it, and we are happy to share it and collaborate on it with the WordPress community. The environment is still in a very early development stage, so use it at your own risk.
6 |
7 | ## Features
8 |
9 | * Standalone Development Environment based on Lando, which itself requires Docker
10 | * WordPress Core Development Repository via [Git](https://github.com/WordPress/wordpress-develop) and [Subversion](https://core.trac.wordpress.org/browser/trunk/), allowing to seamlessly use both within a single directory
11 | * WordPress Plugin & Theme Development Environment, decoupled from Core Development Repository
12 | * PHPUnit & PHPCodeSniffer
13 | * NPM & Grunt
14 |
15 | ## Setup
16 |
17 | * Install the latest version of Lando via a [GitHub DMG file](https://github.com/lando/lando/releases). You also need to have Docker installed, but Lando will take care of that for you if you don't.
18 | * Clone this repository into a directory of your choice. Navigate to that directory.
19 | * Run `lando start`. When doing this for the first time, it will set the environment up for you, so it will take a bit longer than on subsequent starts.
20 | * Access your site under `https://wordpressdev.lndo.site/`. If you're having trouble connecting, you may be facing the [DNS Rebinding Protection issue](https://docs.devwithlando.io/issues/dns-rebind.html). To fix this, and to ensure you can develop while offline, follow the [Working Offline](https://docs.devwithlando.io/config/proxy.html#working-offline-or-using-custom-domains) steps. In other words, add the following to your host machine's `/etc/hosts` file:
21 | ```
22 | 127.0.0.1 wordpressdev.lndo.site
23 | ```
24 |
25 | If this is your very first Lando project, make sure that your system trusts the SSL certificate that Lando generates via: `sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/.lando/certs/lndo.site.pem` You might need to restart your browser to see the change being reflected.
26 |
27 | An additional note on Lando: The project is currently approaching its version 3.0 release, with frequent RC releases. As this environment is based on that latest version, make sure to check back for [new Lando versions](https://github.com/lando/lando/releases) regularly.
28 |
29 | ## Usage
30 |
31 | #### Contributing to Core
32 |
33 | WordPress core contributions are done in the `public/core-dev` directory which is both a Git clone and SVN checkout. To update the Git and SVN in tandem, do `git svn-up` in that directory to update to the latest `trunk`/`master`. To switch/update another branch, do `git svn-up $branch`. This `git svn-up` command is an alias to the repo's [`bin/svn-git-up`](bin/svn-git-up) script.
34 |
35 | ##### Setup Your Fork
36 |
37 | 1. Fork the [wordpress-develop](https://github.com/WordPress/wordpress-develop) repository to your GitHub account.
38 | 2. In your teriminal, navigate to the `./public/core-dev` directory.
39 | 3. Add the GitHub repository as a remote.
40 | ```git remote add git@github.com:/wordpress-develop.git```
41 |
42 | You can now pull down from the upstream via `git pull origin` or push to your remote with `git push `.
43 |
44 | ##### Setup Your Workspace
45 |
46 | You will work and commit in the `./public/core-dev/src` directory while your changes are reflected on the frontend from the `./public/core-dev/build` directory. Consult `./public/core-dev/composer.json` or `./public/core-dev/package.json` for avaiable commands such as `npm run watch` to aid your workflow.
47 |
48 | 1. Create a [Trac ticket](https://make.wordpress.org/core/reports/) with your proposed changes.
49 | 2. Create a branch with your ticket ID as reference with `git checkout -b trac-XXXXX`.
50 | 3. Watch for file changes by running `npm run watch` from inside the `./public/core-dev/src` directory.
51 | 4. Make your changes.
52 | 5. Commit early and often.
53 | 6. Write tests.
54 | 7. Push your changes to your GitHub remote with `git push `.
55 |
56 | Now you can view your changes on GitHub and send the pull request to the [wordpress-develop](https://github.com/WordPress/wordpress-develop) repository.
57 |
58 | #### Theme and Plugin Development
59 |
60 | WordPress plugin and theme development should happen in `public/content`, which is a custom `wp-content` directory, decoupled from the WordPress core repository. The environment automatically takes care of setting WordPress constants appropriately so that the core and content directories are connected, so you don't need to worry about this.
61 |
62 | #### Environment Configuration
63 |
64 | You can customize the environment. Variables placed in a custom `.env` file in the root directory will override similar variables from the `.env.base` file. Custom CLI configuration can be set up via a `wp-cli.local.yml` file (taking precedence over `wp-cli.yml`), and even custom Lando configuration is possible via a `.lando.yml` file (taking precedence over `.lando.base.yml`). For changes to the Lando configuration or environment variables, you will need to run `lando rebuild` to apply them.
65 |
66 | #### Lando Commands
67 |
68 | Run `lando stop` to turn off the environment and `lando start` to restart it again later.
69 |
70 | Run `lando phpunit` to perform all tests or `lando phpunit tests/phpunit/tests/` to perform a specific set of tests.
71 |
72 | You can learn more about available commands in the [Lando documentation](https://docs.devwithlando.io/) or by running `lando` in your terminal.
73 |
74 | ## Troubleshooting
75 |
76 | If you are having problems after running `landor start` such as `git svn-up` not recognizing the `.svn` or `.git` directories, run `lando rebuild` to rebuild the entire `./public/core-dev` directory.
77 |
78 | ## Contributing
79 |
80 | Any kind of contributions to WordPressDev are welcome. Please [read the contributing guidelines](https://github.com/GoogleChromeLabs/wordpressdev/blob/master/CONTRIBUTING.md) to get started.
81 |
--------------------------------------------------------------------------------
/bin/install-dependencies.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # This scripts installs WordPressDev environment dependencies.
4 | #
5 | # WordPressDev, Copyright 2019 Google LLC
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU General Public License as published by
9 | # the Free Software Foundation, either version 2 of the License, or
10 | # (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU General Public License for more details.
16 |
17 | if [[ -z "$LANDO_MOUNT" ]]; then
18 | echo "Error: Must be run the appserver.";
19 | exit 1
20 | fi
21 |
22 | cd "$(dirname "$0")"
23 |
24 | echo "Installing Dependencies"
25 | set -xe
26 |
27 | apt-get update -y
28 | apt-get -y install libyaml-dev
29 | if yes | pecl install yaml; then
30 | echo 'extension=yaml.so' > /usr/local/etc/php/conf.d/yaml.ini
31 | else
32 | echo "Did not install yaml."
33 | fi
34 |
35 | apt-get install ca-certificates curl gnupg -y
36 |
37 | mkdir -p /etc/apt/keyrings
38 | curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
39 | echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
40 | apt-get update -y
41 | apt-get install nodejs -y
42 |
43 | curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
44 | echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
45 | apt-get update
46 | apt-get install yarn -y
47 |
48 | apt-get install zip -y
49 | apt-get install subversion -y
50 |
51 | # Download phpunit pahr based on the major version.
52 | if [[ ! -e /usr/local/bin/phpunit ]]; then
53 | curl -L https://phar.phpunit.de/phpunit-$PHPUNIT_MAJOR.phar -o /usr/local/bin/phpunit
54 | chmod +x /usr/local/bin/phpunit
55 | fi
56 |
57 | # Install dependencies that are unique to the user environment.
58 | if [ -e install-local-dependencies.sh ]; then
59 | bash ./install-local-dependencies.sh
60 | fi
61 |
--------------------------------------------------------------------------------
/bin/setup-wordpress.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # This script downloads and sets up WordPress for contributing.
4 | #
5 | # WordPressDev, Copyright 2019 Google LLC
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU General Public License as published by
9 | # the Free Software Foundation, either version 2 of the License, or
10 | # (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU General Public License for more details.
16 |
17 | if [[ -z "$LANDO_MOUNT" ]]; then
18 | echo "Error: Must be run the appserver.";
19 | exit 1
20 | fi
21 |
22 | set -ex
23 |
24 | if [[ ! -e "$LANDO_MOUNT/public/core-dev" ]]; then
25 | git clone https://github.com/WordPress/wordpress-develop.git "$LANDO_MOUNT/public/core-dev"
26 | fi
27 |
28 | if [[ ! -e "$LANDO_MOUNT/public/core-dev/.svn" ]]; then
29 | cd "$LANDO_MOUNT"
30 | if svn co --ignore-externals https://develop.svn.wordpress.org/trunk/ tmp-svn; then
31 | mv tmp-svn/.svn public/core-dev/.svn
32 | rm -rf tmp-svn
33 | else
34 | echo "SVN failed to install. Nevertheless, you should still be able to run WordPress."
35 | if [[ -e tmp-svn ]]; then
36 | rm -rf tmp-svn
37 | fi
38 | fi
39 | fi
40 |
41 | cd "$LANDO_MOUNT/public/core-dev"
42 |
43 | if [[ ! -e "wp-config.php" ]]; then
44 | echo -e " wp-config.php
45 | fi
46 | if [[ ! -e "wp-tests-config.php" ]]; then
47 | echo -e " wp-tests-config.php
48 | fi
49 |
50 | if [[ ! -e "$LANDO_MOUNT/public/core-dev/vendor" ]]; then
51 | cd $LANDO_MOUNT/public/core-dev
52 | composer install
53 | fi
54 |
55 | if [[ ! -e "$LANDO_MOUNT/public/core-dev/node_modules" ]]; then
56 | cd "$LANDO_MOUNT/public/core-dev"
57 | npm install
58 | fi
59 |
60 | if [[ ! -e "$LANDO_MOUNT/public/core-dev/build" ]]; then
61 | cd "$LANDO_MOUNT/public/core-dev"
62 | npx grunt
63 |
64 | # In case `/src` directory is used in testing environment.
65 | npx grunt build --dev
66 | fi
67 |
68 | cd "$LANDO_MOUNT/public/core-dev"
69 | if ! git config -l --local | grep -q 'alias.svn-up'; then
70 | git config alias.svn-up '! ../../bin/svn-git-up $1';
71 | fi
72 |
73 | # When all above steps are skipped, we need to make sure the database is running.
74 | echo "Waiting 5 seconds to ensure database has started..."
75 | sleep 5
76 |
77 | # At this point, wp-cli tries to load config files from the current directory.
78 | # We need to change to root directory to avoid this.
79 | cd "$LANDO_MOUNT"
80 |
81 | if ! wp core is-installed; then
82 | wp core install --url="https://$LANDO_APP_NAME.$LANDO_DOMAIN/" --title="WordPress Develop" --admin_name="admin" --admin_email="admin@local.test" --admin_password="password"
83 | wp rewrite structure '/%year%/%monthnum%/%day%/%postname%/'
84 | fi
85 |
--------------------------------------------------------------------------------
/bin/svn-git-up:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # This scripts updates Git and SVN repos checked out in the same directory.
4 | #
5 | # Pass a branch name like 4.6 as the sole argument to checkout that branch. Otherwise, master/trunk is checked out.
6 | #
7 | # WordPressDev, Copyright 2019 Google LLC
8 | #
9 | # This program is free software: you can redistribute it and/or modify
10 | # it under the terms of the GNU General Public License as published by
11 | # the Free Software Foundation, either version 2 of the License, or
12 | # (at your option) any later version.
13 | #
14 | # This program is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | # GNU General Public License for more details.
18 |
19 | cd $( git rev-parse --show-toplevel )
20 |
21 | if [[ ! -e .svn ]]; then
22 | echo "Error: Unable to find svn root."
23 | exit 1
24 | fi
25 | if [[ ! -e .git ]]; then
26 | echo "Error: There is no git directory."
27 | exit 1
28 | fi
29 |
30 | set -ex
31 | git fetch origin --tags
32 |
33 | git_branch=trunk
34 | svn_path='^/trunk'
35 | if [[ ! -z "$1" ]] && [[ "$1" != 'trunk' ]] && [[ "$1" != 'trunk' ]]; then
36 | git_branch="$1"
37 | svn_path="^/branches/$1"
38 | fi
39 |
40 | git stash save
41 | svn switch --force "${svn_path}" --ignore-externals
42 | svn revert -R .
43 | if [[ $(git branch --show-current) != "$git_branch" ]]; then
44 | git checkout -f "${git_branch}"
45 | fi
46 | git reset --hard "origin/${git_branch}"
47 | svn up --force --accept=theirs-full --ignore-externals
48 |
49 | set +x
50 | set +e
51 | echo
52 | echo "----------------------------"
53 |
54 | echo "## svn status"
55 | if ! svn status --ignore-externals | grep -Ev '^(\?|\X)'; then
56 | echo 'nothing to commit'
57 | fi
58 |
59 | echo
60 | echo "## git status"
61 | git status -uno
62 |
--------------------------------------------------------------------------------
/bin/tail-php-error-log.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # This script tails the debug log for WordPress.
4 | #
5 | # WordPressDev, Copyright 2019 Google LLC
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU General Public License as published by
9 | # the Free Software Foundation, either version 2 of the License, or
10 | # (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU General Public License for more details.
16 |
17 | # See WP_DEBUG_LOG in wp-config.php.
18 | ERROR_LOG_PATH="/tmp/php-error.log"
19 |
20 | if [[ ! -e "$ERROR_LOG_PATH" ]]; then
21 | touch "$ERROR_LOG_PATH"
22 | fi
23 |
24 | echo "Assuming WP_DEBUG_LOG defined and set to $ERROR_LOG_PATH..."
25 |
26 | tail -f "$ERROR_LOG_PATH"
27 |
--------------------------------------------------------------------------------
/bin/xdebug-off.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | if [ -e /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini ]; then
6 | rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
7 | pkill -o -USR2 php-fpm
8 | echo "Xdebug disabled"
9 | else
10 | echo "Xdebug already disabled"
11 | fi
12 |
13 | if [ -e /app/.xdebug-enabled ]; then
14 | rm /app/.xdebug-enabled
15 | fi
16 |
--------------------------------------------------------------------------------
/bin/xdebug-on.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | docker-php-ext-enable xdebug
6 | pkill -o -USR2 php-fpm
7 | touch /app/.xdebug-enabled
8 | echo "Xdebug enabled"
9 |
--------------------------------------------------------------------------------
/bin/xdebug-resume.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | if [ -e /app/.xdebug-enabled ]; then
6 | bash /app/bin/xdebug-on.sh
7 | fi
8 |
--------------------------------------------------------------------------------
/php.ini:
--------------------------------------------------------------------------------
1 | xdebug.remote_enable = 1
2 | xdebug.remote_autostart = 0
3 | xdebug.remote_connect_back = 0
4 | xdebug.remote_port=9000
5 | html_errors = 1
6 |
--------------------------------------------------------------------------------
/public/content/mu-plugins/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GoogleChromeLabs/wordpressdev/cf62150a9a93849482effd2ed6602fa58861db01/public/content/mu-plugins/.gitkeep
--------------------------------------------------------------------------------
/public/content/mu-plugins/allow-using-default-themes.php:
--------------------------------------------------------------------------------
1 | domain;
69 | $path = ! empty( $GLOBALS['current_blog']->path ) && '/' !== $GLOBALS['current_blog']->path ? $GLOBALS['current_blog']->path : '';
70 |
71 | return 'https://' . $domain . $path;
72 | }
73 |
74 | // Rely on the 'HTTP_HOST' server variable if available.
75 | if ( isset( $_SERVER['HTTP_HOST'] ) ) {
76 | return 'https://' . strtolower( stripslashes( $_SERVER['HTTP_HOST'] ) );
77 | }
78 |
79 | // Use the domain defined by the Lando environment.
80 | if ( false !== getenv( 'LANDO_APP_NAME' ) && false !== getenv( 'LANDO_DOMAIN' ) ) {
81 | return 'https://' . getenv( 'LANDO_APP_NAME' ) . '.' . getenv( 'LANDO_DOMAIN' );
82 | }
83 |
84 | // Fall back to a hard-coded 'https://wordpressdev.lndo.site' as last resort.
85 | return 'https://wordpressdev.lndo.site';
86 | }
87 |
88 | /**
89 | * Detects and sets the location of the WordPress core and content directories to use.
90 | *
91 | * The function sets the 'ABSPATH' constant based on the first function parameter or the
92 | * {@see _wordpressdev_detect_core_path_relative()} function.
93 | *
94 | * The function also sets the 'WP_CONTENT_DIR' constant based on the second function parameter.
95 | *
96 | * @access private
97 | *
98 | * @param string $core_path_relative Optional. WordPress core path, relative to the 'public' directory. Default
99 | * is determined by {@see _wordpressdev_detect_core_path_relative()}.
100 | * @param string $content_path_relative Optional. WordPress content path, relative to the 'public' directory. Default
101 | * is 'content'.
102 | */
103 | function _wordpressdev_set_directory_constants( $core_path_relative = '', $content_path_relative = '' ) {
104 | if ( empty( $core_path_relative ) ) {
105 | $core_path_relative = _wordpressdev_detect_core_path_relative();
106 | }
107 | if ( empty( $content_path_relative ) ) {
108 | $content_path_relative = 'content';
109 | }
110 |
111 | // Define custom 'WP_CORE_PATH_RELATIVE' constant, for WordPress core directory relative to 'public'.
112 | if ( ! defined( 'WP_CORE_PATH_RELATIVE' ) ) {
113 | define( 'WP_CORE_PATH_RELATIVE', $core_path_relative );
114 | }
115 |
116 | // Define custom 'WP_CONTENT_PATH_RELATIVE' constant, for WordPress content directory relative to 'public'.
117 | if ( ! defined( 'WP_CONTENT_PATH_RELATIVE' ) ) {
118 | define( 'WP_CONTENT_PATH_RELATIVE', $content_path_relative );
119 | }
120 |
121 | $core_path_relative = ! empty( WP_CORE_PATH_RELATIVE ) ? '/' . WP_CORE_PATH_RELATIVE : '';
122 | $content_path_relative = ! empty( WP_CONTENT_PATH_RELATIVE ) ? '/' . WP_CONTENT_PATH_RELATIVE : '';
123 |
124 | // Define 'ABSPATH'.
125 | if ( ! defined( 'ABSPATH' ) ) {
126 | define( 'ABSPATH', dirname( __FILE__ ) . $core_path_relative . '/' );
127 | }
128 |
129 | // Define 'WP_CONTENT_DIR'.
130 | if ( ! defined( 'WP_CONTENT_DIR' ) ) {
131 | define( 'WP_CONTENT_DIR', dirname( __FILE__ ) . $content_path_relative );
132 | }
133 | }
134 |
135 | /**
136 | * Defines additional URL constants for WordPress core and content directories to use.
137 | *
138 | * The function sets the 'WP_SITEURL' and 'WP_CONTENT_URL' constants based on the first function parameter
139 | * or the {@see _wordpressdev_detect_home_url()} function.
140 | *
141 | * @access private
142 | *
143 | * @param string $home_url Optional. WordPress home URL. Default is determined by {@see _wordpressdev_detect_home_url()}.
144 | */
145 | function _wordpressdev_set_url_constants( $home_url = '' ) {
146 | if ( empty( $home_url ) ) {
147 | $home_url = _wordpressdev_detect_home_url();
148 | }
149 |
150 | // Define 'WP_HOME'.
151 | if ( ! defined( 'WP_HOME' ) ) {
152 | define( 'WP_HOME', $home_url );
153 | }
154 |
155 | $core_path_relative = ! empty( WP_CORE_PATH_RELATIVE ) ? '/' . WP_CORE_PATH_RELATIVE : '';
156 | $content_path_relative = ! empty( WP_CONTENT_PATH_RELATIVE ) ? '/' . WP_CONTENT_PATH_RELATIVE : '';
157 |
158 | // Define 'WP_SITEURL'.
159 | if ( ! defined( 'WP_SITEURL' ) ) {
160 | define( 'WP_SITEURL', rtrim( $home_url, '/' ) . $core_path_relative );
161 | }
162 |
163 | // Define 'WP_CONTENT_URL'.
164 | if ( ! defined( 'WP_CONTENT_URL' ) ) {
165 | define( 'WP_CONTENT_URL', rtrim( $home_url, '/' ) . $content_path_relative );
166 | }
167 | }
168 |
--------------------------------------------------------------------------------
/public/index.php:
--------------------------------------------------------------------------------
1 | 'wordpress',
38 | 'DB_USER' => 'wordpress',
39 | 'DB_PASSWORD' => 'wordpress',
40 | 'DB_HOST' => 'database:3306',
41 | 'DB_CHARSET' => 'utf8',
42 | 'DB_COLLATE' => '',
43 |
44 | 'AUTH_KEY' => 'put your unique phrase here',
45 | 'SECURE_AUTH_KEY' => 'put your unique phrase here',
46 | 'LOGGED_IN_KEY' => 'put your unique phrase here',
47 | 'NONCE_KEY' => 'put your unique phrase here',
48 | 'AUTH_SALT' => 'put your unique phrase here',
49 | 'SECURE_AUTH_SALT' => 'put your unique phrase here',
50 | 'LOGGED_IN_SALT' => 'put your unique phrase here',
51 | 'NONCE_SALT' => 'put your unique phrase here',
52 |
53 | 'FORCE_SSL_ADMIN' => true,
54 | 'WP_DEBUG' => true,
55 | 'SCRIPT_DEBUG' => true,
56 | 'SAVEQUERIES' => true,
57 | 'WP_DEBUG_LOG' => '/tmp/php-error.log',
58 | 'WP_DISABLE_FATAL_ERROR_HANDLER' => true,
59 | 'JETPACK_DEV_DEBUG' => true,
60 | 'WP_ENVIRONMENT_TYPE' => 'development',
61 | );
62 | foreach ( $constants as $constant_name => $constant_value ) {
63 | if ( ! defined( $constant_name ) ) {
64 | define( $constant_name, $constant_value );
65 | }
66 | }
67 | unset( $constants, $constant_name, $constant_value );
68 |
69 | /* That's all, stop editing! Happy blogging. */
70 |
71 | if ( defined( 'MULTISITE' ) && MULTISITE ) {
72 | // Set 'WP_SITEURL' and 'WP_CONTENT_URL' based on 'WP_HOME' on the 'ms_loaded' action hook.
73 | $wp_filter = array(
74 | 'ms_loaded' => array(
75 | 1 => array(
76 | '_wordpressdev_set_url_constants' => array(
77 | 'function' => '_wordpressdev_set_url_constants',
78 | 'accepted_args' => 0,
79 | ),
80 | ),
81 | ),
82 | );
83 | } else {
84 | // Set 'WP_SITEURL' and 'WP_CONTENT_URL' based on 'WP_HOME'.
85 | _wordpressdev_set_url_constants();
86 | }
87 |
--------------------------------------------------------------------------------
/public/wp-tests-config.php:
--------------------------------------------------------------------------------
1 | 'wordpress',
50 | 'DB_USER' => 'wordpress',
51 | 'DB_PASSWORD' => 'wordpress',
52 | 'DB_HOST' => 'database:3306',
53 | 'DB_CHARSET' => 'utf8',
54 | 'DB_COLLATE' => '',
55 |
56 | 'AUTH_KEY' => 'put your unique phrase here',
57 | 'SECURE_AUTH_KEY' => 'put your unique phrase here',
58 | 'LOGGED_IN_KEY' => 'put your unique phrase here',
59 | 'NONCE_KEY' => 'put your unique phrase here',
60 | 'AUTH_SALT' => 'put your unique phrase here',
61 | 'SECURE_AUTH_SALT' => 'put your unique phrase here',
62 | 'LOGGED_IN_SALT' => 'put your unique phrase here',
63 | 'NONCE_SALT' => 'put your unique phrase here',
64 |
65 | 'WP_TESTS_DOMAIN' => 'example.org',
66 | 'WP_TESTS_EMAIL' => 'admin@example.org',
67 | 'WP_TESTS_TITLE' => 'Test Blog',
68 | 'WP_HOME' => 'http://example.org',
69 |
70 | /*
71 | * Path to the theme to test with.
72 | *
73 | * The 'default' theme is symlinked from test/phpunit/data/themedir1/default into
74 | * the themes directory of the WordPress installation defined above.
75 | */
76 | 'WP_DEFAULT_THEME' => 'default',
77 |
78 | // Test with WordPress debug mode (default).
79 | 'WP_DEBUG' => true,
80 | 'WPLANG' => '',
81 | 'WP_PHP_BINARY' => 'php',
82 | );
83 | foreach ( $constants as $constant_name => $constant_value ) {
84 | if ( ! defined( $constant_name ) ) {
85 | define( $constant_name, $constant_value );
86 | }
87 | }
88 | unset( $constants, $constant_name, $constant_value );
89 |
90 | // Test with multisite enabled.
91 | // Alternatively, use the tests/phpunit/multisite.xml configuration file.
92 | // define( 'WP_TESTS_MULTISITE', true );
93 |
94 | // Force known bugs to be run.
95 | // Tests with an associated Trac ticket that is still open are normally skipped.
96 | // define( 'WP_TESTS_FORCE_KNOWN_BUGS', true );
97 |
98 | /* That's all, stop editing! Happy blogging. */
99 |
100 | // Set 'WP_SITEURL' and 'WP_CONTENT_URL' based on 'WP_HOME'.
101 | _wordpressdev_set_url_constants();
102 |
--------------------------------------------------------------------------------
/wp-cli.yml:
--------------------------------------------------------------------------------
1 | # WordPressDev, Copyright 2019 Google LLC
2 | #
3 | # This program is free software: you can redistribute it and/or modify
4 | # it under the terms of the GNU General Public License as published by
5 | # the Free Software Foundation, either version 2 of the License, or
6 | # (at your option) any later version.
7 | #
8 | # This program is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU General Public License for more details.
12 | #
13 | # DO NOT MODIFY THIS FILE! Instead, please create a copy named wp-cli.local.yml and make modifications there.
14 | path: public/core-dev/build
15 |
--------------------------------------------------------------------------------