Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from deliciousbrains:master #1

Open
wants to merge 83 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
eeb44ca
Suggest to install Mozart to prefix wrap the library
coenjacobs Oct 11, 2017
565d159
Updated README to explain proper install through Composer
coenjacobs Oct 11, 2017
646c094
Add a note about process instantiation
markjaquith Jul 6, 2018
7729aff
Add filters for `wp_remote_post()` arguments.
boonebgorges Jul 20, 2018
36cea4c
Ignore PhpStorm directory
polevaultweb Feb 13, 2020
c8db1b9
Update composer file with deliciousbrains vendor and author details.
polevaultweb Feb 13, 2020
b082e78
Fixed composer.json license to be GPL 2+, fixes https://github.com/de…
polevaultweb Jul 30, 2020
6859922
Merge pull request #57 from markjaquith/patch-1
polevaultweb Jul 30, 2020
4c2747b
Merge branch 'master' into suggest-mozart
polevaultweb Jul 30, 2020
50bcb36
Merge pull request #46 from coenjacobs/suggest-mozart
polevaultweb Jul 30, 2020
00291be
Update vendor name in readme
polevaultweb Jul 30, 2020
1ad6f26
Move the checking if classes exists to the plugin bootstrap file, ins…
polevaultweb Jul 30, 2020
ffc4e9b
Fix converting byte notation not converted to bytes correctly if not …
polevaultweb Jul 31, 2020
51860bc
Merge branch 'http-request-filters' of https://github.com/boonebgorge…
polevaultweb Jul 31, 2020
2cbee1a
Merge branch 'boonebgorges-http-request-filters'
polevaultweb Jul 31, 2020
a86825b
Added check for is_process_running() in dispatch()
jack-arturo Dec 22, 2021
b6d2805
Apply minor formatting and documentation updates
ianmjones Apr 11, 2023
2e36610
Merge pull request #89 from verygoodplugins/master
ianmjones Apr 11, 2023
cc7b24c
Dispatch returns HTTP Response array, WP_Error on failure, or false i…
ianmjones Apr 11, 2023
bf3fbc7
Add skeleton unit tests setup
ianmjones Apr 12, 2023
352519c
Add minimal Makefile for running unit tests
ianmjones Apr 12, 2023
f2558bc
Add test-style Makefile target for running phpcs
ianmjones Apr 13, 2023
2e66054
Use mariadb-client instead of mysql-client in CircleCI
ianmjones Apr 13, 2023
ac23ebb
Simplify CircleCI workflow and use recent images
ianmjones Apr 13, 2023
ab8a460
Display PHP and Composer versions at start of CircleCI jobs
ianmjones Apr 13, 2023
e4880d7
Use MySQL 5.7 in CircleCI workflow
ianmjones Apr 13, 2023
9b0cccb
Add mysql-client to CircleCI workflow job
ianmjones Apr 13, 2023
6cde985
Update versions of PHP used for CircleCI tests
ianmjones Apr 13, 2023
b1c7ec5
Remove PHP 8.1 from CircleCI tests
ianmjones Apr 13, 2023
6093f2e
Add unit test for WP_Background_Process::push_to_queue
ianmjones Apr 13, 2023
4447d1d
Add information to README regarding running tests
ianmjones Apr 14, 2023
3df7ecd
Update README to note that PHP 5.6+ is required
ianmjones Apr 14, 2023
c6168c3
Merge pull request #96 from deliciousbrains/add-unit-tests
ianmjones Apr 14, 2023
8feb370
Clean out data on save so new data isn't prepended to next in-process…
ianmjones Apr 14, 2023
949b4ab
Add get_batches function to WP_Background_Process class
ianmjones Apr 14, 2023
1b26374
Port forward new features and improvements from WP Offload Media
ianmjones Apr 14, 2023
64a6139
Add unit test for WP_Background_Process::save()
ianmjones Apr 17, 2023
203e649
Add unit test for WP_Background_Process::cancel()
ianmjones Apr 17, 2023
550c202
Add unit test for WP_Background_Process::pause()
ianmjones Apr 17, 2023
77f5029
Add unit test for WP_Background_Process::delete()
ianmjones Apr 17, 2023
7601028
Add unit test for WP_Background_Process::delete_all()
ianmjones Apr 17, 2023
32bb7d8
Add unit test for WP_Background_Process::resume()
ianmjones Apr 17, 2023
57a7a17
Add unit test for WP_Background_Process::update()
ianmjones Apr 17, 2023
3dc2eb5
Add unit test for WP_Background_Process::maybe_handle() when cancelling
ianmjones Apr 17, 2023
a673aea
Add unit test for WP_Background_Process::maybe_handle() when pausing …
ianmjones Apr 17, 2023
358cedf
Add unit tests for WP_Background_Process::maybe_handle() simple scena…
ianmjones Apr 17, 2023
ebebef0
Add unit tests for WP_Background_Process::is_processing()
ianmjones Apr 17, 2023
3608207
Update README with information about background process statuses
ianmjones Apr 17, 2023
cb34ba1
Add WP_Background_Process::is_queued()
ianmjones Apr 18, 2023
f172c83
Add WP_Background_Process::is_active()
ianmjones Apr 18, 2023
b6dd6b7
Streamline WP_Background_Process::is_queued() and WP_Background_Proce…
ianmjones Apr 18, 2023
d5ef95c
Merge pull request #97 from deliciousbrains/improvements-from-wp-offl…
ianmjones Apr 18, 2023
c36c9d2
Ensure task processing cleanly pauses or cancels as soon as possible
ianmjones Jul 18, 2023
ebbed76
Merge pull request #101 from deliciousbrains/respond-to-pause-and-can…
AhmedTheGeek Jul 18, 2023
bc8e3cd
WPCS and EA Extended fixes and minor code refactoring.
kagg-design Jul 20, 2023
54983f6
Lst space :)
kagg-design Jul 20, 2023
838945b
Increase timeout for non-blocking request.
kagg-design Jul 20, 2023
804a252
Add note to README regarding PRs
ianmjones Sep 21, 2023
6713881
Update composer dependencies for tests
ianmjones Jan 16, 2024
7f347be
Remove inspection disablement
ianmjones Jan 16, 2024
710d404
Keep explicit SQL sort direction
ianmjones Jan 16, 2024
e5ce479
Keep use of intval function
ianmjones Jan 16, 2024
b133045
Merge pull request #102 from kagg-design/wpcs-ea
ianmjones Jan 16, 2024
9f49038
Merge pull request #108 from deliciousbrains/testing-branch-protectio…
ianmjones Jan 16, 2024
6477eea
Merge branch 'master' into increase-timeout
ianmjones Jan 17, 2024
93ba778
Merge pull request #103 from kagg-design/increase-timeout
ianmjones Jan 17, 2024
7ba50e9
Add $allowed_classes param to the constructor
eriktorsner Feb 1, 2024
1737b47
Conditionally retain allowed_batch_data_classes property in subclass …
ianmjones Feb 8, 2024
33b7bc1
Merge pull request #112 from deliciousbrains/improve-unserialization-…
ianmjones Feb 8, 2024
3e2a82f
Added CODEOWNERS file
bhardie Feb 15, 2024
e4c0e21
Merge pull request #114 from deliciousbrains/DELI-899
ianmjones Feb 19, 2024
dccdbdf
Ensure 1st healthcheck runs in the future, not immediately before dis…
ianmjones Feb 27, 2024
6d1e481
Merge pull request #116 from deliciousbrains/fix-healthcheck-running-…
ianmjones Feb 28, 2024
f7c6744
Updated CODEOWNERS to use jira key
bhardie Apr 23, 2024
212b8ea
Merge pull request #117 from deliciousbrains/codeowners-proj-key
ianmjones Apr 26, 2024
6ae6bd1
Fix comments in WP_Async_Request
ianmjones Nov 22, 2024
d51a9fa
Add and use WP_Background_Process::get_status function
ianmjones Nov 22, 2024
b48f5af
Ensure WP_Background_Process:maybe_handle checks referrer early
ianmjones Nov 22, 2024
8444cda
Add chain_id to help identify unique background process chains
ianmjones Nov 22, 2024
0da8e73
Ensure .phpunit.result.cache is removed with clean Makefile target
ianmjones Nov 22, 2024
79ef1ff
Improve robustness of WP_Background_Process::get_chain_id
ianmjones Nov 25, 2024
b9d5c6e
Add chain_id param to paused/resumed/cancelled/completed actions
ianmjones Nov 28, 2024
7ca7cc3
Merge pull request #124 from deliciousbrains/spike/bg-process-uuid
ianmjones Dec 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
workflows:
version: 2
main:
jobs:
- php72-build
- php73-build
- php74-build
- php80-build

