Skip to content

Commit

Permalink
Merge pull request #1421 from Parsely/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
acicovic authored Feb 27, 2023
2 parents b59a2c6 + 6aeee3d commit 0d811f5
Show file tree
Hide file tree
Showing 203 changed files with 8,049 additions and 2,889 deletions.
42 changes: 29 additions & 13 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,30 +1,46 @@
{
"env": { "browser": true },
"env": {
"browser": true
},
"extends": [
"plugin:@wordpress/eslint-plugin/recommended-with-formatting",
"plugin:jest/recommended",
"plugin:@typescript-eslint/recommended"
"plugin:@typescript-eslint/recommended"
],
"plugins": [
"@typescript-eslint"
],
"settings": {
"jest": { "version": "latest" },
"import/resolver": {
"jest": {
"version": "latest"
},
"import/resolver": {
"node": {
"extensions": [ ".js", ".jsx", ".ts", ".tsx", ".json" ]
"extensions": [
".js",
".jsx",
".ts",
".tsx",
".json"
]
}
}
}
},
"ignorePatterns": [ "webpack.config.js" ],
"ignorePatterns": [
"webpack.config.js"
],
"rules": {
"@wordpress/i18n-text-domain": [ "error", { "allowedTextDomain": [ "wp-parsely" ] } ],
"@typescript-eslint/ban-ts-comment": "off",
"@wordpress/i18n-text-domain": [
"error",
{
"allowedTextDomain": [
"wp-parsely"
]
}
],
"@typescript-eslint/ban-ts-comment": "off",
// Enabling TS rule and disabling Base rule as it can report incorrect errors.
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"]
},
"globals": {
// Page variable for Puppeteer tests
"page": true
}
}
5 changes: 4 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# See https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners

# These owners will be the default owners for everything in the repo.
# This team will be requested for review when someone opens a pull request.
* @Parsely/wp-parsely

# Don't assign owners for the following files:
package.json
package-lock.json
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
---
name: Bug report
about: Create a report to help us improve

---

<!--
Hello! Just a quick reminder that this is a public repo. Please don't include any internal links or sensitive data (like PII, private code, client names, site URLs, etc. If you're not sure if something is safe to share, please just ask!
-->

## Describe the bug
<!-- A clear and concise description of what the bug is. -->

Expand Down
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
---
name: Feature request
about: Suggest an idea for this project

---

<!--
Hello! Just a quick reminder that this is a public repo. Please don't include any internal links or sensitive data (like PII, private code, client names, site URLs, etc. If you're not sure if something is safe to share, please just ask!
-->

## Is your feature request related to a problem?
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

Expand Down
21 changes: 12 additions & 9 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<!--- Provide a general summary of your changes in the Title above -->
<!--
Hello! Just a quick reminder that this is a public repo. Please don't include any internal links or sensitive data (like PII, private code, client names, site URLs, etc. If you're not sure if something is safe to share, please just ask!
-->

## Description
<!--- Describe your changes in detail -->
<!-- Describe your changes in detail. -->

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
## Motivation and context
<!-- Why is this change required? What problem does it solve? -->
<!-- If it fixes an open issue, please link to the issue here. -->

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->
## How has this been tested?
<!-- Please describe in detail how you tested your changes. -->
<!-- Include details of your testing environment, and the tests you ran too. -->
<!-- See how your change affects other areas of the code, etc. -->

## Screenshots (if appropriate)
<!-- Any screenshot(s) demonstrating the result of this PR. -->
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: actions/checkout@v3

- name: Use desired version of NodeJS
uses: actions/setup-node@v3.5.1
uses: actions/setup-node@v3.6.0
with:
node-version: 16
cache: npm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.5.1
uses: actions/setup-node@v3.6.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jobs:

steps:
- name: Create a new release draft
uses: release-drafter/release-drafter@v5.21.1
uses: release-drafter/release-drafter@v5.23.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@

