Skip to content

Commit

Permalink
Merge/master updates 9 02 17 (#6351)
Browse files Browse the repository at this point in the history
* update google analytics description (#6250)

* Add user tracking for disconnecting site (#6248)

* Minor whitespace cleanups

* Changelog and Testing list for Jetpack 4.6 (#6245)

* Changelog: move 4.5 changelog to changelog.txt

* Changelog: add #5603

* Changelog: add #6242

* Changelog: add #6104

* Changelog: add #6109

* Changelog: add #6118

* Changelog: adf #6122

* Changelog: add #6115

* Changelog: add #6126

* Changelog: add #6131

* Changelog: add #6140

* Testing list: add testing instructions for Widget fixes.

* Changelog: add #6142

* Changelog: add #6149

* Changelog: add #6151

* Changelog: add #6153

* Changelog: add #6154

* Changelog: add #6155

* Changelog: add #6158

* Changelog: add #6170

* Changelog: add #6182

* Changelog: add #6183

* Changelog: add #5821

* Changelog: add #5953

* Changelog: add #5988

* Changelog: add #6002

* Changelog: add #6021

* Changelog: add #6038

* Changelog: add #6040

* Changelog: add #6060

* Changelog: add #6068

* Changelog: add #6083

* Changelog: add #6098

* Changelog: add #6186

* Testing list: add Publicize instructions.

* Changelog: add #6190

* Changelog: add #6194

* Changelog: add #6230

* Changelog: add #6232

* Changelog: add #6234

* Testing list: add instructions to test Woo JITM.

* Testing list: add PHP 7.1 testing.

* Testing list: add compat tests for widgets and shortcodes.

* Testing list: add wpcom REST API testing.

* Missing word in testing list.

* generate new module headers (#6264)

* Tracks: don't track during CI runs

* WPCOM MERGE Infinite Scroll (#6246)

* VIP: Query errors generated for HoopsHype are caused by the infinite scroll functionality. This filter will allow to use rewrite rules so that the infinity functions can be called by rewrite rules that will be cached by batcache.

Merges r120201-wpcom.

* Infinite Scroll: only disable in the Customizer when previewing a non-active theme.

Fixes #7507
See [115743] #6795

Merges r122634-wpcom.

* Infinite Scroll: allow `get_settings` to be filtered at later points than just `__construct`. See #7539.

Merges r123819-wpcom.

* Infinite Scroll: add translation function to credit line.

Merges #2537
Fixes #2528

https://[private link]

Merges r132540-wpcom.

* Infinite Scroll: fix IS when content includes Curly Quotes (and other non-UTF8 chars)

Using wp_json_encode instead of json_encode allowing us to replace invalid chars with HTML entities.

Merges #1447
Fixes #1446
props jtsternberg

https://[private link]

Merges r132541-wpcom.

* Infinite Scroll: add check on ob_end_clean for cases where output_buffering is disabled

Merges #2545
Props drrobotnik

https://[private link]

Merges r132542-wpcom.

* Infinite Scroll: check that search terms exist before matching against post title.

Merges #2128
Fixes #2075
Props cainm

https://[private link]

Merges r132543-wpcom.

* Infinite Scroll: Fatal error when calling protected method from WP_Query

Since we already have wp_query() we can use its query_vars['search_terms'] property instead of calling parse_search_terms().
It gets populated on https://github.com/WordPress/WordPress/blob/4.3.1/wp-includes/query.php#L2075 with the same data.

Merges #2827
Fixes #2255
Props osiux

https://[private link]

Merges r132544-wpcom.

* Infinite Scroll: Hide infinite-scroll class if the option is disabled

The Jetpack support page says that the infinite-scroll class should be used in a theme to hide the navigation links.
However, even when disabled in the Reading page, the class is still visible and the CSS is applied just as if the scroll is enabled.

This commit adds an option check before filtering the body_class classes.

Merges #1208
Props mpeshev

https://[private link]

Merges r132546-wpcom.

* Infinite Scroll: Don't clobber the posts_per_page option if provided

Infinite Scroll currently clobbers any passed-in value for posts_per_page if the type is set to click.
This commit changes the behavior to match the documentation:
https://jetpack.me/support/infinite-scroll/

Merges #2808
Props codebykat

https://[private link]

Merges r132547-wpcom.

* Infinite Scroll: document all filter and action hooks

Merges #2852

https://[private link]

Merges r132551-wpcom.

* Infinite Scroll: favor user set settings over theme settings

If user changed their posts_per_page option, use that in Infinite Scroll instead of the value set in theme's IS support declaration.
Only true when IS is set to click.

Related: r132547
Discussion: https://[private link]#comment-31306

Merges r132764-wpcom.

* Infinite Scroll: Merge changes from Jetpack into wpcom

Just removing some whitespace so the 2 files are exactly similar and do not trigger the build script anymore.

Merges r132787-wpcom.

* Infinite Scroll: Make sure the body class gets updated once we are done with IS even when we just click

Merges r134572-wpcom.

* Remove `target="_blank"` from internal link.

Accidentally added by #3600, which was intended to add only to external links.

* JSON API: Removes PHP notice when no taxonomy description provided

Fixes #4424

* JSON API: Removes PHP notice when no term description provided

Fixes: #5943

* Google Analytics: hook tracking code into wp_footer. (#6284)

get_footer might not be compatible with every theme out there.

* Google Analytics: add HTML comment before the script output. (#6288)

* Sync: Return expected response on Jetpack side

* GA: Update inactive description to match calypso (#6291)

* lodash: import specific function (#6295)

* Change Infinite Scroll Google Analytics option label (#6239)

* Sync: Fixes an issue where sync_wait_time was immediately overwritten in sync sender (#6281)

* Documentation: reorganize current docs and create new ones. (#5985)

* Documentation: reorganize current docs and create new ones.

- Make contributing less frightening and easier for all potential contributors.
- Make our guidelines and requirements clearer.
- Surface all data in our contributing guide.
- Offer options to contribute to everyone, even if it's not via code.
- Outline our release management process, and approach to code reviews and Pull Requests.

* Documentation: fix typos, headings, wrong links.

* Add PHPCS and ESLint to the development environment documentation.

* Docs: include some information about PHP Unit Testing.

Fixes #6236

* Docs: add "Development" section.

@see #5985 (comment)

* update languages (#6302)

* Bump version to 4.7-alpha (#6301)

* Fix: Use the site_icon id instead of the url (#6303)

When $image_url is set to a photon image we are not able to deremine
the $image_id. Instead we should use the option that stores the ID
instead.

This fixes the issue when we show the default image instead of the
site icon as the open graph main image. When photon is enabled and the
site icon is set.

* Add unit test for Publicize (#6018)

* Add the accessible-focus library from dops-components to enable keyboard focus styles (#6300)

* Use shorter WooCommerce Services MC stat slug.

* Track WooCommerce services install as a module activation, not a WPCOM tools event.

* Track WooCommerce Services JITM click and activation separately.

* Update printThis to v1.9.0 (#6263)

* Update to printThis v1.9

Additional options, including:
* base tag
* preservation of form values
* doctype
* canvas (experimental)
* Additional cleanup

* Added jshint

* Date update

Update date for `wp_enqueue_script` for printThis to prevent caching issues

* Add filter for WordPress Posts widget content

* Replace esc_html_e with esc_html__. Change the initialization of .

* Don't call site_url() twice

Instead of calling the function twice, which is a waste, assign the
value to a variable and use that value to check whether we're on a
tld-less domain or not.

* Upgrades yarn lock file and fixes builds for master branch. (#6309)

* Fixing a problem with local import.

* Running yarn upgrade.

* Added the print this library to jshint ignore.

* Added a new generated RTL CSS file.

* Changelog: update for release (#6280)

* Changelog: add release post link.

* Improved the changelog for readability and understanding

* some minor adjustments were made to wording and to eliminate errors

* Fix typos

* update SSO changelog entry verbiage

* changelogs edits per sdquirk

* Adds vscode dir to ignore

Visual Studio Code can store per-project settings in a .vscode folder;
this updates .gitignore to ignore that, since it shouldn't be checked
in.

* Follow Widget: load translation files using wpcom language codes. (#5941)

* Follow Widget: load translation files using wpcom language codes.

Related: #2698

The widget previously used the site's language code to populate the `data-lang` parameter.
that parameter is used to grab language files from WordPress.com, and should consequently use a language code that's available on
WordPress.com.

We consequently use the data available in locales.php to use the `slug` language code instead of `wp_locale` for each language.

* Follow Widget / Notes: avoid calling get_locale() twice.

It's been called before on the file.

@see #5941 (review)

* Remove Jetpack_Network::wp_get_sites in favor of core's wp_get_sites (#3405)

* Removes Jetpack_Network::wp_get_sites and uses core's wp_get_sites instead.

Changes usages of returned array since the one in Jetpack returned an array of objects and the one in core returns an array of arrays.
Call to wp_get_sites has offset set to 1 to dismiss the first site since Function in Jetpack excluded the first site as well.

* Make strings available for translation.

* Use get_sites() instead of deprecated wp_get_sites()

* Escape URLs in network admin, even though they are presumed safe

* Network: introduce get_current_blog_id() when discarding the main site from sites table

* Holiday Snow: remove settings outside of Holiday Snow period (#6298)

* Only show holiday snow option 1 week before, through to 1 week after holiday snow period. Always show holiday snow option if custom rules have been set for holiday snow period.

* Disable holiday snow option on Jan 4; not Jan 11

* Don't use Initial_State to fetch holiday snow option visibility

* Media Summary: improve performance with single page load caching (#5938)

* improve Jetpack_Media_Summary performance by caching result for a single pageload

* spacing

* no need to md5, also set cache to private

* Remove unnecessary error_log (#6318)

* Improve translatability of plurals and texts with variables (#6307)

* Make gettext call plural aware
* Add translator comments and convert plural strings

* Slideshow: add filter to customize speed of the Slideshow.

Suggested in https://wordpress.org/support/topic/gallery-slideshow-settings-editable-somehow

* Slideshow: bump js version to bust cache.

* Slideshow: use the timeout param instead of speed

@see http://jquery.malsup.com/cycle/options.html

* Slideshow shortcode: update version number in docblock.

* Replace text labels with x and + icons.

* Fix bug where wrong xmlrpc url was being sent to Jetpack Debugger (#6321)

* Ignore GET parameters when checking an image's original file url matches container href (#6296)

* Add email field to Contact Info Widget (#6275)

* Add email field to Contact Info Widget

* Replace admin email with sample email. Validate email and remove link if it is not

* Display nothing when the email check fails

* Remove email default value

* Remove PHP error on uninstall, by making sure that jetpack includes all the required files (#6320)

* Add image caching to jetpack_og_get_image() (#6297)

* Add image caching to jetpack_og_get_image()

This adds a transient to store the value of the $image_id to "speed up"  the function to fix #6017

* Added missing semicolons at EOL on a couple lines

* Adding some whitespace per coding standards

* upgrade yarn.lock
  • Loading branch information
eliorivero authored and samhotchkiss committed Feb 10, 2017
1 parent a098fc0 commit e73b7e0
Show file tree
Hide file tree
Showing 111 changed files with 2,812 additions and 2,069 deletions.
78 changes: 18 additions & 60 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,70 +14,17 @@ Beta testers give updates, fixes, and new modules a test run before they’re pu

If you find a bug, just [file a GitHub issue](https://github.com/Automattic/jetpack/issues/), that’s all. If you want to prefix the title with a “Question:”, “Bug:”, or the general area of the application, that would be helpful, but by no means mandatory. If you have write access, add the appropriate labels.

If you’re filing a bug, specific steps to reproduce are helpful. Please include the URL of the page that has the bug, along with what you expected to see and what happened instead. You can [check our recommendations to create great bug reports here](http://jetpack.com/contribute/#bugs).
If you’re filing a bug, specific steps to reproduce are helpful. Please include the URL of the page that has the bug, along with what you expected to see and what happened instead. You can [check our recommendations to create great bug reports here](/docs/guides/report-bugs.md).

### Write and submit a patch

If you'd like to fix a bug, you can submit a Pull Request. [Follow these detailed steps to find out how](http://jetpack.com/contribute/#patch).

When creating Pull Requests, remember:

- [Check In Early, Check In Often](http://blog.codinghorror.com/check-in-early-check-in-often/).
- Write [good commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
- Respect the [Best practices for WordPress development](http://jetpack.com/contribute/#practices).

#### Code Reviews

Code reviews are an important part of the Jetpack workflow. They help to keep code quality consistent, and they help every person working on Jetpack learn and improve over time. We want to make you the best Jetpack contributor you can be.

Every PR should be reviewed and approved by someone other than the author, even if the author has write access. Fresh eyes can find problems that can hide in the open if you’ve been working on the code for a while.

The recommended way of finding an appropriate person to review your code is by [blaming](https://help.github.com/articles/using-git-blame-to-trace-changes-in-a-file/) one of the files you are updating and looking at who was responsible for previous commits on that file.

Then, you may ask that person to review your code by mentioning his/her GitHub username on the PR comments like this:

```
cc @username
```

*Everyone* is encouraged to review PRs and add feedback and ask questions, even people who are new to Jetpack. Also, don’t just review PRs about what you’re working on. Reading other people’s code is a great way to learn new techniques, and seeing code outside of your own feature helps you to see patterns across the project. It’s also helpful to see the feedback other contributors are getting on their PRs.

#### Coding Standards & Guidelines
### Translate the plugin

Consistent coding style makes the code so much easier to read. Here are ours:
If you speak a foreign language, you can help translate Jetpack into your own language. [here is how.](/docs/translations.md)

- If you've created a new action or filter, [add inline documentation](https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/#4-hooks-actions-and-filters) to help others understand how to use the action or the filter.
- Create [unit tests](https://github.com/Automattic/jetpack/tree/master/tests) if you can. If you're not familiar with Unit Testing, you can check [this tutorial](https://pippinsplugins.com/series/unit-tests-wordpress-plugins/).
- If [Gulp](http://gulpjs.com/) is installed on your testing environment, run it after committing your changes. It will allow you to [detect errors in Javascript files](http://jshint.com/about/), compile Sass to CSS, and [a few other things](https://github.com/Automattic/jetpack/blob/master/gulpfile.js).

#### Lifecycle of a Pull Request

When you’re first starting out, your natural instinct when creating a new feature will be to create a local feature branch, and start building away. If you start doing this, *stop*, take your hands off the keyboard, grab a coffee and read on. :)

**It’s important to break your feature down into small pieces first**, each piece should become its own pull request.

Once you know what the first small piece of your feature will be, follow this general process while working:

1. Create a new branch, using [the branch naming scheme](https://github.com/Automattic/jetpack/wiki/Git-Workflow#branch-naming-scheme), _e.g._ `add/video-preview` or `fix/1337-language-too-geeky`.
2. Make your first commit: any will do even if empty or trivial, but we need something in order to create the initial pull request. Create the pull request and prefix the name with the section of the product, _e.g._ _Sharing: add new Facebook button_. Don’t worry too much if there’s no obvious prefix.
- Write a detailed description of the problem you are solving, the part of Jetpack it affects, and how you plan on going about solving it.
- If you have write access, add the **<span class="label status-in-progress">[Status] In Progress</span>** label or wait until somebody adds it. This indicates that the pull request isn’t ready for a review and may still be incomplete. On the other hand, it welcomes early feedback and encourages collaboration during the development process.
3. Start developing and pushing out commits to your new branch.
- Push your changes out frequently and try to avoid getting stuck in a long-running branch or a merge nightmare. Smaller changes are much easier to review and to deal with potential conflicts.
- Don’t be afraid to change, [squash](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html), and rearrange commits or to force push - `git push -f origin fix/something-broken`. Keep in mind, however, that if other people are committing on the same branch then you can mess up their history. You are perfectly safe if you are the only one pushing commits to that branch.
- Squash minor commits such as typo fixes or [fixes to previous commits](http://fle.github.io/git-tip-keep-your-branch-clean-with-fixup-and-autosquash.html) in the pull request.
4. If you end up needing more than a few commits, consider splitting the pull request into separate components. Discuss in the new pull request and in the comments why the branch was broken apart and any changes that may have taken place that necessitated the split. Our goal is to catch early in the review process those pull requests that attempt to do too much.
5. When you feel that you are ready for a formal review or for merging into `master` make sure you check this list.
- Make sure your branch merges cleanly and consider rebasing against `master` to keep the branch history short and clean.
- If there are visual changes, add before and after screenshots in the pull request comments.
- Add unit tests, or at a minimum, provide helpful instructions for the reviewer so he or she can test your changes. This will help speed up the review process.
- Ensure that your commit messages are [meaningful](http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message).
6. Mention that the PR is ready for review or if you have write access remove the **<span class="label status-in-progress">[Status] In Progress</span>** label from the pull request and add the **<span class="label status-needs-review">[Status] Needs Review</span>** label - someone will provide feedback on the latest unreviewed changes. The reviewer will also mark the pull request as **<span class="label needs-author-reply">[Status] Needs Author Reply</span>** if they think you need to change anything.
7. If you get a <img src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f44d.png" class="emoji" />, <img src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f4a5.png" class="emoji" />, <img src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f6a2.png" class="emoji" />, <img src="https://assets-cdn.github.com/images/icons/emoji/shipit.png" class="emoji" />, or a LGTM, the pull request is ready to be merged into `master`.
### Write and submit a patch

Whether somebody is reviewing your code or you are reviewing somebody else’s code, [a positive mindset towards code reviews](https://medium.com/medium-eng/the-code-review-mindset-3280a4af0a89) helps a ton. We’re building something together that is greater than the sum of its parts.
If you'd like to fix a bug, you can submit a Pull Request. Before you get started, you'll want to **[set up your development environment.](/docs/development-environment.md)**

If you feel yourself waiting for someone to review a PR, don’t hesitate to personally ask for someone to review it or to mention them on GitHub.
Once your development environment is ready, you can get started and [create your first Pull Request!](/docs/pull-request.md)

#### Where to get started?

Expand All @@ -87,6 +34,17 @@ If you'd like to contribute but don't know where to get started, you can take a
- All issues labeled with [the "Community" milestone](https://github.com/Automattic/jetpack/issues?q=is%3Aopen+is%3Aissue+milestone%3ACommunity) are fair game. That's a great way to contribute new features and fix small issues within Jetpack.
- ["Whisky"](https://github.com/Automattic/jetpack/labels/Whisky%20Ticket) issues are important bugs or enhancements. Take a crack at it if you feel adventurous! :)

Are you new to Git? You can [follow these detailed steps to find out how to submit your first patch.](/docs/guides/submit-patch.md)

#### We’re Here To Help

We encourage you to ask for help at any point. We want your first experience with Jetpack to be a good one, so don’t be shy. If you’re wondering why something is the way it is, or how a decision was made, you can tag issues with **<span class="label type-question">[Type] Question</span>** or prefix them with “Question:”.
We encourage you to ask for help at any point. We want your first experience with Jetpack to be a good one, so don’t be shy. If you’re wondering why something is the way it is, or how a decision was made, you can create an issue and prefix it with “Question:”.

## License

Jetpack is licensed under [GNU General Public License v2 (or later)](/LICENSE.md).

All materials contributed should be compatible with the GPLv2. This means that if you own the material, you agree to license it under the GPLv2 license. If you are contributing code that is not your own, such as adding a component from another Open Source project, or adding an `npm` package, you need to make sure you follow these steps:

1. Check that the code has a license. If you can't find one, you can try to contact the original author and get permission to use, or ask them to release under a compatible Open Source license.
2. Check the license is compatible with [GPLv2](http://www.gnu.org/licenses/license-list.en.html#GPLCompatibleLicenses), note that the Apache 2.0 license is *not* compatible.
8 changes: 1 addition & 7 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@ Fixes #

#### Changes proposed in this Pull Request:

*

#### Testing instructions:

*

<!-- Add the following only if this is meant to be in changelog -->
#### Proposed changelog entry for your changes:


-------------------
- [ ] Make sure your changes respect [WordPress' coding standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/).
- [ ] Did you make changes, or create a **new .js file**? If [Gulp](http://gulpjs.com/) is installed on your testing environment, run `gulp js:hint` before to commit your changes. It will allow you to [detect errors in Javascript files](http://jshint.com/about/).
- [ ] Did you create a **new action or filter**? [Add inline documentation](https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/#4-hooks-actions-and-filters) to help others understand how to use the action or the filter.
- [ ] Create **[unit tests](https://github.com/Automattic/jetpack/tree/master/tests)** if you can. If you're not familiar with Unit Testing, you can check [this tutorial](https://pippinsplugins.com/series/unit-tests-wordpress-plugins/).
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/node_modules
/vendor/
/wpcom-test-backup/
/.vscode/


## FILES
Expand Down
1 change: 1 addition & 0 deletions .svnignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
readme.md
.github
phpunit.xml.dist
docs
tests
tools
package.json
Expand Down
11 changes: 11 additions & 0 deletions 3rd-party/woocommerce-services.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

class WC_Services_Installer {

/**
* @var Jetpack
**/
private $jetpack;

/**
* @var WC_Services_Installer
**/
Expand All @@ -19,6 +24,8 @@ static function init() {
}

public function __construct() {
$this->jetpack = Jetpack::init();

add_action( 'admin_init', array( $this, 'add_error_notice' ) );
add_action( 'admin_init', array( $this, 'try_install' ) );
}
Expand All @@ -39,6 +46,8 @@ public function try_install() {

if ( false === $result ) {
$redirect = add_query_arg( 'wc-services-install-error', true, $redirect );
} else {
$this->jetpack->stat( 'jitm', 'wooservices-activated-' . JETPACK__VERSION );
}

wp_safe_redirect( $redirect );
Expand Down Expand Up @@ -73,6 +82,8 @@ public function error_notice() {
* @return bool result of installation/activation
*/
private function install() {
$this->jetpack->stat( 'jitm', 'wooservices-install-' . JETPACK__VERSION );

include_once( ABSPATH . '/wp-admin/includes/admin.php' );
include_once( ABSPATH . '/wp-admin/includes/plugin-install.php' );
include_once( ABSPATH . '/wp-admin/includes/plugin.php' );
Expand Down
28 changes: 28 additions & 0 deletions CODE-OF-CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Contributor Code of Conduct

As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic addresses, without explicit permission
* Other unethical or unprofessional conduct

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.

By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by emailing a project maintainer via [this contact form](https://developer.wordpress.com/contact/?g21-subject=Code%20of%20Conduct), with a subject that includes `Code of Conduct`. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Maintainers are obligated to maintain confidentiality with regard to the reporter of an incident.


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

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/3/0/
5 changes: 4 additions & 1 deletion _inc/client/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ import { createHashHistory } from 'history'
/**
* Internal dependencies
*/
import accessibleFocus from 'lib/accessible-focus';
import store from 'state/redux-store';
import i18n from 'i18n-calypso';
import Main from 'main';

// Initialize the accessibile focus to allow styling specifically for keyboard navigation
accessibleFocus();

Initial_State.locale = JSON.parse( Initial_State.locale );

if ( 'undefined' !== typeof Initial_State.locale[ '' ] ) {
Expand Down Expand Up @@ -73,4 +77,3 @@ function render() {
container
);
}

48 changes: 27 additions & 21 deletions _inc/client/appearance/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
getModule as _getModule,
getModules
} from 'state/modules';
import { getShowHolidaySnow } from 'state/settings';
import { ModuleToggle } from 'components/module-toggle';
import { AllModuleSettings } from 'components/module-settings/modules-per-tab-page';
import { isUnavailableInDevMode } from 'state/connection';
Expand All @@ -34,7 +35,8 @@ export const Page = ( props ) => {
toggleModule,
isModuleActivated,
isTogglingModule,
getModule
getModule,
showHolidaySnow
} = props,
isAdmin = props.userCanManageModules,
moduleList = Object.keys( props.moduleList );
Expand Down Expand Up @@ -90,29 +92,32 @@ export const Page = ( props ) => {
);
} );

let holidaySnowCard = showHolidaySnow ? (
<FoldableCard
header={ __( 'Holiday Snow' ) }
subheader={ __( 'Show falling snow in the holiday period.' ) }
clickableHeaderText={ true }
disabled={ ! isAdmin }
summary={ isAdmin ? <Settings slug="snow" /> : '' }
expandedSummary={ isAdmin ? <Settings slug="snow" /> : '' }
onOpen={ () => analytics.tracks.recordEvent( 'jetpack_wpa_settings_card_open',
{
card: 'holiday_snow',
path: props.route.path
}
) }
>
<span className="jp-form-setting-explanation">
{ __( 'Show falling snow on my blog from Dec 1st until Jan 4th.' ) }
</span>
</FoldableCard>
) : '';

return (
<div>
<QuerySite />
{ cards }

<FoldableCard
header={ __( 'Holiday Snow' ) }
subheader={ __( 'Show falling snow in the holiday period.' ) }
clickableHeaderText={ true }
disabled={ ! isAdmin }
summary={ isAdmin ? <Settings slug="snow" /> : '' }
expandedSummary={ isAdmin ? <Settings slug="snow" /> : '' }
onOpen={ () => analytics.tracks.recordEvent( 'jetpack_wpa_settings_card_open',
{
card: 'holiday_snow',
path: props.route.path
}
) }
>
<span className="jp-form-setting-explanation">
{ __( 'Show falling snow on my blog from Dec 1st until Jan 4th.' ) }
</span>
</FoldableCard>
{ holidaySnowCard }
</div>
);
};
Expand All @@ -132,7 +137,8 @@ export default connect(
getModule: ( module_name ) => _getModule( state, module_name ),
isUnavailableInDevMode: ( module_name ) => isUnavailableInDevMode( state, module_name ),
userCanManageModules: userCanManageModules( state ),
moduleList: getModules( state )
moduleList: getModules( state ),
showHolidaySnow: getShowHolidaySnow( state )
};
},
( dispatch ) => {
Expand Down
12 changes: 10 additions & 2 deletions _inc/client/components/module-settings/modules-per-tab-page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
WordAdsSettings
} from 'components/module-settings/';
import ExternalLink from 'components/external-link';

import {
getSiteAdminUrl,
getSiteRawUrl
Expand Down Expand Up @@ -86,7 +85,16 @@ const AllModuleSettingsComponent = React.createClass( {
if ( 'inactive' === module.configure_url ) {
return (
<div>
{ __( 'Activate this module to use Google Analytics.' ) }
{ __(
'Google Analytics is a free service that complements our {{a}}built-in stats{{/a}} with different insights into your traffic.' +
' WordPress.com stats and Google Analytics use different methods to identify and track activity on your site, so they will ' +
'normally show slightly different totals for your visits, views, etc.',
{
components: {
a: <a href={ 'https://wordpress.com/stats/day/' + this.props.siteRawUrl } />
}
}
) }
</div>
);
} else {
Expand Down
Loading

0 comments on commit e73b7e0

Please sign in to comment.