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

v1.5.2.1 #32

Merged
merged 22 commits into from
Nov 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ engines:
# Disable: When an array uses associative keys, each value should start on a new line.
WordPress Arrays ArrayDeclarationSpacing AssociativeKeyFound:
enabled: false
# Disable: Blank line found after control structure
# Disable: Blank line found after control structure.
WordPress WhiteSpace ControlStructureSpacing BlankLineAfterEnd:
enabled: false
# Disable: Expected 1 space after closing brace; newline found
# Disable: Expected 1 space after closing brace; newline found.
Squiz ControlStructures ControlSignature SpaceAfterCloseBrace:
enabled: false
# Disable: Inline control structures are not allowed
# Disable: Inline control structures are not allowed.
Generic ControlStructures InlineControlStructure NotAllowed:
enabled: false
ratings:
Expand Down
26 changes: 26 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
# https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties

# WordPress Coding Standards
# http://make.wordpress.org/core/handbook/coding-standards/

root = true

[*]
charset = utf-8
# end_of_line = crlf
indent_style = tab
indent_size = 4
tab_width = 4
insert_final_newline = true
trim_trailing_whitespace = true
# spaces_around_operators = true
# spaces_around_brackets = both

[*.txt]
trim_trailing_whitespace = false

[*.yml]
indent_style = space
indent_size = 2
17 changes: 17 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
46 changes: 46 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at info@keraweb.nl. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
32 changes: 32 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Contribute to Widget CSS Classes

Community made patches, localizations, bug reports, and contributions are always welcome and are crucial to ensure that this plugin remains alive and strong.

When contributing please ensure you follow the guidelines below so that we can keep on top of things.

## Getting Started

* Submit a ticket for your issue, assuming one does not already exist.
* https://github.com/cleverness/widget-css-classes/issues
* Clearly describe the issue including steps to reproduce the bug.
* Make sure you fill in the earliest version that you know has the issue as well as the version of WordPress you're using.

## Making Changes