version: 2

job-references:
mysql_image: &mysql_image
cimg/mysql:5.7

setup_environment: &setup_environment
name: "Setup Environment Variables"
command: |
echo "export PATH=$HOME/.composer/vendor/bin:$PATH" >> $BASH_ENV
source /home/circleci/.bashrc

install_dependencies: &install_dependencies
name: "Install Dependencies"
command: |
sudo apt-get update && sudo apt-get install mysql-client subversion

php_job: &php_job
environment:
- WP_TESTS_DIR: "/tmp/wordpress-tests-lib"
- WP_CORE_DIR: "/tmp/wordpress/"
steps:
- checkout
- run: php --version
- run: composer --version
- run: *setup_environment
- run: *install_dependencies
- run:
name: "Run Tests"
command: |
rm -rf $WP_TESTS_DIR $WP_CORE_DIR
bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 latest
make test-unit
WP_MULTISITE=1 make test-unit
make test-style

jobs:
php56-build:
<<: *php_job
docker:
- image: cimg/php:5.6
- image: *mysql_image

php70-build:
<<: *php_job
docker:
- image: cimg/php:7.0
- image: *mysql_image

php71-build:
<<: *php_job
docker:
- image: cimg/php:7.1
- image: *mysql_image

php72-build:
<<: *php_job
docker:
- image: cimg/php:7.2
- image: *mysql_image