npm run lint
composer cs
vendor/bin/phpstan analyse --memory-limit=-1G
Binary file modified .wordpress-org/screenshot-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,43 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.7.0](https://github.com/Parsely/wp-parsely/compare/3.6.2...3.7.0) - 2023-02-27

### Added

- Add filters to configure user capability on remote APIs ([#1417](https://github.com/Parsely/wp-parsely/pull/1417))
- Content Helper: Add edit post icon and make linking behavior consistent across features ([#1346](https://github.com/Parsely/wp-parsely/pull/1346))
- Content Helper: Add WordPress Dashboard Widget ([#1305](https://github.com/Parsely/wp-parsely/pull/1305))
- Content Helper: Add Parse.ly Stats List Column ([#1271](https://github.com/Parsely/wp-parsely/pull/1271))
- Add TypeScript support to all remaining JavaScript files ([#1239](https://github.com/Parsely/wp-parsely/pull/1239))

### Changed

- Show/hide Parse.ly widget and stats column based on user capabilities ([#1407](https://github.com/Parsely/wp-parsely/pull/1407))
- Content Helper: Update naming ([#1380](https://github.com/Parsely/wp-parsely/pull/1380))
- UI: Minor wording tweak for Content Helper error ([#1304](https://github.com/Parsely/wp-parsely/pull/1304))
- UI: Fix grammar in Content Helper error ([#1303](https://github.com/Parsely/wp-parsely/pull/1303))
- UI: Fix typo in Disable JavaScript option ([#1302](https://github.com/Parsely/wp-parsely/pull/1302))
- Refactor Content Helper for better structure ([#1288](https://github.com/Parsely/wp-parsely/pull/1288))
- Centralize dashboard URL generation in a single function ([#1287](https://github.com/Parsely/wp-parsely/pull/1287))
- Improve Remote APIs naming ([#1272](https://github.com/Parsely/wp-parsely/pull/1272))
- Rename API Key to Site ID to improve consistency ([#1244](https://github.com/Parsely/wp-parsely/pull/1244))

### Fixed

- Fix referral distribution in Performance Details panel ([#1381](https://github.com/Parsely/wp-parsely/pull/1381))
- Fix Undefined warnings on Performance Details panel ([#1378](https://github.com/Parsely/wp-parsely/pull/1378))
- Content Helper: Fix top referrers percentage displaying as "NaN" ([#1374](https://github.com/Parsely/wp-parsely/pull/1374))
- Fix PHP 8 incompatibilities ([#1362](https://github.com/Parsely/wp-parsely/pull/1362))
- Fix PHP Notice on Settings page: "Undefined index: title" ([#1342](https://github.com/Parsely/wp-parsely/pull/1342))
- Content Helper: Make error hint display for all Forbidden (403) errors ([#1336](https://github.com/Parsely/wp-parsely/pull/1336))
- Fix PHPStan Errors ([#1252](https://github.com/Parsely/wp-parsely/pull/1252))
- Fix SonarCloud warnings ([#1246](https://github.com/Parsely/wp-parsely/pull/1246))

### Dependency Updates

- The list of all dependency updates for this release is available [here](https://github.com/Parsely/wp-parsely/pulls?q=is%3Apr+is%3Amerged+milestone%3A3.7.0+label%3A%22Component%3A+Dependencies%22).

## [3.6.2](https://github.com/Parsely/wp-parsely/compare/3.6.1...3.6.2) - 2023-02-13

### Fixed
Expand All @@ -13,6 +50,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improve checks on proxy endpoints
- Fix referral distribution in Performance Details panel ([#1382](https://github.com/Parsely/wp-parsely/pull/1382))

## [3.5.3](https://github.com/Parsely/wp-parsely/compare/3.5.2...3.5.3) - 2023-02-13

### Fixed

- Improve checks on proxy endpoints

## [3.4.3](https://github.com/Parsely/wp-parsely/compare/3.4.2...3.4.3) - 2023-02-13

### Fixed

- Improve checks on proxy endpoints

## [3.6.1](https://github.com/Parsely/wp-parsely/compare/3.6.0...3.6.1) - 2022-12-20

### Fixed
Expand Down
77 changes: 47 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Parse.ly

Stable tag: 3.6.2
Stable tag: 3.7.0
Requires at least: 5.0
Tested up to: 6.1
Requires PHP: 7.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: analytics, content marketing, parse.ly, parsely, parsley
Contributors: parsely, hbbtstar, jblz, mikeyarce, GaryJ, parsely_mike, pauargelaguet, acicovic, mehmoodak
Contributors: parsely, hbbtstar, jblz, mikeyarce, GaryJ, parsely_mike, acicovic, mehmoodak

The Parse.ly plugin facilitates real-time and historical analytics to your content through a platform designed and built for digital publishing.

Expand All @@ -25,22 +25,35 @@ Feedback, suggestions, questions or concerns? Open a new [GitHub issue](https://

### Features

Some notable features of the wp-parsely plugin are:

- Automatically inserts the Parse.ly metadata and JavaScript in all published pages and posts (supports Custom Post Types).
- [Supports Google Tag Manager, AMP, Facebook Instant Articles, Google Web Stories and Cloudflare](https://docs.parse.ly/plugin-common-questions/#h-is-wp-parsely-compatible-with-amp-facebook-instant-articles-or-google-web-stories).
- Offers the `wpParselyOnLoad` and `wpParselyOnReady` JavaScript hooks that allow advanced integrations requiring JavaScript, such as [Dynamic Tracking](https://docs.parse.ly/plugin-dynamic-tracking/).
- [Supports WordPress Network (Multisite) setups](https://docs.parse.ly/plugin-common-questions/#h-is-wp-parsely-compatible-with-wordpress-network-multisite).
- [Supports decoupled (headless) setups](https://docs.parse.ly/plugin-decoupled-headless-support/).
- Provides a [Recommendations Block](https://docs.parse.ly/recommendations-block/) that shows a list of links related to the currently viewed page. Useful for showcasing related content to visitors.
- Provides a [Content Helper](https://docs.parse.ly/plugin-content-helper/) in the WordPress Editor sidebar that displays the following panels:
- **Performance Details**: Shows performance metrics about the post/page currently being edited.
- **Related Top-Performing Posts**: Provides a list of the website’s most successful posts, similar to the post/page currently being edited.
- Provides a settings page to customize your integration. Some of the options include:
- Output metadata as [JSON-LD](https://docs.parse.ly/metadata-jsonld/) or [repeated meta tags](https://docs.parse.ly/metatags/).
- Choose whether logged-in users should be tracked.
- Define how to track every Post Type (as Post, Non-Post or no tracking).
- Offers a wide range of hooks to customize the plugin's functionality even further.
The wp-parsely plugin is packed with features that allow for a seamless integration process, and brings the power of the Parse.ly dashboard into WordPress.

#### Automated integration

The plugin automatically inserts the Parse.ly metadata and JavaScript in all published pages and posts (Custom Post Types are supported). It also provides a settings page to customize your integration, with options including:
- Output Parse.ly metadata as [JSON-LD](https://docs.parse.ly/metadata-jsonld/) or [repeated meta tags](https://docs.parse.ly/metatags/).
- Choose whether logged-in users should be tracked.
- Define how to track every Post Type (as Post, Non-Post or no tracking).

#### The Parse.ly Content Helper

The [Content Helper](https://docs.parse.ly/plugin-content-helper/) is a set of content insight tools including:
- The [Parse.ly Dashboard Widget](https://docs.parse.ly/plugin-content-helper/#h-dashboard) - Displays the site's top posts in the last 7 days in the WordPress Dashboard.
- The [Parse.ly Stats Column](https://docs.parse.ly/plugin-content-helper/#h-posts) - Displays published post performance for the last 7 days in Post Lists.
- The [Parse.ly Editor Sidebar](https://docs.parse.ly/plugin-content-helper/#h-editor) - This sidebar is integrated into the WordPress Editor and offers insights about the content currently being edited such as:
- [Performance Details](https://docs.parse.ly/plugin-content-helper/#h-performance-details) - Displays performance metrics about the content currently being edited.
- [Related Top Posts](https://docs.parse.ly/plugin-content-helper/#h-related-top-posts) - Displays a list of the website’s most successful posts, similar to the post/page currently being edited.

#### The Parse.ly Recommendations Block

The plugin includes a [Recommendations Block](https://docs.parse.ly/recommendations-block/) that displays a list of posts related to the currently viewed post/page. The Block is useful for showcasing related content to visitors, and it can also be used in Full Site Editing mode or as a [Block-based Widget](https://wordpress.org/documentation/article/block-based-widgets-editor/).

#### Advanced integrations support

While the plugin works out of the box for basic integrations, it offers a host of features that easily allow for advanced integration scenarios:
- Support for [Google Tag Manager, AMP, Facebook Instant Articles, Google Web Stories and Cloudflare](https://docs.parse.ly/plugin-common-questions/#h-is-wp-parsely-compatible-with-amp-facebook-instant-articles-or-google-web-stories) is included.
- The plugin exposes the `wpParselyOnLoad` and `wpParselyOnReady` JavaScript hooks that allow for advanced integrations requiring JavaScript, such as [Dynamic Tracking](https://docs.parse.ly/plugin-dynamic-tracking/).
- Support for WordPress [network/multisite](https://docs.parse.ly/plugin-common-questions/#h-is-wp-parsely-compatible-with-wordpress-network-multisite) and [decoupled/headless](https://docs.parse.ly/plugin-decoupled-headless-support/) (GraphQL and WP Rest API) setups is included.
- Last but not least, a wide range of hooks is available in order to customize the plugin's functionality even further.

### Documentation and resources

Expand Down Expand Up @@ -96,15 +109,19 @@ Please visit the [changelog](https://github.com/parsely/wp-parsely/blob/trunk/CH

## Screenshots

1. Parse.ly plugin main settings for easy setup. For the plugin to start working, only the Site ID is needed.
![The main settings screen of the wp-parsely plugin](.wordpress-org/screenshot-1.png)
2. Parse.ly plugin settings that require you to submit a website recrawl request whenever you update them.
![The main settings screen of the wp-parsely plugin](.wordpress-org/screenshot-2.png)
3. Parse.ly plugin advanced settings. To be used only if instructed by Parse.ly staff.
![The main settings screen of the wp-parsely plugin](.wordpress-org/screenshot-3.png)
4. The Content Helper, featuring the "Performance Details" and "Related Top-Performing Posts" panels.
![The settings for the Parse.ly Recommended Widget](.wordpress-org/screenshot-4.png)
5. The Recommendations Block. Showcases links to content on your site as provided by the Parse.ly /related API.
![The settings for the Parse.ly Recommended Widget](.wordpress-org/screenshot-5.png)
6. A view of the Parse.ly Dashboard Overview. Parse.ly offers analytics that empowers you to better understand how your content is performing.
![The Parsely Dashboard Overview](.wordpress-org/screenshot-6.png)
1. Parse.ly plugin basic settings for easy setup. For the plugin to start working, only the Site ID is needed.
![Parse.ly Plugin - Basic Settings](.wordpress-org/screenshot-1.png)
2. Parse.ly plugin settings that require a website recrawl whenever they are updated.
![Parse.ly Plugin - Requires Recrawl Settings](.wordpress-org/screenshot-2.png)
3. Parse.ly plugin advanced settings, to be used only if instructed by Parse.ly staff.
![Parse.ly Plugin - Advanced Settings](.wordpress-org/screenshot-3.png)
4. The Parse.ly Dashboard Widget, showing the website's top posts in the last 7 days.
![Parse.ly Dashboard Widget](.wordpress-org/screenshot-4.png)
5. The Parse.ly Stats Column (on the right), showing information about content that is being tracked as Posts.
![Parse.ly List Column](.wordpress-org/screenshot-5.png)
6. The Parse.ly Editor Sidebar, featuring the Performance Details and Related Top Posts panels.
![Parse.ly Editor Sidebar](.wordpress-org/screenshot-6.png)
7. The Recommendations Block, showcasing links to related content on your site.
![Parse.ly Recommendations Block](.wordpress-org/screenshot-7.png)
8. A view of the Parse.ly Dashboard Overview. Parse.ly offers analytics that empower you to better understand how your content is performing.
![Parse.ly Dashboard Overview](.wordpress-org/screenshot-8.png)
15 changes: 15 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Security Policy

> Although we strive to create the most secure products possible, we are not perfect. If you happen to find a security vulnerability in one of our services, we would appreciate letting us know and allowing us to respond before disclosing the issue publicly. We take security seriously, and we will try to review and reply to every legitimate security report personally within 24 hours.
>
> [Automattic](https://automattic.com/security/)
## Supported Versions

We fully support one minor release behind the latest (i.e. if 3.6 is the latest release, we will support 3.5).

Depending on the severity of the vulnerability, we may port and release fixes for older, unsupported versions as well.

## Reporting a Vulnerability

For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit security issuess via the HackerOne portal: https://hackerone.com/automattic
20 changes: 20 additions & 0 deletions bin/uvn.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

# Script to update version numbers (uvn) in the code. It will create a new
# branch and commit the changes. After inspecting the results, it can be pushed
# to GitHub as a PR.
#
# Usage: Specify the new version as an argument. (e.g. bin/uvn.sh 3.7.0)
# Note: This has only been tested with macOS sed.

git checkout -b update/wp-parsely-version-to-$1

sed -i '' "s/Stable tag: .* $/Stable tag: $1 /" README.md
sed -i '' "s/\"version\": \".*\"/\"version\": \"$1\"/" package.json
sed -i '' "s/export const PLUGIN_VERSION = '.*'/export const PLUGIN_VERSION = '$1'/" tests/e2e/utils.ts
sed -i '' "s/ \* Version: .*$/ \* Version: $1/" wp-parsely.php
sed -i '' "s/const PARSELY_VERSION = '.*'/const PARSELY_VERSION = '$1'/" wp-parsely.php

npm install # Update version numbers in package.lock.json.

git add -A && git commit -m "Update wp-parsely version to $1"
1 change: 1 addition & 0 deletions build/admin-parsely-stats.asset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => '073b1605887b0f95d4fb');
1 change: 1 addition & 0 deletions build/admin-parsely-stats.css

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

Loading

0 comments on commit 0d811f5

Please sign in to comment.