Skip to content

Commit

Permalink
Merge branch 'master' into ft-wp-env
Browse files Browse the repository at this point in the history
# Conflicts:
#	Readme.md
#	composer.json
#	composer.lock
  • Loading branch information
hansmorb committed Aug 28, 2023
2 parents 42d8fd4 + 67d6f2a commit eadb938
Show file tree
Hide file tree
Showing 123 changed files with 12,237 additions and 1,770 deletions.
22 changes: 22 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/.github
/.saas-cache
/bin
/tests
/.git
/.saas-cache
.distignore
.editorconfig
.phpcs.xml.dist
.gitignore
codecov.yml
commonsbooking.zip
composer.json
composer.lock
copy-svn.sh
gruntfile.js
package.json
package-lock.json
phpunit.xml.dist
zipdist.sh
README.md

15 changes: 11 additions & 4 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- '**.md'
- '**.txt'
pull_request:
types: opened
branches:
- 'master'

Expand All @@ -30,6 +29,7 @@ jobs:
- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: uopz

- name: Validate composer.json and composer.lock
run: composer validate
Expand All @@ -50,6 +50,13 @@ jobs:
- name: Run test suite
run: |
curl -ksSfL -o ~/phpunit-7.phar https://phar.phpunit.de/phpunit-7.phar
php ~/phpunit-7.phar --version
php ~/phpunit-7.phar
composer dump-autoload -o
curl -ksSfL -o ~/phpunit-9.phar https://phar.phpunit.de/phpunit-9.phar
php ~/phpunit-9.phar --version
php ~/phpunit-9.phar
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./build/logs/clover.xml
57 changes: 57 additions & 0 deletions .github/workflows/wordpress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Deploy to WordPress.org

on:
push:
tags:
- "v*.*.*"

jobs:
deploy:
name: New tag
runs-on: ubuntu-20.04
steps:
- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'

- uses: actions/checkout@master

- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0.6' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: gem install compass

- uses: actions/setup-node@v2
with:
node-version: 12


- name: Validate composer.json and composer.lock
run: composer validate


- name: Compile with Grunt
uses: elstudio/actions-js-build/build@v4
with:
args: build

- name: Commit changes
uses: elstudio/actions-js-build/commit@v4
with:
commitMessage: Ran grunt

- name: Build # Remove or modify this step as needed
run: |
npm ci --production --legacy-peer-deps
php -v
composer install --ignore-platform-req=php --no-dev
- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@stable
with:
dry-run: false
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SLUG: commonsbooking # optional, remove if GitHub repo name matches SVN slug, including capitalization
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ views/.DS_Store
/composer.phar
copy-svn.sh
.vscode/settings.json
package-lock.json
.idea
cb-local-1.code-workspace
commonsbookingdocker.code-workspace
Expand Down
63 changes: 52 additions & 11 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards based custom ruleset for your plugin">
<ruleset name="WordPress Coding Standards based custom ruleset for your plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://github.com/raw/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<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>assets/</exclude-pattern>
<exclude-pattern>vendor/</exclude-pattern>
<exclude-pattern>node_modules/</exclude-pattern>

<!-- How to scan -->
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
Expand All @@ -16,32 +18,71 @@
<arg name="extensions" value="php"/>
<arg name="parallel" value="8"/><!-- Enables parallel processing when available for faster results. -->

<!-- Cache the results between runs. -->
<arg name="cache" value="./.cache-phpcs-free.cache"/>

<!-- 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"/>
<config name="testVersion" value="7.3-" />

<!-- 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"/>
<config name="minimum_supported_wp_version" value="5.0"/>

<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="my-plugin"/>
<property name="prefixes" type="array">
<element value="cb_" /> <!-- globals -->
<element value="commonsbooking_" />
<element value="CommonsBooking" /> <!-- namespaces -->
</property>
</properties>
</rule>

<!-- Checks if text_domain used -->
<rule ref="WordPress.WP.I18n">
<properties>
<!-- Value: replace the text domain used. -->
<property name="text_domain" type="array" value="my-plugin"/>
<property name="text_domain" type="array" value="commonsbooking"/>
</properties>
</rule>

<rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
<properties>
<property name="blank_line_check" value="true"/>
</properties>
</rule>

<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP -->
<rule ref="PHPCompatibility">
<exclude-pattern>tests/</exclude-pattern>
</rule>

<rule ref="PHPCompatibilityWP" />

<rule ref="Generic.Commenting">
<exclude-pattern>tests/</exclude-pattern>
</rule>

<rule ref="Squiz.Commenting.FileComment.Missing">
<exclude-pattern>tests/</exclude-pattern>
</rule>

<rule ref="WordPress">
<exclude name="WordPress.Files.FileName" />
<exclude name="Wordpress.PHP.YodaConditions" />
<exclude name="WordPress.NamingConventions.ValidVariableName" />
<exclude name="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid" />

<!-- Too much false positives in our codebase, but please reactivate if necessary -->
<exclude name="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned" />
<exclude name="WordPress.Arrays.MultipleStatementAlignment.LongIndexSpaceBeforeDoubleArrow" />