* Fork the repository on GitHub
* Create a new branch, named with a issue prefix (if present) and some keywords on what is changed.
* Example: `#123-what-is-changed`.
* Make the changes to your forked repository's code
* When committing, reference your issue (if present) and include a note about the fix.
* Ensure you stick to the [WordPress Coding Standards](http://codex.wordpress.org/WordPress_Coding_Standards)
* This repository contains all files needed to properly configure your IDE with the correct coding standards and code style configuration.
* [PHP MD](https://github.com/cleverness/widget-css-classes/blob/master/tests/phpmd.xml)
* [PHP CS](https://github.com/cleverness/widget-css-classes/blob/master/tests/phpcs.xml)
* If the changes are a new feature make sure you add PHP Unit tests or at least contribute in creating tests.
* Push the changes to the branch you created and submit a pull request for the `dev` branch.

At this point you're waiting on us to merge your pull request. We'll review all pull requests, and make suggestions and changes if necessary.

# Additional Resources
* [General GitHub documentation](http://help.github.com/)
* [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Expected Behavior


## Actual Behavior


## Steps to Reproduce the Problem

1.
1.
1.

## Specifications

- Plugin Version:
- WordPress Version:
- Other plugins installed:
- Theme:
- Browser:
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Fixes #

## Proposed Changes

-
-
-
42 changes: 21 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,30 @@ php:
- 7.0

env:
- WP_VERSION=latest WP_MULTISITE=0
- WP_VERSION=latest WP_MULTISITE=1
- WP_VERSION=latest WP_MULTISITE=0
- WP_VERSION=latest WP_MULTISITE=1

matrix:
allow_failures:
- php: 5.2
- php: nightly # PHP 7.x
# - env: WP_VERSION=bleeding WP_MULTISITE=0
# - env: WP_VERSION=bleeding-maintenance WP_MULTISITE=0

include:
- php: nightly
env: WP_VERSION=latest WP_MULTISITE=0
- php: 5.6
env: WP_VERSION=latest WP_MULTISITE=0
- php: 5.3
env: WP_VERSION=3.8 WP_MULTISITE=0
dist: precise
- php: 5.2
env: WP_VERSION=latest WP_MULTISITE=0
dist: precise
allow_failures:
- php: 5.2
env: WP_VERSION=3.8 WP_MULTISITE=0
dist: precise
- php: nightly # PHP 7.x
# - env: WP_VERSION=bleeding WP_MULTISITE=0
# - env: WP_VERSION=bleeding-maintenance WP_MULTISITE=0

include:
- php: nightly
env: WP_VERSION=latest WP_MULTISITE=0
- php: 5.6
env: WP_VERSION=latest WP_MULTISITE=0
- php: 5.3
env: WP_VERSION=3.8 WP_MULTISITE=0
dist: precise
- php: 5.2
env: WP_VERSION=latest WP_MULTISITE=0
dist: precise
- php: 5.2
env: WP_VERSION=3.8 WP_MULTISITE=0
dist: precise

## Cache composer bits
cache:
Expand Down
46 changes: 40 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,43 @@ Add custom classes and ids plus first, last, even, odd, and numbered classes to
[![Travis](https://secure.travis-ci.org/cleverness/widget-css-classes.png?branch=master)](http://travis-ci.org/cleverness/widget-css-classes)
[![Code Climate](https://codeclimate.com/github/cleverness/widget-css-classes/badges/gpa.svg)](https://codeclimate.com/github/cleverness/widget-css-classes)

**Version:** see [widget-css-classes.php](/widget-css-classes.php)
**Description:** Add custom, first, last, even, odd, and numbered classes to your widgets.
**Author:** C.M. Kendrick
**Author URI:** http://cleverness.org
**Plugin URI:** http://cleverness.org/plugins/widget-css-classes
**Text Domain:** widget-css-classes
### Widget CSS Classes gives you the ability to add custom classes and ids to your WordPress widgets

_Please note that this plugin doesn't enable you to enter custom CSS. You'll need to edit your theme's style.css or add another plugin that allows you to input custom CSS._

**This plugin also adds additional classes to widgets to help you style them easier:**

* widget-first: added to the first widget in a sidebar
* widget-last: added to the last widget in a sidebar
* widget-odd: added to odd numbered widgets in a sidebar
* widget-even: added to even numbered widgets in a sidebar
* widget-#: added to every widget, such as widget-1, widget-2

## Features

* Adds a text field to a widget for defining a class
* You can specify multiple classes by putting a space between them
* Optionally adds checkboxes with predefined classes
* Optionally adds a text field to add an id to a widget
* Adds first and last classes to the first and last widget instances in a sidebar
* Adds even/odd classes to widgets
* Adds number classes to widgets
* Fully translatable
* Multi-site compatible
* Compatible with Widget Logic, Widget Context, and WP Page Widget plugins
* Has filters and hooks for customizing output including class names

## Installation

1. Upload the folder _/widget-css-classes/_ to the _/wp-content/plugins/_ directory
2. Activate the plugin through the __Plugins__ menu in WordPress
3. Configure the settings under __Settings > Widget CSS Classes__
4. Visit __Appearance > Widgets__ to add or change the custom classes and ids for a widget.
5. Expand the appropriate widget in the desired sidebar.
6. You'll see a field labeled __CSS Class__. Depending on your settings, this will be a text field and/or checkboxes.
7. If you are using the text field you can enter multiple class names by separating them with a space.
8. If you've enabled the id field, you will see a text field called __CSS ID__.

## More info and documentation

[See our wiki!](https://github.com/cleverness/widget-css-classes/wiki)
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "WordPress Plugin to add CSS classes to Widgets",
"keywords": [],
"homepage": "https://github.com/cleverness/widget-css-classes",
"license": "GPL-2.0+",
"license": "GPL-3.0+",
"authors": [],
"require": {
"composer/installers": "1.2.*",
Expand Down
8 changes: 8 additions & 0 deletions css/widget-css-classes.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Widget CSS Classes
*
* @author C.M. Kendrick <cindy@cleverness.org>
* @package widget-css-classes
* @version 1.5.2.1
*/

.wcssc_copy span, .wcssc_remove span, .wcssc_sort span {
vertical-align: text-bottom;
margin: 0;
Expand Down
2 changes: 1 addition & 1 deletion includes/widget-css-classes-library.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Method library
* @author C.M. Kendrick <cindy@cleverness.org>
* @package widget-css-classes
* @version 1.5.2
* @version 1.5.2.1
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion includes/widget-css-classes-loader.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Loader
* @author C.M. Kendrick <cindy@cleverness.org>
* @package widget-css-classes
* @version 1.5.0
* @version 1.5.2.1
*/

/**
Expand Down
17 changes: 10 additions & 7 deletions includes/widget-css-classes-settings.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Settings
* @author C.M. Kendrick <cindy@cleverness.org>
* @package widget-css-classes
* @version 1.5.2
* @version 1.5.2.1
*/

/**
Expand Down Expand Up @@ -147,12 +147,15 @@ public function register_importexport_settings() {
return;
}

// @codingStandardsIgnoreLine
$get = $_GET; $post = $_POST;

$this->plugin_tabs['importexport'] = esc_attr__( 'Import/Export', WCSSC_Lib::DOMAIN );

$wcssc_message_class = '';
$wcssc_message = '';
if ( isset( $_GET['wcssc_message'] ) ) {
switch ( $_GET['wcssc_message'] ) {
if ( isset( $get['wcssc_message'] ) ) {
switch ( $get['wcssc_message'] ) {
case 1:
$wcssc_message_class = 'updated';
$wcssc_message = esc_attr__( 'Settings Imported', WCSSC_Lib::DOMAIN );
Expand All @@ -169,11 +172,11 @@ public function register_importexport_settings() {
}

if ( ! empty( $wcssc_message ) ) {
echo '<div class=" ' . $wcssc_message_class . ' "><p>' . esc_html( $wcssc_message ) . '</p></div>';
echo '<div class=" ' . esc_attr( $wcssc_message_class ) . ' "><p>' . esc_html( $wcssc_message ) . '</p></div>';
}

// export settings
if ( isset( $_GET['widget-css-classes-settings-export'] ) ) {
if ( isset( $get['widget-css-classes-settings-export'] ) ) {
header( 'Content-Disposition: attachment; filename=widget-css-classes-settings.txt' );
header( 'Content-Type: text/plain; charset=utf-8' );
$general = get_option( 'WCSSC_options' );
Expand All @@ -183,12 +186,12 @@ public function register_importexport_settings() {
// @codingStandardsIgnoreLine >> wp_json_encode is WP 4.1+
echo "$id\t" . json_encode( $text ) . "\n";
}
echo "[STOP=WCSSC SETTINGS]";
echo '[STOP=WCSSC SETTINGS]';
exit;
}

// import settings
if ( isset( $_POST['widget-css-classes-settings-import'] ) ) {
if ( isset( $post['widget-css-classes-settings-import'] ) ) {
$wcssc_message = 3;
if ( $_FILES['widget-css-classes-settings-import-file']['tmp_name'] ) {
$wcssc_message = 2;
Expand Down
Loading