From e73b7e0e05bad65417a1ecf347731cee44f58826 Mon Sep 17 00:00:00 2001 From: Elio Rivero Date: Fri, 10 Feb 2017 02:01:43 -0300 Subject: [PATCH] Merge/master updates 9 02 17 (#6351) * 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 https://github.com/Automattic/jetpack/pull/2537 Fixes https://github.com/Automattic/jetpack/issues/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 https://github.com/Automattic/jetpack/pull/1447 Fixes https://github.com/Automattic/jetpack/issues/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 https://github.com/Automattic/jetpack/pull/2545 Props drrobotnik https://[private link] Merges r132542-wpcom. * Infinite Scroll: check that search terms exist before matching against post title. Merges https://github.com/Automattic/jetpack/pull/2128 Fixes https://github.com/Automattic/jetpack/issues/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 https://github.com/Automattic/jetpack/pull/2827 Fixes https://github.com/Automattic/jetpack/issues/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 https://github.com/Automattic/jetpack/pull/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 https://github.com/Automattic/jetpack/pull/2808 Props codebykat https://[private link] Merges r132547-wpcom. * Infinite Scroll: document all filter and action hooks Merges https://github.com/Automattic/jetpack/pull/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 Automattic/jetpack#4424 * JSON API: Removes PHP notice when no term description provided Fixes: Automattic/jetpack#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 https://github.com/Automattic/jetpack/pull/5985#issuecomment-276558077 * 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 https://github.com/Automattic/jetpack/pull/5941#pullrequestreview-13539598 * 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 --- .github/CONTRIBUTING.md | 78 +- .github/PULL_REQUEST_TEMPLATE.md | 8 +- .gitignore | 1 + .svnignore | 1 + 3rd-party/woocommerce-services.php | 11 + CODE-OF-CONDUCT.md | 28 + _inc/client/admin.js | 5 +- _inc/client/appearance/index.jsx | 48 +- .../module-settings/modules-per-tab-page.jsx | 12 +- _inc/client/pro-status/index.jsx | 2 +- _inc/client/state/settings/reducer.js | 9 + _inc/jetpack-strings.php | 62 +- .../admin-pages/class.jetpack-react-page.php | 1 + _inc/lib/class.media-summary.php | 10 + _inc/lib/tracks/client.php | 6 + changelog.txt | 73 + class.jetpack-cli.php | 20 +- class.jetpack-debugger.php | 5 +- class.jetpack-jitm.php | 6 +- class.jetpack-network-sites-list-table.php | 23 +- class.jetpack-network.php | 68 +- class.jetpack-twitter-cards.php | 6 +- class.jetpack-xmlrpc-server.php | 17 +- class.jetpack.php | 13 +- docs/code-reviews.md | 17 + docs/coding-guidelines.md | 27 + docs/development-environment.md | 107 + docs/git-workflow.md | 29 + docs/guides/get-started-with-git.md | 44 + docs/guides/report-bugs.md | 61 + docs/guides/submit-patch.md | 32 + docs/pull-request.md | 26 + docs/release-management.md | 63 + docs/translations.md | 19 + functions.opengraph.php | 18 +- jetpack.php | 4 +- ...pcom-json-api-update-taxonomy-endpoint.php | 2 +- ...ss.wpcom-json-api-update-term-endpoint.php | 2 +- .../class.jetpack-json-api-sync-endpoint.php | 2 +- .../jetpack/json-api-jetpack-endpoints.php | 2 +- languages/json/jetpack-af.json | 2 +- languages/json/jetpack-ary.json | 2 +- languages/json/jetpack-az.json | 2 +- languages/json/jetpack-bg_BG.json | 2 +- languages/json/jetpack-bs_BA.json | 2 +- languages/json/jetpack-ca.json | 2 +- languages/json/jetpack-ckb.json | 2 +- languages/json/jetpack-cs_CZ.json | 2 +- languages/json/jetpack-cy.json | 2 +- languages/json/jetpack-da_DK.json | 2 +- languages/json/jetpack-gd.json | 2 +- languages/json/jetpack-gl_ES.json | 2 +- languages/json/jetpack-hu_HU.json | 2 +- languages/json/jetpack-is_IS.json | 2 +- languages/json/jetpack-ka_GE.json | 2 +- languages/json/jetpack-lt_LT.json | 2 +- languages/json/jetpack-lv.json | 2 +- languages/json/jetpack-mk_MK.json | 2 +- languages/json/jetpack-ms_MY.json | 2 +- languages/json/jetpack-my_MM.json | 2 +- languages/json/jetpack-nb_NO.json | 2 +- languages/json/jetpack-nn_NO.json | 2 +- languages/json/jetpack-pl_PL.json | 2 +- languages/json/jetpack-pt_PT.json | 2 +- languages/json/jetpack-sa_IN.json | 2 +- languages/json/jetpack-si_LK.json | 2 +- languages/json/jetpack-sk_SK.json | 2 +- languages/json/jetpack-sl_SI.json | 2 +- languages/json/jetpack-sr_RS.json | 2 +- languages/json/jetpack-te.json | 2 +- languages/json/jetpack-th.json | 2 +- languages/json/jetpack-uk.json | 2 +- languages/json/jetpack-ur.json | 2 +- languages/json/jetpack-vi.json | 2 +- modules/carousel/jetpack-carousel.js | 4 +- modules/contact-form/grunion-contact-form.php | 3 + modules/custom-css/csstidy/cssparse.css | 2 +- modules/custom-css/custom-css-4.7.php | 2 +- modules/custom-css/custom-css.php | 4 +- modules/custom-post-types/portfolios.php | 3 +- modules/custom-post-types/testimonial.php | 1 + modules/google-analytics.php | 2 +- .../google-analytics/wp-google-analytics.php | 5 +- modules/holiday-snow.php | 13 + modules/infinite-scroll.php | 2 +- modules/infinite-scroll/infinity.js | 2 + modules/infinite-scroll/infinity.php | 6 +- modules/likes.php | 1 + modules/module-headings.php | 2 +- modules/notes.php | 2 +- modules/publicize/publicize-jetpack.php | 16 +- modules/shortcodes/js/recipes-printthis.js | 455 ++- modules/shortcodes/js/slideshow-shortcode.js | 1 + modules/shortcodes/recipe.php | 2 +- modules/shortcodes/slideshow.php | 13 +- modules/videopress/class.videopress-cli.php | 9 +- .../widget-visibility/widget-conditions.php | 2 +- .../widget-conditions/widget-conditions.css | 32 +- modules/widgets/contact-info.php | 14 + modules/widgets/follow-button.php | 17 +- modules/widgets/gallery/css/admin-rtl.min.css | 2 +- modules/widgets/wordpress-post-widget.php | 52 +- package.json | 2 +- readme.md | 109 +- readme.txt | 57 +- sync/class.jetpack-sync-actions.php | 6 +- sync/class.jetpack-sync-listener.php | 1 + sync/class.jetpack-sync-sender.php | 2 +- .../publicize/test_class.publicize.php | 38 + to-test.md | 117 +- yarn.lock | 2844 ++++++++--------- 111 files changed, 2812 insertions(+), 2069 deletions(-) create mode 100644 CODE-OF-CONDUCT.md create mode 100644 docs/code-reviews.md create mode 100644 docs/coding-guidelines.md create mode 100644 docs/development-environment.md create mode 100644 docs/git-workflow.md create mode 100644 docs/guides/get-started-with-git.md create mode 100644 docs/guides/report-bugs.md create mode 100644 docs/guides/submit-patch.md create mode 100644 docs/pull-request.md create mode 100644 docs/release-management.md create mode 100644 docs/translations.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 51361e4a0810b..de093cd1ca42f 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -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 **[Status] In Progress** 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 **[Status] In Progress** label from the pull request and add the **[Status] Needs Review** label - someone will provide feedback on the latest unreviewed changes. The reviewer will also mark the pull request as **[Status] Needs Author Reply** if they think you need to change anything. -7. If you get a , , , , 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? @@ -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 **[Type] Question** 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. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 7d7cb69771662..1d6c1e5b9c3b3 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,6 +2,7 @@ Fixes # #### Changes proposed in this Pull Request: +* #### Testing instructions: @@ -9,10 +10,3 @@ Fixes # #### 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/). diff --git a/.gitignore b/.gitignore index 544a5c3925465..9227e0c6cb599 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /node_modules /vendor/ /wpcom-test-backup/ +/.vscode/ ## FILES diff --git a/.svnignore b/.svnignore index 4c535e3dbf8af..d256e4d85e0c5 100644 --- a/.svnignore +++ b/.svnignore @@ -7,6 +7,7 @@ readme.md .github phpunit.xml.dist +docs tests tools package.json diff --git a/3rd-party/woocommerce-services.php b/3rd-party/woocommerce-services.php index acf745cb6d090..28cb6f04f5841 100644 --- a/3rd-party/woocommerce-services.php +++ b/3rd-party/woocommerce-services.php @@ -6,6 +6,11 @@ class WC_Services_Installer { + /** + * @var Jetpack + **/ + private $jetpack; + /** * @var WC_Services_Installer **/ @@ -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' ) ); } @@ -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 ); @@ -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' ); diff --git a/CODE-OF-CONDUCT.md b/CODE-OF-CONDUCT.md new file mode 100644 index 0000000000000..21043481a2002 --- /dev/null +++ b/CODE-OF-CONDUCT.md @@ -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/ diff --git a/_inc/client/admin.js b/_inc/client/admin.js index 097e9365dd61e..35620552183df 100644 --- a/_inc/client/admin.js +++ b/_inc/client/admin.js @@ -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[ '' ] ) { @@ -73,4 +77,3 @@ function render() { container ); } - diff --git a/_inc/client/appearance/index.jsx b/_inc/client/appearance/index.jsx index f98d0994abda4..69d514a9470c1 100644 --- a/_inc/client/appearance/index.jsx +++ b/_inc/client/appearance/index.jsx @@ -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'; @@ -34,7 +35,8 @@ export const Page = ( props ) => { toggleModule, isModuleActivated, isTogglingModule, - getModule + getModule, + showHolidaySnow } = props, isAdmin = props.userCanManageModules, moduleList = Object.keys( props.moduleList ); @@ -90,29 +92,32 @@ export const Page = ( props ) => { ); } ); + let holidaySnowCard = showHolidaySnow ? ( + : '' } + expandedSummary={ isAdmin ? : '' } + onOpen={ () => analytics.tracks.recordEvent( 'jetpack_wpa_settings_card_open', + { + card: 'holiday_snow', + path: props.route.path + } + ) } + > + + { __( 'Show falling snow on my blog from Dec 1st until Jan 4th.' ) } + + + ) : ''; + return (
{ cards } - - : '' } - expandedSummary={ isAdmin ? : '' } - onOpen={ () => analytics.tracks.recordEvent( 'jetpack_wpa_settings_card_open', - { - card: 'holiday_snow', - path: props.route.path - } - ) } - > - - { __( 'Show falling snow on my blog from Dec 1st until Jan 4th.' ) } - - + { holidaySnowCard }
); }; @@ -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 ) => { diff --git a/_inc/client/components/module-settings/modules-per-tab-page.jsx b/_inc/client/components/module-settings/modules-per-tab-page.jsx index dbe7c8a38a93b..f619dd5cdc337 100644 --- a/_inc/client/components/module-settings/modules-per-tab-page.jsx +++ b/_inc/client/components/module-settings/modules-per-tab-page.jsx @@ -17,7 +17,6 @@ import { WordAdsSettings } from 'components/module-settings/'; import ExternalLink from 'components/external-link'; - import { getSiteAdminUrl, getSiteRawUrl @@ -86,7 +85,16 @@ const AllModuleSettingsComponent = React.createClass( { if ( 'inactive' === module.configure_url ) { return (
- { __( '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: + } + } + ) }
); } else { diff --git a/_inc/client/pro-status/index.jsx b/_inc/client/pro-status/index.jsx index 1667455de9675..52ac2b3805df5 100644 --- a/_inc/client/pro-status/index.jsx +++ b/_inc/client/pro-status/index.jsx @@ -4,7 +4,7 @@ import React from 'react'; import { connect } from 'react-redux'; import { translate as __ } from 'i18n-calypso'; -import { includes } from 'lodash'; +import includes from 'lodash/includes'; import Button from 'components/button'; import SimpleNotice from 'components/notice'; diff --git a/_inc/client/state/settings/reducer.js b/_inc/client/state/settings/reducer.js index 28e4b956b67ae..f69a6a9335253 100644 --- a/_inc/client/state/settings/reducer.js +++ b/_inc/client/state/settings/reducer.js @@ -183,3 +183,12 @@ export function getSettingName( state, name ) { export function areThereUnsavedSettings( state ) { return get( state.jetpack.settings, 'unsavedSettingsFlag' ); } + +/** + * Returns whether or not the Holiday Snow setting should be displayed. + * @param {Object} state Global state tree + * @return {Boolean} Whether the Holiday Snow setting should be displayed + */ +export function getShowHolidaySnow( state ) { + return state.jetpack.initialState.showHolidaySnow; +} diff --git a/_inc/jetpack-strings.php b/_inc/jetpack-strings.php index ab3afeccab603..29085a9062f8c 100644 --- a/_inc/jetpack-strings.php +++ b/_inc/jetpack-strings.php @@ -19,9 +19,6 @@ __( "Options failed to reset.", "jetpack" ), // _inc/client/state/dev-version/actions.js:35 __( "Options reset.", "jetpack" ), // _inc/client/state/dev-version/actions.js:28 __( "Resetting Jetpack options…", "jetpack" ), // _inc/client/state/dev-version/actions.js:22 -__( "Recommended features failed to activate. %(error)s", "jetpack" ), // _inc/client/state/jumpstart/actions.js:47 -__( "Recommended features active.", "jetpack" ), // _inc/client/state/jumpstart/actions.js:37 -__( "Activating recommended features…", "jetpack" ), // _inc/client/state/jumpstart/actions.js:29 __( "Error regenerating %(slug)s address. %(error)s", "jetpack" ), // _inc/client/state/modules/actions.js:304 __( "Regenerated %(slug)s address .", "jetpack" ), // _inc/client/state/modules/actions.js:286 __( "Updating %(slug)s address…", "jetpack" ), // _inc/client/state/modules/actions.js:266 @@ -34,6 +31,9 @@ __( "%(slug)s failed to activate. %(error)s", "jetpack" ), // _inc/client/state/modules/actions.js:127 __( "%(slug)s has been activated.", "jetpack" ), // _inc/client/state/modules/actions.js:110 __( "Activating %(slug)s…", "jetpack" ), // _inc/client/state/modules/actions.js:94 +__( "Recommended features failed to activate. %(error)s", "jetpack" ), // _inc/client/state/jumpstart/actions.js:47 +__( "Recommended features active.", "jetpack" ), // _inc/client/state/jumpstart/actions.js:37 +__( "Activating recommended features…", "jetpack" ), // _inc/client/state/jumpstart/actions.js:29 __( "There are unsaved settings in this tab that will be lost if you leave it. Proceed?", "jetpack" ), // _inc/client/main.jsx:82 __( "There are unsaved settings in this tab that will be lost if you leave it. Proceed?", "jetpack" ), // _inc/client/main.jsx:68 __( "Show falling snow on my blog from Dec 1st until Jan 4th.", "jetpack" ), // _inc/client/appearance/index.jsx:113 @@ -146,17 +146,6 @@ __( "Connection Settings", "jetpack" ), // _inc/client/general-settings/index.jsx:88 __( "Learn More", "jetpack" ), // _inc/client/general-settings/index.jsx:79 __( "Unavailable in Dev Mode", "jetpack" ), // _inc/client/general-settings/index.jsx:46 -__( "ACTIVE", "jetpack" ), // _inc/client/pro-status/index.jsx:183 -__( "ACTIVE", "jetpack" ), // _inc/client/pro-status/index.jsx:168 -__( "Upgrade", "jetpack" ), // _inc/client/pro-status/index.jsx:163 -__( "Upgrade", "jetpack" ), // _inc/client/pro-status/index.jsx:156 -__( "Set up", "jetpack" ), // _inc/client/pro-status/index.jsx:146 -__( "Upgrade", "jetpack" ), // _inc/client/pro-status/index.jsx:136 -__( "Upgrade", "jetpack" ), // _inc/client/pro-status/index.jsx:120 -__( "Upgrade", "jetpack" ), // _inc/client/pro-status/index.jsx:104 -__( "Invalid Key", "jetpack" ), // _inc/client/pro-status/index.jsx:86 -__( "Threats found!", "jetpack" ), // _inc/client/pro-status/index.jsx:71 -__( "Unavailable in Dev Mode", "jetpack" ), // _inc/client/pro-status/index.jsx:61 __( "Compare Plans", "jetpack" ), // _inc/client/plans/plan-body.jsx:317 __( "We support all Jetpack users, regardless of plan. But customers on a paid subscription enjoy priority support so that security issues are identified and fixed for you as soon as possible. ", "jetpack" ), // _inc/client/plans/plan-body.jsx:312 __( "Enjoy priority support", "jetpack" ), // _inc/client/plans/plan-body.jsx:311 @@ -234,6 +223,17 @@ __( "How much is your website worth?", "jetpack" ), // _inc/client/plans/plan-header.jsx:29 __( "The Personal Plan keeps your data, site, and hard work safe.", "jetpack" ), // _inc/client/plans/plan-header.jsx:25 __( "Introducing our most affordable backups and security plan yet", "jetpack" ), // _inc/client/plans/plan-header.jsx:22 +__( "ACTIVE", "jetpack" ), // _inc/client/pro-status/index.jsx:183 +__( "ACTIVE", "jetpack" ), // _inc/client/pro-status/index.jsx:168 +__( "Upgrade", "jetpack" ), // _inc/client/pro-status/index.jsx:163 +__( "Upgrade", "jetpack" ), // _inc/client/pro-status/index.jsx:156 +__( "Set up", "jetpack" ), // _inc/client/pro-status/index.jsx:146 +__( "Upgrade", "jetpack" ), // _inc/client/pro-status/index.jsx:136 +__( "Upgrade", "jetpack" ), // _inc/client/pro-status/index.jsx:120 +__( "Upgrade", "jetpack" ), // _inc/client/pro-status/index.jsx:104 +__( "Invalid Key", "jetpack" ), // _inc/client/pro-status/index.jsx:86 +__( "Threats found!", "jetpack" ), // _inc/client/pro-status/index.jsx:71 +__( "Unavailable in Dev Mode", "jetpack" ), // _inc/client/pro-status/index.jsx:61 __( "No Results Found.", "jetpack" ), // _inc/client/search/index.jsx:223 __( "Learn More", "jetpack" ), // _inc/client/search/index.jsx:212 __( "Upgrade", "jetpack" ), // _inc/client/search/index.jsx:178 @@ -288,8 +288,6 @@ __( "Active", "jetpack" ), // _inc/client/components/dash-item/index.jsx:87 __( "Updates Needed", "jetpack" ), // _inc/client/components/dash-item/index.jsx:81 _x( "Settings", "Noun. Displayed to screen readers.", "jetpack" ), // _inc/client/components/dash-section-header/index.jsx:43 -__( "Save Settings", "jetpack" ), // _inc/client/components/forms/index.jsx:146 -__( "Saving…", "jetpack" ), // _inc/client/components/forms/index.jsx:146 _x( "Privacy", "Shorthand for Privacy Policy.", "jetpack" ), // _inc/client/components/footer/index.jsx:126 __( "Automattic's Privacy Policy", "jetpack" ), // _inc/client/components/footer/index.jsx:124 _x( "Terms", "Shorthand for Terms of Service.", "jetpack" ), // _inc/client/components/footer/index.jsx:117 @@ -301,6 +299,8 @@ _x( "Reset Options (dev versions only)", "Navigation item.", "jetpack" ), // _inc/client/components/footer/index.jsx:56 __( "This will reset all Jetpack options, are you sure?", "jetpack" ), // _inc/client/components/footer/index.jsx:37 __( "Do you really want to disconnect your site from WordPress.com?", "jetpack" ), // _inc/client/components/footer/index.jsx:30 +__( "Save Settings", "jetpack" ), // _inc/client/components/forms/index.jsx:146 +__( "Saving…", "jetpack" ), // _inc/client/components/forms/index.jsx:146 __( "No account? Create one for free…", "jetpack" ), // _inc/client/components/jetpack-connect/index.jsx:222 __( "Join the millions of users who rely on Jetpack to enhance and secure their sites. We're passionate about WordPress and here to make your life easier.", "jetpack" ), // _inc/client/components/jetpack-connect/index.jsx:214 __( "Jetpack is supported by some of the most technical and passionate people in the community. They're located around the globe and ready to help you.", "jetpack" ), // _inc/client/components/jetpack-connect/index.jsx:199 @@ -421,7 +421,7 @@ __( "Mobile Promos", "jetpack" ), // _inc/client/components/module-settings/index.jsx:440 __( "Featured Images", "jetpack" ), // _inc/client/components/module-settings/index.jsx:433 __( "Excerpts", "jetpack" ), // _inc/client/components/module-settings/index.jsx:426 -__( "Track each infinite Scroll post load as a page view in Google Analytics", "jetpack" ), // _inc/client/components/module-settings/index.jsx:408 +__( "Track each scroll load (7 posts by default) as a page view in Google Analytics", "jetpack" ), // _inc/client/components/module-settings/index.jsx:408 __( "Scroll infinitely (Shows 7 posts on each load)", "jetpack" ), // _inc/client/components/module-settings/index.jsx:404 __( "Background Color", "jetpack" ), // _inc/client/components/module-settings/index.jsx:379 __( "Show photo metadata (Exif) in carousel, when available", "jetpack" ), // _inc/client/components/module-settings/index.jsx:376 @@ -459,20 +459,20 @@ __( "Subscriber", "jetpack" ), // _inc/client/components/module-settings/index.jsx:58 __( "To get started, click on Add Media in your post editor and upload a video; we’ll take care of the rest!", "jetpack" ), // _inc/client/components/module-settings/index.jsx:44 __( "The easiest way to upload ad-free and unbranded videos to your site. You get stats on video playback and shares and the player is lightweight and responsive.", "jetpack" ), // _inc/client/components/module-settings/index.jsx:41 -__( "{{link}}Configure your %(module_slug)s Settings {{/link}}", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:192 -__( "{{link}}Configure your %(module_slug)s Settings {{/link}}", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:170 -__( "Real-time offsite backups with automated restores deliver peace-of-mind, so you can focus on writing great content and increasing traffic while we protect every aspect of your investment. Upgrade today.", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:163 -__( "Let search engines and visitors know that you are serious about your websites integrity by upgrading Jetpack. Our anti-spam tools will eliminate comment spam, protect your SEO, and make it easier for visitors to stay in touch.", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:161 -__( "This module has no configuration options", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:154 -__( "Configure Google Analytics settings.", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:141 -__( "Activate this module to use Google Analytics.", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:135 -__( "Configure your SEO settings.", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:111 -__( "Activate this module to use the advanced SEO tools.", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:105 -__( "Make sure your site is easily found on search engines with SEO tools for your content and social posts.", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:97 -__( "Configure your Security Scans", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:88 -__( "You can see the information about security scanning in the \"At a Glance\" section.", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:85 -__( "Upgrade Jetpack and our state-of-the-art security scanner will hunt out malicious files and report them immediately so that you're never unaware of what is happening on your website.", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:79 -__( "Search your content.", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:51 +__( "{{link}}Configure your %(module_slug)s Settings {{/link}}", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:200 +__( "{{link}}Configure your %(module_slug)s Settings {{/link}}", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:178 +__( "Real-time offsite backups with automated restores deliver peace-of-mind, so you can focus on writing great content and increasing traffic while we protect every aspect of your investment. Upgrade today.", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:171 +__( "Let search engines and visitors know that you are serious about your websites integrity by upgrading Jetpack. Our anti-spam tools will eliminate comment spam, protect your SEO, and make it easier for visitors to stay in touch.", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:169 +__( "This module has no configuration options", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:162 +__( "Configure Google Analytics settings.", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:149 +__( "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.", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:134 +__( "Configure your SEO settings.", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:110 +__( "Activate this module to use the advanced SEO tools.", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:104 +__( "Make sure your site is easily found on search engines with SEO tools for your content and social posts.", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:96 +__( "Configure your Security Scans", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:87 +__( "You can see the information about security scanning in the \"At a Glance\" section.", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:84 +__( "Upgrade Jetpack and our state-of-the-art security scanner will hunt out malicious files and report them immediately so that you're never unaware of what is happening on your website.", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:78 +__( "Search your content.", "jetpack" ), // _inc/client/components/module-settings/modules-per-tab-page.jsx:50 _x( "Apps", "Navigation item.", "jetpack" ), // _inc/client/components/navigation/index.jsx:63 _x( "At a Glance", "Navigation item.", "jetpack" ), // _inc/client/components/navigation/index.jsx:50 _x( "Plans", "Navigation item.", "jetpack" ), // _inc/client/components/navigation/index.jsx:39 diff --git a/_inc/lib/admin-pages/class.jetpack-react-page.php b/_inc/lib/admin-pages/class.jetpack-react-page.php index 91a5cdeabdf2a..7f2fdedafe9ec 100644 --- a/_inc/lib/admin-pages/class.jetpack-react-page.php +++ b/_inc/lib/admin-pages/class.jetpack-react-page.php @@ -257,6 +257,7 @@ function page_admin_scripts() { 'happinessGravIds' => jetpack_get_happiness_gravatar_ids(), 'getModules' => $modules, 'showJumpstart' => jetpack_show_jumpstart(), + 'showHolidaySnow' => function_exists( 'jetpack_show_holiday_snow_option' ) ? jetpack_show_holiday_snow_option() : false, 'rawUrl' => Jetpack::build_raw_urls( get_home_url() ), 'adminUrl' => esc_url( admin_url() ), 'stats' => array( diff --git a/_inc/lib/class.media-summary.php b/_inc/lib/class.media-summary.php index 98844e15b7344..d129f5e688961 100644 --- a/_inc/lib/class.media-summary.php +++ b/_inc/lib/class.media-summary.php @@ -6,7 +6,10 @@ */ class Jetpack_Media_Summary { + private static $cache = array(); + static function get( $post_id, $blog_id = 0, $args = array() ) { + $defaults = array( 'max_words' => 16, 'max_chars' => 256, @@ -21,6 +24,11 @@ static function get( $post_id, $blog_id = 0, $args = array() ) { $blog_id = get_current_blog_id(); } + $cache_key = "{$blog_id}_{$post_id}_{$args['max_words']}_{$args['max_chars']}"; + if ( isset( self::$cache[ $cache_key ] ) ) { + return self::$cache[ $cache_key ]; + } + if ( ! class_exists( 'Jetpack_Media_Meta_Extractor' ) ) { jetpack_require_lib( 'class.media-extractor' ); } @@ -242,6 +250,8 @@ static function get( $post_id, $blog_id = 0, $args = array() ) { */ $return = apply_filters( 'jetpack_media_summary_output', $return, $post_id ); + self::$cache[ $cache_key ] = $return; + return $return; } diff --git a/_inc/lib/tracks/client.php b/_inc/lib/tracks/client.php index cb471c60bbe48..ef7cfaeae88bb 100644 --- a/_inc/lib/tracks/client.php +++ b/_inc/lib/tracks/client.php @@ -114,6 +114,12 @@ function jetpack_tracks_get_identity( $user_id ) { * @return bool true for success | \WP_Error if the event pixel could not be fired */ function jetpack_tracks_record_event( $user, $event_name, $properties = array(), $event_timestamp_millis = false ) { + + // We don't want to track user events during unit tests/CI runs. + if ( $user instanceof WP_User && 'wptests_capabilities' === $user->cap_key ) { + return false; + } + $event_obj = jetpack_tracks_build_event_obj( $user, $event_name, $properties, $event_timestamp_millis ); if ( is_wp_error( $event_obj->error ) ) { diff --git a/changelog.txt b/changelog.txt index 449b6f90f433e..308c7dc4fcd9d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,78 @@ == Changelog == += 4.5 = + +* Release date: January 17, 2017 +* Release post: http://wp.me/p1moTy-3Kc + +This release introduces a brand-new module, Jetpack Ads, a brand-new VideoPress feature, and a lot of new shortcodes and widgets. + +**Exciting New Features and Improvements:** + +* Generate revenue from your site with an all-new WordAds feature, which when enabled displays high-quality ads for your visitors. +* Today we are proud to release a fully redesigned VideoPress interface for easy uploading, management, and add-free playback of your fantastic videos now fully integrated with your Jetpack Premium or Professional plans. +* Spice up your sidebar with new widgets that display blog stats, author info, "Follow my blog" buttons, and even an event countdown. +* Embed your amazing 360° photos with the VR shortcode +* Link your visitors to your Tumblr or Twitch pages using the new icons in the Social Media Icons Widget. + +**Enhancements** + +* Use the beautiful Jetpack carousel feature to display single images. +* Turn on and update Related Posts right from the Customizer. +* Customize the output of the Related Posts headline using a new filter. + +**Performance and Security Improvements:** + +* Your Custom CSS will now be served in a separate stylesheet when it is more than 2,000 characters. +* Your Stats queries are now always being made over HTTPS. +* Holiday Snow files now load in the footer, but rest assured the snow still falls from above. +* We have improved Jetpack's synchronization process to support more plugins and use less resources. +* The jQuery Cycle script used by slideshow galleries is now minified, resulting in faster loading times. + +**Slightly Less Exciting Enhancements:** + +* The JSON API now allows updating translations and alternative theme installation methods. +* Public Custom Post Types are now automatically available via the WordPress.com REST API. +* We've added a token-based authentication mechanism to the REST API in order for the site to be able to receive authenticated requests from WordPress.com. +* Use `sync` commands in Jetpack's WP CLI. +* You can now set the value for options directly in the Contact Form shortcode. +* Updated some verbiage around IP Whitelisting on the Protect settings screen. +* Custom sharing buttons got some new variables. +* RIP blip.tv — we've removed your shortcode. +* Improved Image and Display Posts Widget settings to provide more explanation and better error messages. +* We've added a few new Content Options to the Customizer for supported themes. +* Improved the Facebook Widget to avoid confusion when editing width and height settings. +* Added and improved a few shortcodes. + +**Improved Compatibility:** + +* If your server is misconfigured and we can't get an IP address we're going to deactivate Protect and send you a notice so you're in the loop. +* The WPML compatibility file wasn't loading at the right time, but we've fixed that. +* We've improved compatibility with tools like Cavalcade to avoid stuck Cron jobs. +* Some selected WooCommerce data (order items and order item meta) are now syncing to WordPress.com. + +**Bug Fixes** + +* You'll notice numerous design improvements to the Jetpack UI. +* Accessibility is important to us so we've made some improvements there. +* Missing attachments in the Carousel were causing an infinite loop, but we've corrected that. +* Eliminated a PHP Notice when running the CLI `wp jetpack` command. +* PHP warnings in the Restaurant Menu Post type have seen their last day with us. +* Fixed a bug that displayed the wrong connected user for up to 24 hours after they disconnected. +* Removed a deprecated function to prevent notices when using Infinite Scroll in the Customizer. +* Long titles in Jetpack widgets weren't looking so great, so we cleaned them up. +* Before now you weren't able to create a child category from WordPress.com. Now you can! +* Rogue colons were showing up in the related posts area on sites with the Twenty Fourteen and Twenty Sixteen themes. +* Fixed a ReCaptcha error on the Email sharing button. +* Confirmed Instagram embeds actually load when using Infinite Scroll. +* Site Icons now display on the WordPress.com site management interface. +* Set a default time limit of 30 seconds when sending sync requests via Cron. +* Synchronized supported shortcodes on a site. +* Fixed an issue where empty categories weren't showing with the Widget Visibility feature dropdown. +* Fixed various little bugs when working with multiple widgets in the Customizer and in the Widgets admin screen. +* Added a Translate Widget default title in case you haven't defined one. +* The Top Posts Widget now avoids layout issues when using the Grid layout while displaying a post without an image. + = 4.4.2 = * Release date: December 6, 2016 diff --git a/class.jetpack-cli.php b/class.jetpack-cli.php index 77d242858a7ff..f71c62dcd2860 100644 --- a/class.jetpack-cli.php +++ b/class.jetpack-cli.php @@ -34,6 +34,7 @@ public function status( $args, $assoc_args ) { } if ( isset( $args[0] ) && 'full' !== $args[0] ) { + /* translators: %s is a command like "prompt" */ WP_CLI::error( sprintf( __( '%s is not a valid command.', 'jetpack' ), $args[0] ) ); } @@ -115,6 +116,7 @@ public function disconnect( $args, $assoc_args ) { $action = isset( $args[0] ) ? $args[0] : 'prompt'; if ( ! in_array( $action, array( 'blog', 'user', 'prompt' ) ) ) { + /* translators: %s is a command like "prompt" */ WP_CLI::error( sprintf( __( '%s is not a valid command.', 'jetpack' ), $action ) ); } @@ -148,9 +150,10 @@ public function disconnect( $args, $assoc_args ) { case 'user': if ( Jetpack::unlink_user( $user->ID ) ) { Jetpack::log( 'unlink', $user->ID ); - WP_CLI::success( sprintf( __( '%s has been successfully disconnected.', 'jetpack' ), $action ) ); + WP_CLI::success( __( 'User has been successfully disconnected.', 'jetpack' ) ); } else { - WP_CLI::error( sprintf( __( '%s could not be disconnected. Are you sure they\'re connected currently?', 'jetpack' ), "{$user->login} <{$user->email}>" ) ); + /* translators: %s is a username */ + WP_CLI::error( sprintf( __( "User %s could not be disconnected. Are you sure they're connected currently?", 'jetpack' ), "{$user->login} <{$user->email}>" ) ); } break; case 'prompt': @@ -183,6 +186,7 @@ public function disconnect( $args, $assoc_args ) { public function reset( $args, $assoc_args ) { $action = isset( $args[0] ) ? $args[0] : 'prompt'; if ( ! in_array( $action, array( 'options', 'modules' ) ) ) { + /* translators: %s is a command like "prompt" */ WP_CLI::error( sprintf( __( '%s is not a valid command.', 'jetpack' ), $action ) ); } @@ -199,6 +203,7 @@ public function reset( $args, $assoc_args ) { foreach ( $options_to_reset['jp_options'] as $option_to_reset ) { Jetpack_Options::delete_option( $option_to_reset ); usleep( 100000 ); + /* translators: This is the result of an action. The option named %s was reset */ WP_CLI::success( sprintf( __( '%s option reset', 'jetpack' ), $option_to_reset ) ); } @@ -208,6 +213,7 @@ public function reset( $args, $assoc_args ) { foreach ( $options_to_reset['wp_options'] as $option_to_reset ) { delete_option( $option_to_reset ); usleep( 100000 ); + /* translators: This is the result of an action. The option named %s was reset */ WP_CLI::success( sprintf( __( '%s option reset', 'jetpack' ), $option_to_reset ) ); } @@ -261,6 +267,7 @@ public function reset( $args, $assoc_args ) { public function module( $args, $assoc_args ) { $action = isset( $args[0] ) ? $args[0] : 'list'; if ( ! in_array( $action, array( 'list', 'activate', 'deactivate', 'toggle' ) ) ) { + /* translators: %s is a command like "prompt" */ WP_CLI::error( sprintf( __( '%s is not a valid command.', 'jetpack' ), $action ) ); } if ( in_array( $action, array( 'activate', 'deactivate', 'toggle' ) ) ) { @@ -344,6 +351,7 @@ public function module( $args, $assoc_args ) { public function protect( $args, $assoc_args ) { $action = isset( $args[0] ) ? $args[0] : 'prompt'; if ( ! in_array( $action, array( 'whitelist' ) ) ) { + /* translators: %s is a command like "prompt" */ WP_CLI::error( sprintf( __( '%s is not a valid command.', 'jetpack' ), $action ) ); } // Check if module is active @@ -373,7 +381,8 @@ public function protect( $args, $assoc_args ) { // Is it already whitelisted? if ( jetpack_protect_ip_address_is_in_range( $new_ip, $whitelisted->range_low, $whitelisted->range_high ) ) { - WP_CLI::error( sprintf( __( "%s has already been whitelisted", 'jetpack' ), $new_ip ) ); + /* translators: %s is an IP address */ + WP_CLI::error( sprintf( __( '%s has already been whitelisted', 'jetpack' ), $new_ip ) ); break; } $whitelist[] = $whitelisted->range_low . " - " . $whitelisted->range_high; @@ -382,7 +391,8 @@ public function protect( $args, $assoc_args ) { // Check if the IP is already whitelisted (single IP only) if ( $new_ip == $whitelisted->ip_address ) { - WP_CLI::error( sprintf( __( "%s has already been whitelisted", 'jetpack' ), $new_ip ) ); + /* translators: %s is an IP address */ + WP_CLI::error( sprintf( __( '%s has already been whitelisted', 'jetpack' ), $new_ip ) ); break; } $whitelist[] = $whitelisted->ip_address; @@ -429,6 +439,7 @@ public function protect( $args, $assoc_args ) { WP_CLI::error( __( $result, 'jetpack' ) ); } + /* translators: %s is an IP address */ WP_CLI::success( sprintf( __( '%s has been whitelisted.', 'jetpack' ), $new_ip ) ); break; case 'prompt': @@ -474,6 +485,7 @@ public function options( $args, $assoc_args ) { $flagged = ! in_array( $args[1], $safe_to_modify ); if ( ! in_array( $action, array( 'list', 'get', 'delete', 'update' ) ) ) { + /* translators: %s is a command like "prompt" */ WP_CLI::error( sprintf( __( '%s is not a valid command.', 'jetpack' ), $action ) ); } diff --git a/class.jetpack-debugger.php b/class.jetpack-debugger.php index b127f4e50039c..7318f3a3cda1f 100644 --- a/class.jetpack-debugger.php +++ b/class.jetpack-debugger.php @@ -173,7 +173,7 @@ public static function jetpack_debug_display_handler() { $tests['IDENTITY_CRISIS']['result'] = $identity_crisis; $tests['IDENTITY_CRISIS']['fail_message'] = esc_html__( 'Something has gotten mixed up in your Jetpack Connection!', 'jetpack' ); - $self_xml_rpc_url = home_url( 'xmlrpc.php' ); + $self_xml_rpc_url = site_url( 'xmlrpc.php' ); $testsite_url = Jetpack::fix_url_for_bad_hosts( JETPACK__API_BASE . 'testsite/1/?url=' ); @@ -245,6 +245,7 @@ public static function jetpack_debug_display_handler() { $default_theme = wp_get_theme( WP_DEFAULT_THEME ); if ( $default_theme->exists() ) { + /* translators: %s is the name of a theme */ echo esc_html( sprintf( __( "If your problem isn't known or caused by a plugin, try activating %s (the default WordPress theme).", 'jetpack' ), $default_theme->get( 'Name' ) ) ); } else { esc_html_e( "If your problem isn't known or caused by a plugin, try activating the default WordPress theme.", 'jetpack' ); @@ -284,7 +285,7 @@ public static function jetpack_debug_display_handler() {
-

%s\'s WordPress.com account.', 'jetpack' ), esc_html( Jetpack::get_master_user_email() ) ); ?>

+

%s\'s WordPress.com account.', 'jetpack' ), esc_html( Jetpack::get_master_user_email() ) ); ?>

diff --git a/class.jetpack-jitm.php b/class.jetpack-jitm.php index 518c13c2543fe..3556abfb8e876 100755 --- a/class.jetpack-jitm.php +++ b/class.jetpack-jitm.php @@ -461,7 +461,7 @@ function woocommerce_services_msg() { ?>