From fe01287a8fabe2097d0d8b6acef0a68786fc1495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valenti=CC=81n=20Garci=CC=81a?= Date: Tue, 12 Oct 2021 14:48:01 -0500 Subject: [PATCH 1/6] Fix skip the comply of requirements when "Include pre-publish checklist" is disabled --- modules/checklists/assets/js/meta-box.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/checklists/assets/js/meta-box.js b/modules/checklists/assets/js/meta-box.js index e9238605..42bdfa75 100755 --- a/modules/checklists/assets/js/meta-box.js +++ b/modules/checklists/assets/js/meta-box.js @@ -672,6 +672,18 @@ }); } + // Disable first save button until requirements are meet when "Include pre-publish checklist" is disabled + if (PP_Checklists.is_gutenberg_active()) { + $(document).on(PP_Checklists.EVENT_TIC, function (event) { + var has_unchecked = $('#pp-checklists-req-box').children('.status-no'); + if (has_unchecked.length > 0) { + wp.data.dispatch( 'core/editor' ).lockPostSaving( 'ppcPublishButton' ); + } else { + wp.data.dispatch( 'core/editor' ).unlockPostSaving( 'ppcPublishButton' ); + } + }); + } + /*---------- Featured Image ----------*/ if ($('#pp-checklists-req-featured_image').length > 0) { From 8dd972fb33f3555ba0b3e9d6d351c1c8c8e13db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valenti=CC=81n=20Garci=CC=81a?= Date: Wed, 13 Oct 2021 12:23:02 -0500 Subject: [PATCH 2/6] Move configure link HTML for metabox to JS --- modules/checklists/assets/js/meta-box.js | 9 +++++++++ modules/checklists/checklists.php | 15 +++------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/checklists/assets/js/meta-box.js b/modules/checklists/assets/js/meta-box.js index e9238605..a9d3f2ad 100755 --- a/modules/checklists/assets/js/meta-box.js +++ b/modules/checklists/assets/js/meta-box.js @@ -1357,6 +1357,15 @@ update(); } + /*---------- Configure link for Checklist metabox ----------*/ + if (ppChecklists.user_can_manage_options == 1 && $('#pp_checklist_meta').length) { + var ppChecklistMetaboxLabel = $('#pp_checklist_meta').find('h2.hndle').val(); + $('#pp_checklist_meta').find('h2.hndle').append( + ppChecklistMetaboxLabel + + '' + ppChecklists.label_configure + '' + ); + } + /** * * @type {Object} diff --git a/modules/checklists/checklists.php b/modules/checklists/checklists.php index ae08e988..0dcdd56a 100755 --- a/modules/checklists/checklists.php +++ b/modules/checklists/checklists.php @@ -596,18 +596,6 @@ public function handle_post_meta_boxes() $title = __('Checklist', 'publishpress-checklists'); - if (current_user_can('manage_options')) { - // Make the meta box title include a link to edit the Editorial Metadata terms. Logic similar to how Core dashboard widgets work. - $url = $this->get_admin_link(); - - $title .= ' ' . __( - 'Configure', - 'publishpress-checklists' - ) . ''; - } - $supported_post_types = $this->getSelectedPostTypes(); foreach ($supported_post_types as $post_type => $label) { @@ -663,6 +651,7 @@ public function display_meta_box($post) [ 'requirements' => $new_requirements_array, 'label_checklist' => __('Checklist', 'publishpress-checklists'), + 'label_configure' => __('Configure', 'publishpress-checklists'), 'msg_missed_optional_publishing' => __( 'Are you sure you want to publish anyway?', 'publishpress-checklists' @@ -690,6 +679,8 @@ public function display_meta_box($post) 'show_warning_icon_submit' => Base_requirement::VALUE_YES === $legacyPlugin->settings->module->options->show_warning_icon_submit, 'title_warning_icon' => __('One or more items in the checklist are not completed'), 'is_gutenberg_active' => $this->is_gutenberg_active(), + 'user_can_manage_options' => current_user_can( 'manage_options' ), + 'configure_url' => esc_url( $this->get_admin_link() ), ] ); From 4281790e272de95be6950cf9a57b38075fcece2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valenti=CC=81n=20Garci=CC=81a?= Date: Wed, 10 Nov 2021 13:57:09 -0600 Subject: [PATCH 3/6] Increase version --- includes.php | 3 +-- publishpress-checklists.php | 2 +- readme.txt | 29 ++++++++++++++++------------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/includes.php b/includes.php index 02d4a1d3..dd75302d 100755 --- a/includes.php +++ b/includes.php @@ -13,7 +13,7 @@ if (!defined('PPCH_LOADED')) { define('PPCH_PATH_BASE', plugin_dir_path(__FILE__)); - define('PPCH_VERSION', '2.5.0'); + define('PPCH_VERSION', '2.6.1b1'); define('PPCH_FILE', __DIR__ . '/publishpress-checklists.php'); define('PPCH_MODULES_PATH', PPCH_PATH_BASE . '/modules'); define('PPCH_RELATIVE_PATH', 'publishpress-checklists'); @@ -23,4 +23,3 @@ require_once PPCH_PATH_BASE . '/vendor/autoload.php'; } } - diff --git a/publishpress-checklists.php b/publishpress-checklists.php index 804f6b29..033f0482 100644 --- a/publishpress-checklists.php +++ b/publishpress-checklists.php @@ -12,7 +12,7 @@ * @publishpress-checklists * Plugin Name: PublishPress Checklists * Plugin URI: https://publishpress.com/ - * Version: 2.5.0 + * Version: 2.6.1b1 * Description: Add support for checklists in WordPress * Author: PublishPress * Author URI: https://publishpress.com diff --git a/readme.txt b/readme.txt index 79bdbc41..ffbd181e 100755 --- a/readme.txt +++ b/readme.txt @@ -7,7 +7,7 @@ Tags: approval, checklist, maximum, minimum, requirement Requires at least: 4.7 Requires PHP: 5.6 Tested up to: 5.8 -Stable tag: 2.5.0 +Stable tag: 2.6.1b1 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -32,7 +32,7 @@ Next to every post and page, writers see a checklist box, showing the tasks they ## You Can Set These Checklist Requirements -Each task on your pre-publish checklist can be configured to meet your site’s needs. You can also set maximum and minimum values. +Each task on your pre-publish checklist can be configured to meet your site’s needs. You can also set maximum and minimum values. [Read the Getting Started guide for PublishPress Checklists](https://publishpress.com/knowledge-base/checklists-started/). @@ -108,7 +108,7 @@ Join PublishPress and you'll get access to these Pro plugins: * [PublishPress Permissions Pro](https://publishpress.com/permissions) is the plugin for advanced WordPress permissions. * [PublishPress Pro](https://publishpress.com/publishpress) is the plugin for managing and scheduling WordPress content. * [PublishPress Revisions Pro](https://publishpress.com/revisions) allows you to update your published pages with teamwork and precision. -* [PublishPress Series Pro](https://publishpress.com/series) enables you to group content together into a series +* [PublishPress Series Pro](https://publishpress.com/series) enables you to group content together into a series Together, these plugins are a suite of powerful publishing tools for WordPress. If you need to create a professional workflow in WordPress, with moderation, revisions, permissions and more... then you should try PublishPress. @@ -123,8 +123,8 @@ Follow PublishPress on [Facebook](https://www.facebook.com/publishpress), [Twitt == Screenshots == 1. Create your own checklists: Next to every post and page, writers see a checklist box, showing the tasks they need to complete. -2. Custom checklist rules: In addition to the default rules, PublishPress Checklists allows you to create your own rules. -3. Configure your requirements: Each item on the checklist can be configured to meet your site’s needs. You can decide whether items are recommended, required or ignored. +2. Custom checklist rules: In addition to the default rules, PublishPress Checklists allows you to create your own rules. +3. Configure your requirements: Each item on the checklist can be configured to meet your site’s needs. You can decide whether items are recommended, required or ignored. 4. Feedback before publishing: If the writers don’t complete all the requirements, PublishPress Checklists will show them a message explaining what they need to do. 5. WooCommerce products checklist: This feature in Checklists Pro allows you to create requirements for WooCommerce products. @@ -159,7 +159,7 @@ With the PublishPress Checklists plugin, you can require a maximum and minimum n With the PublishPress Checklists plugin, you can require a maximum and minimum number of categories for your WordPress posts. If the correct number of categories aren't added, you can choose to show a warning, or prevent the post from being published. Having the correct number of categories is important for your site's SEO. By default, Categories are only available on WordPress Posts. However, with the "TaxoPress" plugin you can add Categories to other post types and so you will be able to use the tutorial for those post types too. -* Go to Checklists > Settings. +* Go to Checklists > Settings. * You can choose from “Disabled, Recommended, or Required” options. * You can choose “Who can ignore this task?“ * You can enter choices for “Min” and “Max”. @@ -169,7 +169,7 @@ With the PublishPress Checklists plugin, you can require a maximum and minimum n = Can I set the maximum and minimum number of tags? = -With the PublishPress Checklists plugin, you can require a maximum and minimum number of tags for your WordPress posts. This feature also supports taxonomy terms from other plugins or custom post types. If the correct number of tags aren't added, you can choose to show a warning, or prevent the post from being published. Having the correct number of tags is important for your site's SEO. +With the PublishPress Checklists plugin, you can require a maximum and minimum number of tags for your WordPress posts. This feature also supports taxonomy terms from other plugins or custom post types. If the correct number of tags aren't added, you can choose to show a warning, or prevent the post from being published. Having the correct number of tags is important for your site's SEO. * Go to Checklists > Settings. If you are using a custom post type or plugin, any available taxonomies will show as options. * You can choose from “Disabled, Recommended, or Required” options. @@ -183,7 +183,7 @@ With the PublishPress Checklists plugin, you can require a maximum and minimum n With the PublishPress Checklists plugin, you can require a maximum and minimum number of characters for the Excerpts in your WordPress content. If the Excerpt isn't the correct length, you can choose to show a warning, or prevent the post from being published. The Excerpt field is a very useful feature in WordPress. The Excerpt is an optional summary or description of the main content. -* Go to Checklists > Settings. +* Go to Checklists > Settings. * You can choose from “Disabled, Recommended, or Required” options. * You can choose “Who can ignore this task?“ * You can enter choices for “Min” and “Max”. @@ -207,7 +207,7 @@ With the PublishPress Checklists plugin, you can require a maximum and minimum n With the PublishPress Checklists plugin, you can require a maximum and minimum number of external links in your WordPress content. If the content does not have the correct number of external links, you can choose to show a warning, or prevent the post from being published. We define “external links” as any "a href" link to URL on another website. Many sites want to prevent a large number of external links because it can harm their site's search engine optimization. -* Go to Checklists > Settings. +* Go to Checklists > Settings. * You can choose from “Disabled, Recommended, or Required” options. * You can choose “Who can ignore this task?“ * You can enter choices for “Min” and “Max”. @@ -220,12 +220,12 @@ With the PublishPress Checklists plugin, you can require a maximum and minimum n With the PublishPress Checklists plugin, you can ensure that all the links in your content (both external and internal) use a valid link format. This feature won't check the destination URL, but it will check the link format to make sure you haven't used URLs such as htpps// or .nt. -* Go to Checklists > Settings. +* Go to Checklists > Settings. * You can choose from “Disabled, Recommended, or Required” options. * You can choose “Who can ignore this task?“ * If you enable this link validation option, it will be visible when you edit content. If you have broken links in your content, this task will be marked in red in the sidebar. If you do not have broken links, this task will be marked in green in the sidebar. -The Checklists plugin uses these regular expressions to check for broken links. You will find this code in this file: /core/Utils/HyperlinkValidator.php. +The Checklists plugin uses these regular expressions to check for broken links. You will find this code in this file: /core/Utils/HyperlinkValidator.php. [Read about validating links](https://publishpress.com/knowledge-base/all-links-use-a-valid-format/) @@ -233,7 +233,7 @@ The Checklists plugin uses these regular expressions to check for broken links. With the PublishPress Checklists plugin, you can require that all the images have ALT text in your WordPress content. If an image is missing the ALT text, you can choose to show a warning, or prevent the post from being published. ALT text (short for “alternative text”) is useful because it describes images to visitors who are unable to see them. Visually impaired users often use screen readers that can read ALT text to better understand an on-page image. -* Go to Checklists > Settings. +* Go to Checklists > Settings. * You can choose from “Disabled, Recommended, or Required” options. * You can choose “Who can ignore this task?“ * You can enter choices for “Min” and “Max”. @@ -271,7 +271,7 @@ With the PublishPress Checklists plugin, you can require that site's content mee * You can choose from “Disabled, Recommended, or Required” options. * You can choose “Who can ignore this task?“ * You can enter choices for both options. Choose either “OK” (yellow/orange) or “Good” (green). -* If you enable the Yoast SEO option, they will be visible when you edit content. If you don't meet the minimum requirements, the checklist items will be shown in red. +* If you enable the Yoast SEO option, they will be visible when you edit content. If you don't meet the minimum requirements, the checklist items will be shown in red. [Read about requiring approval by Yoast SEO](https://publishpress.com/knowledge-base/yoast-seo-tasks/) @@ -281,6 +281,9 @@ With the PublishPress Checklists plugin, you can require that site's content mee The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). += [2.6.1] - 2021-11-10 = + * Fixed: Skip the comply of requirements when "Include pre-publish checklist" is disabled + = [2.5.0] - 2021-04-22 = * Added: Added drag-and-drop support for sorting the checklists requirements, #172; From 68a7c0d7718a3f73a7f40efe55222ecb48a6af36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valenti=CC=81n=20Garci=CC=81a?= Date: Wed, 10 Nov 2021 14:04:38 -0600 Subject: [PATCH 4/6] Update readme.txt --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index ffbd181e..f7b2efb4 100755 --- a/readme.txt +++ b/readme.txt @@ -283,6 +283,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). = [2.6.1] - 2021-11-10 = * Fixed: Skip the comply of requirements when "Include pre-publish checklist" is disabled + * Fixed: Preferences Panel box is broken = [2.5.0] - 2021-04-22 = From 7ed766cddcfa56be6d451015139f07fe1d70d712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valenti=CC=81n=20Garci=CC=81a?= Date: Wed, 10 Nov 2021 14:25:30 -0600 Subject: [PATCH 5/6] Increase version --- includes.php | 2 +- publishpress-checklists.php | 2 +- readme.txt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes.php b/includes.php index dd75302d..9d325e49 100755 --- a/includes.php +++ b/includes.php @@ -13,7 +13,7 @@ if (!defined('PPCH_LOADED')) { define('PPCH_PATH_BASE', plugin_dir_path(__FILE__)); - define('PPCH_VERSION', '2.6.1b1'); + define('PPCH_VERSION', '2.6.1'); define('PPCH_FILE', __DIR__ . '/publishpress-checklists.php'); define('PPCH_MODULES_PATH', PPCH_PATH_BASE . '/modules'); define('PPCH_RELATIVE_PATH', 'publishpress-checklists'); diff --git a/publishpress-checklists.php b/publishpress-checklists.php index 033f0482..02fe7f07 100644 --- a/publishpress-checklists.php +++ b/publishpress-checklists.php @@ -12,7 +12,7 @@ * @publishpress-checklists * Plugin Name: PublishPress Checklists * Plugin URI: https://publishpress.com/ - * Version: 2.6.1b1 + * Version: 2.6.1 * Description: Add support for checklists in WordPress * Author: PublishPress * Author URI: https://publishpress.com diff --git a/readme.txt b/readme.txt index f7b2efb4..bc916634 100755 --- a/readme.txt +++ b/readme.txt @@ -6,8 +6,8 @@ Author URI: https://publishpress.com Tags: approval, checklist, maximum, minimum, requirement Requires at least: 4.7 Requires PHP: 5.6 -Tested up to: 5.8 -Stable tag: 2.6.1b1 +Tested up to: 5.8.2 +Stable tag: 2.6.1 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html From 6026061d882db5afa15ff766cbd7094116b3a372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valenti=CC=81n=20Garci=CC=81a?= Date: Wed, 10 Nov 2021 14:49:05 -0600 Subject: [PATCH 6/6] Update pp plugin builder version --- composer.json | 2 +- composer.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 5b4e13fd..8d105fba 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ "publishpress/wordpress-reviews": "^1.1" }, "require-dev": { - "publishpress/publishpress-plugin-builder": "^1.2", + "publishpress/publishpress-plugin-builder": "^1.3", "publishpress/wp-browser": "2.6.5.2", "codeception/module-asserts": "^1.2", "codeception/module-phpbrowser": "^1.0", diff --git a/composer.lock b/composer.lock index 906faf73..2020e2c0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e0e8e95f19cb83cadb02c1c5f1cb557d", + "content-hash": "07796ff50a3ec98f191ec44fb9a3d673", "packages": [ { "name": "pimple/pimple",