<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar" />
<exclude name="Squiz.Commenting.FileComment" />

<exclude-pattern>tests/</exclude-pattern>
</rule>

</ruleset>
8 changes: 7 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ module.exports = function (grunt) {
relativeAssets: true,
sourcemap: true
}
}
},
clean: {
options: {
clean: true
},
},
},
// concat and minify our JS
uglify: {
Expand Down Expand Up @@ -148,6 +153,7 @@ module.exports = function (grunt) {
'watch'
]);
grunt.registerTask('dist', [
'compass:clean',
'compass:admin',
'compass:public',
'compass:themes',
Expand Down
49 changes: 11 additions & 38 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,25 @@
[![PHP Composer](https://github.com/wielebenwir/commonsbooking/actions/workflows/php.yml/badge.svg)](https://github.com/wielebenwir/commonsbooking/actions/workflows/php.yml) [![WP compatibility](https://plugintests.com/plugins/wporg/commonsbooking/wp-badge.svg)](https://plugintests.com/plugins/wporg/commonsbooking/latest) [![PHP compatibility](https://plugintests.com/plugins/wporg/commonsbooking/php-badge.svg)](https://plugintests.com/plugins/wporg/commonsbooking/latest)
[![PHP Composer](https://github.com/wielebenwir/commonsbooking/actions/workflows/php.yml/badge.svg)](https://github.com/wielebenwir/commonsbooking/actions/workflows/php.yml)
[![WP compatibility](https://plugintests.com/plugins/wporg/commonsbooking/wp-badge.svg)](https://plugintests.com/plugins/wporg/commonsbooking/latest)
[![PHP compatibility](https://plugintests.com/plugins/wporg/commonsbooking/php-badge.svg)](https://plugintests.com/plugins/wporg/commonsbooking/latest)
[![codecov](https://codecov.io/gh/wielebenwir/commonsbooking/branch/master/graph/badge.svg?token=STJC8WPWIC)](https://codecov.io/gh/wielebenwir/commonsbooking)

# CommonsBooking

Contributors: wielebenwirteam, m0rb, flegfleg, chriwen
Donate link: https://www.wielebenwir.de/verein/unterstutzen
Tags: booking, commons, sharing, calendar,
Requires at least: 5.2
Tested up to: 6.0
Stable Tag: 2.8
Requires PHP: 7.4 or higher
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Commons Booking is a plugin for management and booking of common goods.
CommonsBooking is a plugin for the management and booking of common goods. This plugin provides associations, groups, and individuals with the ability to share items (such as cargo bikes and tools) among users. It is based on the concept of Commons, where resources are shared for the benefit of the community.

## Description

This plugin gives associations, groups and individuals the ability to share items (e.g. cargo bikes, tools) with users. It is based on the idea of Commons and sharing resources for the benefit of the community.

CommonsBooking was developed for the ["Commons Cargobike" movement](http://commons-cargobikes.org/), but it can be used for any kind items.

**Unique features:**

* Items can be assigned to different locations for the duration of a timeframe, each with their own contact information. You can display all locations via shortcode as an interactive map.
* Simple booking process: bookable timeframes can be configured with hourly slots oder daily slots.
* Auto-accept bookings: A registered user can book items without the need for administration.
* Codes: The plugin automatically generates booking codes, which are used at the station to validate the booking.
* Managers can set holidays or repair slots to prevent items from beeing booked.


**Use cases:**

* Your association owns special tools that are not in use every day, and you want to make them available to a local group.
* You own a cargo bike that you want to share with the community, and it will be placed at different locations throughout the year.

**Plugin websites**
## Links

* [Wordpress Plugin Page](https://wordpress.org/plugins/commonsbooking/)
* [View Changelog](https://wordpress.org/plugins/commonsbooking/#developers)
* [Official Website](https://commonsbooking.org)
* [Bug-Tracker](https://github.com/wielebenwir/commonsbooking/issues)

* For users get [Support](https://commonsbooking.org/kontakt/)
* For developers use the [Bug-Tracker](https://github.com/wielebenwir/commonsbooking/issues)

## Installation

### Using The WordPress Dashboard

1. Navigate to the 'Add New' in the plugins dashboard
2. Search for 'commonsbooking'
3. Click 'Install Now'
4. Activate the plugin on the Plugin dashboard

### Uploading in WordPress Dashboard

Expand All @@ -70,6 +42,7 @@ CommonsBooking was developed for the ["Commons Cargobike" movement](http://commo
2. Navigate into your wp-content/plugins directory
3. Open a terminal and run `git clone https://github.com/wielebenwir/commonsbooking`
4. cd into the directory commonsbooking and run `composer install`
> This might fail, if you don't have the PHP extension [uopz](https://www.php.net/manual/en/book.uopz.php) installed. Try running `composer install --no-dev` if you just quickly want to test a specific branch without installing the extension.
5. Activate the plugin in the Plugin dashboard

## Contribute
Expand Down
24 changes: 12 additions & 12 deletions assets/admin/css/admin.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/admin/css/admin.css.map

Large diffs are not rendered by default.

Loading

0 comments on commit eadb938

Please sign in to comment.