php73-build:
<<: *php_job
docker:
- image: cimg/php:7.3
- image: *mysql_image

php74-build:
<<: *php_job
docker:
- image: cimg/php:7.4
- image: *mysql_image

php80-build:
<<: *php_job
docker:
- image: cimg/php:8.0
- image: *mysql_image

php81-build:
<<: *php_job
docker:
- image: cimg/php:8.1
- image: *mysql_image
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* @deliciousbrains/deli-eng

#jira:DELI is where issues related to this repository should be ticketed]
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/vendor/
/.idea
*.cache
65 changes: 65 additions & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards based custom ruleset for your plugin">
<description>Generally-applicable sniffs for WordPress plugins.</description>

<!-- What to scan -->
<file>.</file>
<exclude-pattern>/vendor/</exclude-pattern>
<exclude-pattern>/node_modules/</exclude-pattern>
<exclude-pattern>/tests/*</exclude-pattern>

<!-- How to scan -->
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
<!-- Annotated ruleset: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<arg value="sp"/> <!-- Show sniff and progress -->
<arg name="basepath" value="./"/><!-- Strip the file paths down to the relevant bit -->
<arg name="colors"/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="8"/><!-- Enables parallel processing when available for faster results. -->

<!-- Rules: Check PHP version compatibility -->
<!-- https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
<config name="testVersion" value="5.6-"/>
<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP -->
<rule ref="PHPCompatibilityWP"/>

<!-- Rules: WordPress Coding Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<config name="minimum_supported_wp_version" value="4.6"/>
<rule ref="WordPress">
<!-- Unable to fix -->
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound"/>
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound"/>
<exclude name="WordPress.DB.DirectDatabaseQuery.NoCaching"/>

<!-- TODO: Maybe fix -->
<exclude name="WordPress.WP.CronInterval.ChangeDetected"/>
<exclude name="WordPress.DB.DirectDatabaseQuery.DirectQuery"/>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<!-- Value: replace the function, class, and variable prefixes used. Separate multiple prefixes with a comma. -->
<property name="prefixes" type="array" value="wpbp"/>
</properties>

<!-- TODO: Maybe fix -->
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound"/>
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<!-- Value: replace the text domain used. -->
<property name="text_domain" type="array" value="wp-background-processing"/>
</properties>

<!-- TODO: Should fix -->
<exclude name="WordPress.WP.I18n.MissingArgDomain"/>
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment"/>
</rule>
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
<properties>
<property name="blank_line_check" value="true"/>
</properties>
</rule>
</ruleset>
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.PHONY: test
test: test-unit test-style

.PHONY: test-unit
test-unit: vendor
vendor/bin/phpunit

.PHONY: test-style
test-style: vendor
vendor/bin/phpcs

vendor: composer.json
composer install --ignore-platform-reqs

.PHONY: clean
clean:
rm -rf vendor
rm -f tests/.phpunit.result.cache .phpunit.result.cache
Loading