Skip to content

Commit

Permalink
Merge branch 'develop' into fix/338
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffpaul authored Nov 3, 2022
2 parents d3032f6 + 67c339e commit f49e96e
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 30 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@ All notable changes to this project will be documented in this file, per [the Ke

## [Unreleased] - TBD

## [1.3.0] - 2022-10-28
**Note that this version bumps the minimum WordPress version from 5.6 to 6.0 and adds an integration with the Sophi Override feature.**

### Added
- Override feature to the Sophi Site Automation Block (props [@faisal-alvi](https://github.com/faisal-alvi), [@jeffpaul](https://github.com/jeffpaul), [@fabiankaegy](https://github.com/fabiankaegy), [@dkotter](https://github.com/dkotter), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#333](https://github.com/globeandmail/sophi-for-wordpress/pull/333), [#345](https://github.com/globeandmail/sophi-for-wordpress/pull/345)).
- [GET] `/wp-json/sophi/v1/site-automation` WP REST endpoint to Get Posts from Site Automation (props [@faisal-alvi](https://github.com/faisal-alvi), [@jeffpaul](https://github.com/jeffpaul), [@fabiankaegy](https://github.com/fabiankaegy), [@dkotter](https://github.com/dkotter), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#333](https://github.com/globeandmail/sophi-for-wordpress/pull/333)).
- [POST] `/wp-json/sophi/v1/site-automation-override` WP REST endpoint to Override the Posts for Site Automation (props [@faisal-alvi](https://github.com/faisal-alvi), [@jeffpaul](https://github.com/jeffpaul), [@fabiankaegy](https://github.com/fabiankaegy), [@dkotter](https://github.com/dkotter), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#333](https://github.com/globeandmail/sophi-for-wordpress/pull/333)).
- `api_version` to the block JSON files (props [@faisal-alvi](https://github.com/faisal-alvi) via [#345](https://github.com/globeandmail/sophi-for-wordpress/pull/345)).
- Display message when no posts are returned from Sophi Site Automation (props [@faisal-alvi](https://github.com/faisal-alvi) via [#345](https://github.com/globeandmail/sophi-for-wordpress/pull/345)).
- Functionality to remove old error messages when posts are found (props [@faisal-alvi](https://github.com/faisal-alvi) via [#345](https://github.com/globeandmail/sophi-for-wordpress/pull/345)).
- Tracker Address option on plugin settings page (props [@faisal-alvi](https://github.com/faisal-alvi), [@YMufleh](https://github.com/YMufleh), [@jeffpaul](https://github.com/jeffpaul) via [#342](https://github.com/globeandmail/sophi-for-wordpress/pull/342)).
- New tutorial for modifying tracking data on documentation site (props [@iamdharmesh](https://github.com/iamdharmesh), [@YMufleh](https://github.com/YMufleh), [@dkotter](https://github.com/dkotter) via [#327](https://github.com/globeandmail/sophi-for-wordpress/pull/327)).

### Changed
- Bump minimum WordPress version from 5.6 to 6.0 (props [@faisal-alvi](https://github.com/faisal-alvi) via [#346](https://github.com/globeandmail/sophi-for-wordpress/pull/346)).
- Sophi Site Automation Block from a server-side-rendered custom block to a nested block (props [@faisal-alvi](https://github.com/faisal-alvi), [@jeffpaul](https://github.com/jeffpaul), [@fabiankaegy](https://github.com/fabiankaegy), [@dkotter](https://github.com/dkotter), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#333](https://github.com/globeandmail/sophi-for-wordpress/pull/333), [#345](https://github.com/globeandmail/sophi-for-wordpress/pull/345)).
- Replaced hardcoded tracker endpoint value with the new Tracker Address setting (props [@faisal-alvi](https://github.com/faisal-alvi), [@YMufleh](https://github.com/YMufleh), [@jeffpaul](https://github.com/jeffpaul) via [#342](https://github.com/globeandmail/sophi-for-wordpress/pull/342)).
- Developer Documentation updates (props [@iamdharmesh](https://github.com/iamdharmesh), [@jeffpaul](https://github.com/jeffpaul), [@faisal-alvi](https://github.com/faisal-alvi) via [#332](https://github.com/globeandmail/sophi-for-wordpress/pull/332), [#333](https://github.com/globeandmail/sophi-for-wordpress/pull/333)).

### Fixed
- Prevent duplicate CMS publish/update event tracking (props [@cadic](https://github.com/cadic), [@peterwilsoncc](https://github.com/peterwilsoncc), [@jeffpaul](https://github.com/jeffpaul) via [#335](https://github.com/globeandmail/sophi-for-wordpress/pull/335)).

### Security
- Added latest PHPCompatibility checks for PHP 8.0 (props [@Sidsector9](https://github.com/Sidsector9) via [#331](https://github.com/globeandmail/sophi-for-wordpress/pull/331)).
- Update dependency `phpunit/phpunit` from 8.5.29 to 9.5.25 (props [@renovate](https://github.com/apps/renovate), [@Sidsector9](https://github.com/Sidsector9), [@faisal-alvi](https://github.com/faisal-alvi) via [#329](https://github.com/globeandmail/sophi-for-wordpress/pull/329), [#337](https://github.com/globeandmail/sophi-for-wordpress/pull/337), [#339](https://github.com/globeandmail/sophi-for-wordpress/pull/339)).
- Update dependency `10up-toolkit` from 4.1.2 to 4.3.0 (props [@renovate](https://github.com/apps/renovate), [@Sidsector9](https://github.com/Sidsector9), [@faisal-alvi](https://github.com/faisal-alvi) via [#330](https://github.com/globeandmail/sophi-for-wordpress/pull/330), [#340](https://github.com/globeandmail/sophi-for-wordpress/pull/340)).
- Update `actions/checkout` action from v2 to v3 and v3.0.2 to v3.1.0 (props [@renovate](https://github.com/apps/renovate) via [#334](https://github.com/globeandmail/sophi-for-wordpress/pull/334)).

## [1.2.1] - 2022-08-30
### Changed
- Bump `content_update` schema from 2-0-3 to 2-0-5 (props [@jeffpaul](https://github.com/jeffpaul), [@vjayaseelan90](https://github.com/vjayaseelan90), [@YMufleh](https://github.com/YMufleh) via [#323](https://github.com/globeandmail/sophi-for-wordpress/pull/323)).
Expand Down Expand Up @@ -240,6 +268,7 @@ All notable changes to this project will be documented in this file, per [the Ke
- Initial public release! 🎉

[Unreleased]: https://github.com/globeandmail/sophi-for-wordpress/compare/trunk...develop
[1.3.0]: https://github.com/globeandmail/sophi-for-wordpress/compare/1.2.1...1.3.0
[1.2.1]: https://github.com/globeandmail/sophi-for-wordpress/compare/1.2.0...1.2.1
[1.2.0]: https://github.com/globeandmail/sophi-for-wordpress/compare/1.1.3...1.2.0
[1.1.3]: https://github.com/globeandmail/sophi-for-wordpress/compare/1.1.2...1.1.3
Expand Down
2 changes: 1 addition & 1 deletion CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The following individuals are responsible for curating the list of issues, respo

Thank you to all the people who have already contributed to this repository via bug reports, code, design, ideas, project management, translation, testing, etc.

[Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Tung Du (@dinhtungdu)](https://github.com/dinhtungdu), [Darin Kotter (@dkotter)](https://github.com/dkotter), [Helen Hou-Sandí (@helen)](https://github.com/helen), [Diana Padron (@dianapadron)](https://profiles.wordpress.org/dianapadron), [Jozsef Kozo (@kojraai)](https://github.com/kojraai), [Barry Ceelen (@barryceelen)](https://github.com/barryceelen), [Ramon Ahnert (@Rahmon)](https://github.com/Rahmon), [Felipe Elia (@felipeelia)](https://github.com/felipeelia), [Thorsten Ott (@tott)](https://github.com/tott), [Alasdair McKie (@amckie)](https://github.com/amckie), [Oscar Sanchez S. (@oscarssanchez)](https://github.com/oscarssanchez), [Thorsten Ott (@tott)](https://github.com/tott), [Yazan Mufleh (@YMufleh)](https://github.com/YMufleh), [Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh), [Max Lyuchin (@cadic)](https://github.com/cadic), [Siddharth Thevaril (@Sidsector9)](https://github.com/Sidsector9), [Faisal Alvi (@faisal-alvi)](https://github.com/faisal-alvi), [Mend Renovate (@renovate)](https://github.com/apps/renovate), [Vijay Jayaseelan (@vjayaseelan90)](https://github.com/vjayaseelan90).
[Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Tung Du (@dinhtungdu)](https://github.com/dinhtungdu), [Darin Kotter (@dkotter)](https://github.com/dkotter), [Helen Hou-Sandí (@helen)](https://github.com/helen), [Diana Padron (@dianapadron)](https://profiles.wordpress.org/dianapadron), [Jozsef Kozo (@kojraai)](https://github.com/kojraai), [Barry Ceelen (@barryceelen)](https://github.com/barryceelen), [Ramon Ahnert (@Rahmon)](https://github.com/Rahmon), [Felipe Elia (@felipeelia)](https://github.com/felipeelia), [Thorsten Ott (@tott)](https://github.com/tott), [Alasdair McKie (@amckie)](https://github.com/amckie), [Oscar Sanchez S. (@oscarssanchez)](https://github.com/oscarssanchez), [Thorsten Ott (@tott)](https://github.com/tott), [Yazan Mufleh (@YMufleh)](https://github.com/YMufleh), [Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh), [Max Lyuchin (@cadic)](https://github.com/cadic), [Siddharth Thevaril (@Sidsector9)](https://github.com/Sidsector9), [Faisal Alvi (@faisal-alvi)](https://github.com/faisal-alvi), [Mend Renovate (@renovate)](https://github.com/apps/renovate), [Vijay Jayaseelan (@vjayaseelan90)](https://github.com/vjayaseelan90), [Fabian Kägy (@fabiankaegy)](https://github.com/fabiankaegy), [Peter Wilson (@peterwilsoncc)](https://github.com/peterwilsoncc).

## Libraries

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Sophi-driven pages outperform human curated pages by a significant margin and fr

## Requirements

* [WordPress](http://wordpress.org) 5.6+
* [WordPress](http://wordpress.org) 6.0+
* [PHP](https://php.net/) 7.4+
* [Sophi.io account](https://www.sophi.io/contact/) and related credentials to authorize and authenticate access within the plugin settings

Expand Down
23 changes: 12 additions & 11 deletions includes/blocks/site-automation-block/block.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
{
"title": "Site Automation",
"api_version": "1.0.1",
"text-domain": "sophi-wp",
"name": "sophi/site-automation-block",
"category": "sophi-blocks",
"attributes":{
"category": "sophi-blocks",
"attributes": {
"customTitle": {
"type" : "string"
"type": "string"
},
"pageName": {
"type" : "string"
"type": "string"
},
"widgetName": {
"type" : "string"
"type": "string"
},
"displayPostExcept": {
"type" : "boolean"
"type": "boolean"
},
"displayAuthor": {
"type" : "boolean"
"type": "boolean"
},
"displayPostDate": {
"type" : "boolean"
"type": "boolean"
},
"displayFeaturedImage": {
"type" : "boolean"
"type": "boolean"
},
"addLinkToFeaturedImage": {
"type" : "boolean"
"type": "boolean"
}
},
},
"editorScript": "file:../../../dist/blocks/site-automation-block/editor.js"
}
33 changes: 22 additions & 11 deletions includes/blocks/site-automation-block/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ const SiteAutomationBlockEdit = ({
}).then(
// eslint-disable-next-line consistent-return
(data) => {
if (!data.length) {
setMessage({
text: __('No posts returned.', 'sophi-wp'),
color: 'red',
});
}

// eslint-disable-next-line array-callback-return
data.forEach((item) => {
// If item is integer, it is a Post ID, that does not exist in the site.
Expand Down Expand Up @@ -131,17 +138,6 @@ const SiteAutomationBlockEdit = ({
},
);

if (notFoundPosts.length) {
setMessage({
text:
__(
`Please contact your Sophi.io account representative as the Sophi service is providing post IDs that are not valid on this site: `,
'sophi-wp',
) + notFoundPosts.join(', '),
color: 'red',
});
}

if (overridePostID !== '') {
// eslint-disable-next-line consistent-return
return updatedInnerBlocks;
Expand All @@ -150,10 +146,25 @@ const SiteAutomationBlockEdit = ({
if (updatedInnerBlocks.length) {
// Replace innerBlocks with the updated array.
setPostsFound(true);
setMessage({
text: '',
color: 'green',
});
replaceInnerBlocks(clientId, updatedInnerBlocks, false);
} else {
setPostsFound(false);
}

if (notFoundPosts.length) {
setMessage({
text:
__(
`Please contact your Sophi.io account representative as the Sophi service is providing post IDs that are not valid on this site: `,
'sophi-wp',
) + notFoundPosts.join(', '),
color: 'red',
});
}
};

const overridePost = async ({ ruleType, overridePostID, overrideExpiry, position }) => {
Expand Down
1 change: 1 addition & 0 deletions includes/blocks/sophi-page-list-item/block.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"title": "Sophi Recommended Post",
"api_version": "1.0.1",
"name": "sophi/page-list-item",
"attributes": {
"postUpdated": {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@globeandmail/sophi-for-wordpress",
"version": "1.2.1",
"version": "1.3.0",
"description": "WordPress VIP-compatible plugin for the Sophi.io Site Automation service.",
"homepage": "https://github.com/globeandmail/sophi-for-wordpress",
"bugs": {
Expand Down
28 changes: 27 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: 10up, sophidev
Tags: Sophi, Site Automation, Curator, Collector, AI, Artifical Intelligence, ML, Machine Learning, Content Curation
Tested up to: 6.0
Stable tag: 1.2.1
Stable tag: 1.3.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -149,6 +149,27 @@ The same [Privacy & Terms that govern The Globe and Mail](https://www.theglobean

== Changelog ==

= 1.3.0 - 2022-10-28 =
**Note that this version bumps the minimum WordPress version from 5.6 to 6.0 and adds an integration with the Sophi Override feature.**

* **Added:** Override feature to the Sophi Site Automation Block (props [@faisal-alvi](https://github.com/faisal-alvi), [@jeffpaul](https://github.com/jeffpaul), [@fabiankaegy](https://github.com/fabiankaegy), [@dkotter](https://github.com/dkotter), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#333](https://github.com/globeandmail/sophi-for-wordpress/pull/333), [#345](https://github.com/globeandmail/sophi-for-wordpress/pull/345)).
* **Added:** [GET] `/wp-json/sophi/v1/site-automation` WP REST endpoint to Get Posts from Site Automation (props [@faisal-alvi](https://github.com/faisal-alvi), [@jeffpaul](https://github.com/jeffpaul), [@fabiankaegy](https://github.com/fabiankaegy), [@dkotter](https://github.com/dkotter), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#333](https://github.com/globeandmail/sophi-for-wordpress/pull/333)).
* **Added:** [POST] `/wp-json/sophi/v1/site-automation-override` WP REST endpoint to Override the Posts for Site Automation (props [@faisal-alvi](https://github.com/faisal-alvi), [@jeffpaul](https://github.com/jeffpaul), [@fabiankaegy](https://github.com/fabiankaegy), [@dkotter](https://github.com/dkotter), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#333](https://github.com/globeandmail/sophi-for-wordpress/pull/333)).
* **Added:** `api_version` to the block JSON files (props [@faisal-alvi](https://github.com/faisal-alvi) via [#345](https://github.com/globeandmail/sophi-for-wordpress/pull/345)).
* **Added:** Display message when no posts are returned from Sophi Site Automation (props [@faisal-alvi](https://github.com/faisal-alvi) via [#345](https://github.com/globeandmail/sophi-for-wordpress/pull/345)).
* **Added:** Functionality to remove old error messages when posts are found (props [@faisal-alvi](https://github.com/faisal-alvi) via [#345](https://github.com/globeandmail/sophi-for-wordpress/pull/345)).
* **Added:** Tracker Address option on plugin settings page (props [@faisal-alvi](https://github.com/faisal-alvi), [@YMufleh](https://github.com/YMufleh), [@jeffpaul](https://github.com/jeffpaul) via [#342](https://github.com/globeandmail/sophi-for-wordpress/pull/342)).
* **Added:** New tutorial for modifying tracking data on documentation site (props [@iamdharmesh](https://github.com/iamdharmesh), [@YMufleh](https://github.com/YMufleh), [@dkotter](https://github.com/dkotter) via [#327](https://github.com/globeandmail/sophi-for-wordpress/pull/327)).
* **Changed:** Bump minimum WordPress version from 5.6 to 6.0 (props [@faisal-alvi](https://github.com/faisal-alvi) via [#346](https://github.com/globeandmail/sophi-for-wordpress/pull/346)).
* **Changed:** Sophi Site Automation Block from a server-side-rendered custom block to a nested block (props [@faisal-alvi](https://github.com/faisal-alvi), [@jeffpaul](https://github.com/jeffpaul), [@fabiankaegy](https://github.com/fabiankaegy), [@dkotter](https://github.com/dkotter), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#333](https://github.com/globeandmail/sophi-for-wordpress/pull/333), [#345](https://github.com/globeandmail/sophi-for-wordpress/pull/345)).
* **Changed:** Replaced hardcoded tracker endpoint value with the new Tracker Address setting (props [@faisal-alvi](https://github.com/faisal-alvi), [@YMufleh](https://github.com/YMufleh), [@jeffpaul](https://github.com/jeffpaul) via [#342](https://github.com/globeandmail/sophi-for-wordpress/pull/342)).
* **Changed:** Developer Documentation updates (props [@iamdharmesh](https://github.com/iamdharmesh), [@jeffpaul](https://github.com/jeffpaul), [@faisal-alvi](https://github.com/faisal-alvi) via [#332](https://github.com/globeandmail/sophi-for-wordpress/pull/332), [#333](https://github.com/globeandmail/sophi-for-wordpress/pull/333)).
* **Fixed:** Prevent duplicate CMS publish/update event tracking (props [@cadic](https://github.com/cadic), [@peterwilsoncc](https://github.com/peterwilsoncc), [@jeffpaul](https://github.com/jeffpaul) via [#335](https://github.com/globeandmail/sophi-for-wordpress/pull/335)).
* **Security:** Added latest PHPCompatibility checks for PHP 8.0 (props [@Sidsector9](https://github.com/Sidsector9) via [#331](https://github.com/globeandmail/sophi-for-wordpress/pull/331)).
* **Security:** Update dependency `phpunit/phpunit` from 8.5.29 to 9.5.25 (props [@renovate](https://github.com/apps/renovate), [@Sidsector9](https://github.com/Sidsector9), [@faisal-alvi](https://github.com/faisal-alvi) via [#329](https://github.com/globeandmail/sophi-for-wordpress/pull/329), [#337](https://github.com/globeandmail/sophi-for-wordpress/pull/337), [#339](https://github.com/globeandmail/sophi-for-wordpress/pull/339)).
* **Security:** Update dependency `10up-toolkit` from 4.1.2 to 4.3.0 (props [@renovate](https://github.com/apps/renovate), [@Sidsector9](https://github.com/Sidsector9), [@faisal-alvi](https://github.com/faisal-alvi) via [#330](https://github.com/globeandmail/sophi-for-wordpress/pull/330), [#340](https://github.com/globeandmail/sophi-for-wordpress/pull/340)).
* **Security:** Update `actions/checkout` action from v2 to v3 and v3.0.2 to v3.1.0 (props [@renovate](https://github.com/apps/renovate) via [#334](https://github.com/globeandmail/sophi-for-wordpress/pull/334)).

= 1.2.1 - 2022-08-30 =
* **Changed:** Bump `content_update` schema from 2-0-3 to 2-0-5 (props [@jeffpaul](https://github.com/jeffpaul), [@vjayaseelan90](https://github.com/vjayaseelan90), [@YMufleh](https://github.com/YMufleh) via [#323](https://github.com/globeandmail/sophi-for-wordpress/pull/323)).
* **Security:** Update dependency `jsdoc` from 3.6.10 to 3.6.11 (props [@renovate](https://github.com/apps/renovate) via [#311](https://github.com/globeandmail/sophi-for-wordpress/pull/311)).
Expand Down Expand Up @@ -303,3 +324,8 @@ Note: this was a hotfix release to fix an issue with deploys to WordPress.org.

= 1.0.0 - 2021-04-14 =
* Initial public release! 🎉

== Upgrade Notice ==

= 1.3.0 =
This version bumps the minimum WordPress version from 5.6 to 6.0 and adds an integration with the Sophi Override feature.
6 changes: 3 additions & 3 deletions sophi.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Plugin Name: Sophi
* Plugin URI: https://github.com/globeandmail/sophi-for-wordpress
* Description: WordPress VIP-compatible plugin for the Sophi.io Site Automation service.
* Version: 1.2.2-dev
* Requires at least: 5.6
* Version: 1.3.1-dev
* Requires at least: 6.0
* Requires PHP: 7.4
* Author: 10up
* Author URI: https://10up.com
Expand All @@ -16,7 +16,7 @@
*/

// Useful global constants.
define( 'SOPHI_WP_VERSION', '1.2.1' );
define( 'SOPHI_WP_VERSION', '1.3.0' );
define( 'SOPHI_WP_URL', plugin_dir_url( __FILE__ ) );
define( 'SOPHI_WP_PATH', plugin_dir_path( __FILE__ ) );
define( 'SOPHI_WP_INC', SOPHI_WP_PATH . 'includes/' );
Expand Down

0 comments on commit f49e96e

Please sign in to comment.