From 8ab60c080c2a31e116528b6c3e019ec045790584 Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 10:43:04 -0500 Subject: [PATCH 01/66] Leverage is_dt_debug() for logging image sideload issues. --- README.md | 2 ++ includes/utils.php | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/README.md b/README.md index 9ba919be8..2bd099715 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,8 @@ The plugin contains a standard test suite compatible with PHPUnit. If you want t You can define a constant `DISTRIBUTOR_DEBUG` to `true` to increase the ease of debugging in Distributor. This will make all remote requests blocking and expose the subscription post type. +Enabling this will also provide needed debug information in your error log for Image side loading issues. + ### Work with us diff --git a/includes/utils.php b/includes/utils.php index 5820f5959..c6cebbc8c 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -648,12 +648,24 @@ function process_media( $url, $post_id ) { // If error storing temporarily, return the error. if ( is_wp_error( $file_array['tmp_name'] ) ) { + + // Distributor is in debug mode, display the issue, could be storage related. + if ( is_dt_debug() ) { + error_log( sprintf( "Distributor: %s", $file_array['tmp_name']->get_error_message() ) ); + } + return false; } // Do the validation and storage stuff. $result = media_handle_sideload( $file_array, $post_id ); if ( is_wp_error( $result ) ) { + + // Distributor is in debug mode, display the issue, could be storage related. + if ( is_dt_debug() ) { + error_log( sprintf( "Distributor: %s", $file_array['tmp_name']->get_error_message() ) ); + } + return false; } return (int) $result; From b72137b281e381ad4a644b9ebe19b1e00c02bbcc Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 11:09:46 -0500 Subject: [PATCH 02/66] Use single quotes for string --- includes/utils.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/utils.php b/includes/utils.php index c6cebbc8c..f85406105 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -651,7 +651,7 @@ function process_media( $url, $post_id ) { // Distributor is in debug mode, display the issue, could be storage related. if ( is_dt_debug() ) { - error_log( sprintf( "Distributor: %s", $file_array['tmp_name']->get_error_message() ) ); + error_log( sprintf( 'Distributor: %s', $file_array['tmp_name']->get_error_message() ) ); } return false; @@ -663,7 +663,7 @@ function process_media( $url, $post_id ) { // Distributor is in debug mode, display the issue, could be storage related. if ( is_dt_debug() ) { - error_log( sprintf( "Distributor: %s", $file_array['tmp_name']->get_error_message() ) ); + error_log( sprintf( 'Distributor: %s', $file_array['tmp_name']->get_error_message() ) ); } return false; From 6f53dfa87cd2607498aaf0ac14c0d42bee4eaa6f Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 20:46:08 -0500 Subject: [PATCH 03/66] Clean up distributed-post-ui.php file. --- includes/distributed-post-ui.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/includes/distributed-post-ui.php b/includes/distributed-post-ui.php index 496c786f9..b4f3168c6 100644 --- a/includes/distributed-post-ui.php +++ b/includes/distributed-post-ui.php @@ -33,11 +33,14 @@ function add_help_tab() { return; } - if ( empty( $_GET['post'] ) ) { + if ( empty( $_GET['post'] ) ) { // @codingStandardsIgnoreLine Nonce validation not necessary here. return; } - $connection_map = get_post_meta( intval( $_GET['post'] ), 'dt_connection_map', true ); + // Set a post ID variable here for use a few times. + $post_id = intval( $_GET['post'] ); // @codingStandardsIgnoreLine Nonce not necessary, simply type-casting data here from the admin. + + $connection_map = get_post_meta( $post_id, 'dt_connection_map', true ); if ( empty( $connection_map ) ) { return; @@ -45,13 +48,14 @@ function add_help_tab() { $screen = get_current_screen(); - $post_type_object = get_post_type_object( get_post_type( $_GET['post'] ) ); + $post_type_object = get_post_type_object( get_post_type( $post_id ) ); // Add my_help_tab if current screen is My Admin Page $screen->add_help_tab( array( 'id' => 'distributer', 'title' => esc_html__( 'Distributor', 'distributor' ), + /* translators: %1$s: Post type singular name, %2$s: Post type singular name, %3$s: Pos type name */ 'content' => '

' . sprintf( esc_html__( 'The number of connections this %1$s has been distributed to is shown in the publish meta box. If this %2$s is deleted, it could have ramifications across all those %3$s.', 'distributor' ), esc_html( strtolower( $post_type_object->labels->singular_name ) ), esc_html( strtolower( $post_type_object->labels->singular_name ) ), esc_html( strtolower( $post_type_object->labels->name ) ) ) . '

', ) ); @@ -60,7 +64,7 @@ function add_help_tab() { /** * Output distributed to number * - * @param WP_Post $post Post object. + * @param \WP_Post $post Post object. * @since 0.8 */ function distributed_to( $post ) { @@ -83,6 +87,7 @@ function distributed_to( $post ) {
+ %d connection', 'Distributed to %d connections', (int) $total_connections, 'distributor' ) ), (int) $total_connections ); ?> (?) From cb3b841c842c7f2eb7a28d2f341de88e42552871 Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 20:53:16 -0500 Subject: [PATCH 04/66] Clean up pull-ui.php file. --- includes/pull-ui.php | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/includes/pull-ui.php b/includes/pull-ui.php index b77cf5e31..de25f5bde 100644 --- a/includes/pull-ui.php +++ b/includes/pull-ui.php @@ -66,7 +66,7 @@ function setup_list_table() { $internal_connection = new \Distributor\InternalConnections\NetworkSiteConnection( $site_array['site'] ); $connection_list_table->connection_objects[] = $internal_connection; - if ( ! empty( $_GET['connection_id'] ) && ! empty( $_GET['connection_type'] ) && 'internal' === $_GET['connection_type'] && (int) $internal_connection->site->blog_id === (int) $_GET['connection_id'] ) { + if ( ! empty( $_GET['connection_id'] ) && ! empty( $_GET['connection_type'] ) && 'internal' === $_GET['connection_type'] && (int) $internal_connection->site->blog_id === (int) $_GET['connection_id'] ) { // @codingStandardsIgnoreLine Content is type casted, no need for nonce. $connection_now = $internal_connection; } } @@ -90,7 +90,7 @@ function setup_list_table() { if ( ! is_wp_error( $external_connection ) ) { $connection_list_table->connection_objects[] = $external_connection; - if ( ! empty( $_GET['connection_id'] ) && ! empty( $_GET['connection_type'] ) && 'external' === $_GET['connection_type'] && (int) $external_connection_id === (int) $_GET['connection_id'] ) { + if ( ! empty( $_GET['connection_id'] ) && ! empty( $_GET['connection_type'] ) && 'external' === $_GET['connection_type'] && (int) $external_connection_id === (int) $_GET['connection_id'] ) { // @codingStandardsIgnoreLine Content is type casted, no need for nonce. $connection_now = $external_connection; } } @@ -110,7 +110,7 @@ function setup_list_table() { * @since 0.8 */ function admin_enqueue_scripts( $hook ) { - if ( 'distributor_page_pull' !== $hook || empty( $_GET['page'] ) || 'pull' !== $_GET['page'] ) { + if ( 'distributor_page_pull' !== $hook || empty( $_GET['page'] ) || 'pull' !== $_GET['page'] ) { // @codingStandardsIgnoreLine Comparing values, not using them. return; } @@ -250,9 +250,7 @@ function( $remote_post_id ) use ( $post_type ) { } wp_safe_redirect( wp_get_referer() ); - exit; - - break; + exit; // No need to break here, exit does the job. case 'bulk-skip': case 'skip': if ( ! wp_verify_nonce( $_GET['_wpnonce'], 'dt_skip' ) && ! wp_verify_nonce( $_GET['_wpnonce'], 'bulk-distributor_page_pull' ) ) { @@ -294,9 +292,7 @@ function( $remote_post_id ) use ( $post_type ) { setcookie( 'dt-skipped', 1, time() + DAY_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, is_ssl() ); wp_safe_redirect( wp_get_referer() ); - exit; - - break; + exit; // No need to break here, exit does the job. } } @@ -397,8 +393,8 @@ function dashboard() { // This is either from a query param, "post" post type, or the first in the list $connection_now->pull_post_type = $connection_now->pull_post_types[0]['slug']; foreach ( $connection_now->pull_post_types as $post_type ) { - if ( isset( $_GET['pull_post_type'] ) ) { - if ( $_GET['pull_post_type'] === $post_type['slug'] ) { + if ( isset( $_GET['pull_post_type'] ) ) { // @codingStandardsIgnoreLine No nonce needed here. + if ( $_GET['pull_post_type'] === $post_type['slug'] ) { // @codingStandardsIgnoreLine Comparing values, no nonce needed. $connection_now->pull_post_type = $post_type['slug']; break; } @@ -439,7 +435,7 @@ function dashboard() { views(); ?> -
+ connection_objects ) ) : ?> From 2baa9e3356edcce6a68a4b46203e4954e94a7be1 Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 21:00:38 -0500 Subject: [PATCH 05/66] When using namespaces, docblocks should respect that. --- includes/utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/utils.php b/includes/utils.php index 5820f5959..95eb80a42 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -558,7 +558,7 @@ function set_media( $post_id, $media ) { /** * This is a helper function for transporting/formatting data about a media post * - * @param WP_Post $media_post Media post. + * @param \WP_Post $media_post Media post. * @since 1.0 * @return array */ From 05883e3f8fda0cf56a275e94fa7bf0e3f910ed73 Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 21:02:38 -0500 Subject: [PATCH 06/66] Clean up utils.php --- includes/utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/utils.php b/includes/utils.php index 95eb80a42..8ae297135 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -493,7 +493,7 @@ function set_media( $post_id, $media ) { $featured_keys = wp_list_pluck( $media, 'featured' ); // Note: this is not a strict search because of issues with typecasting in some setups - $featured_key = array_search( true, $featured_keys ); + $featured_key = array_search( true, $featured_keys ); // @codingStandardsIgnoreLine Ignore strict search requirement. $media = ( false !== $featured_key ) ? array( $media[ $featured_key ] ) : array(); } From 6cde8740422d63bc32fba401343ab7b3e0f0387c Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 21:07:29 -0500 Subject: [PATCH 07/66] Create var for post ID, ignore nonce requirement for value, fix return. --- includes/syndicated-post-ui.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/includes/syndicated-post-ui.php b/includes/syndicated-post-ui.php index 4b22b6af9..20c0c2bcf 100644 --- a/includes/syndicated-post-ui.php +++ b/includes/syndicated-post-ui.php @@ -140,22 +140,25 @@ function add_linked_class( $classes ) { global $post, $pagenow; if ( 'post.php' !== $pagenow && 'post-new.php' !== $pagenow ) { - return; + return ''; // Must stick to docblock, cannot return void. } - if ( empty( $_GET['post'] ) ) { + if ( empty( $_GET['post'] ) ) { // @codingStandardsIgnoreLine No nonce needed. return $classes; } - $original_blog_id = get_post_meta( intval( $_GET['post'] ), 'dt_original_blog_id', true ); - $original_source_id = get_post_meta( intval( $_GET['post'] ), 'dt_original_source_id', true ); - $original_post_id = get_post_meta( intval( $_GET['post'] ), 'dt_original_post_id', true ); + // Create a var since it will be used multiple times. + $current_post_id = intval( $_GET['post'] ); // @codingStandardsIgnoreLine No nonce needed. + + $original_blog_id = get_post_meta( $current_post_id, 'dt_original_blog_id', true ); + $original_source_id = get_post_meta( $current_post_id, 'dt_original_source_id', true ); + $original_post_id = get_post_meta( $current_post_id, 'dt_original_post_id', true ); if ( empty( $original_post_id ) || ( empty( $original_blog_id ) && empty( $original_source_id ) ) ) { return $classes; } - $unlinked = (bool) get_post_meta( intval( $_GET['post'] ), 'dt_unlinked', true ); + $unlinked = (bool) get_post_meta( $current_post_id, 'dt_unlinked', true ); $original_deleted = (bool) get_post_meta( $post->ID, 'dt_original_post_deleted', true ); if ( $unlinked || $original_deleted ) { From 9f6f30b94570e5db3f12d7b9359aee163ea0fac4 Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 21:19:53 -0500 Subject: [PATCH 08/66] Clean up syndicated-post-ui.php --- includes/syndicated-post-ui.php | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/includes/syndicated-post-ui.php b/includes/syndicated-post-ui.php index 20c0c2bcf..0ef6c7c6f 100644 --- a/includes/syndicated-post-ui.php +++ b/includes/syndicated-post-ui.php @@ -234,7 +234,10 @@ function new_revisions_meta_box( $post_id ) { $post_type = get_post_type_object( get_post_type( $post_id ) ); ?>

- labels->name ) ) ); ?> + labels->name ) ) ); + ?>

- %3$s. However, the original has been deleted.', 'distributor' ), esc_html( strtolower( $post_type_singular ) ), esc_url( $post_url ), esc_html( $original_location_name ) ) ); ?> + %3$s. However, the original has been deleted.', 'distributor' ), esc_html( strtolower( $post_type_singular ) ), esc_url( $post_url ), esc_html( $original_location_name ) ) ); + ?>

- %2$s.', 'distributor' ), esc_url( $post_url ), esc_html( $original_location_name ) ) ); ?> + %2$s.', 'distributor' ), esc_url( $post_url ), esc_html( $original_location_name ) ) ); + ?> ID ) ) : ?> + unlink from the original.', 'distributor' ), esc_html( strtolower( $post_type_singular ) ), wp_nonce_url( add_query_arg( 'action', 'unlink', admin_url( sprintf( $post_type_object->_edit_link, $post->ID ) ) ), "unlink-post_{$post->ID}" ) ) ); ?>

+ %1$s.', 'distributor' ), esc_url( $post_url ), esc_html( $original_location_name ) ) ); ?> + restore it.", 'distributor' ), esc_html( strtolower( $post_type_singular ) ), wp_nonce_url( add_query_arg( 'action', 'link', admin_url( sprintf( $post_type_object->_edit_link, $post->ID ) ) ), "link-post_{$post->ID}" ) ) ); ?>

@@ -521,6 +534,7 @@ function enqueue_gutenberg_edit_scripts() { restore_current_blog(); if ( empty( $original_location_name ) ) { + /* translators: %d: the original blog id */ $original_location_name = sprintf( esc_html__( 'Blog #%d', 'distributor' ), $original_blog_id ); } } else { From f4c7cf3865167fb2a2dc41b315eaa6b1b5c61c97 Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 21:22:57 -0500 Subject: [PATCH 09/66] When using namespaces, docblocks must also respect namespacing. --- includes/syndicated-post-ui.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/syndicated-post-ui.php b/includes/syndicated-post-ui.php index 0ef6c7c6f..cc2db76fe 100644 --- a/includes/syndicated-post-ui.php +++ b/includes/syndicated-post-ui.php @@ -99,7 +99,7 @@ function output_distributor_column( $column_name, $post_id ) { * Remove quick edit for linked posts * * @param array $actions Array of current actions - * @param WP_Post $post Post object + * @param \WP_Post $post Post object * @since 0.8 * @return array */ @@ -171,7 +171,7 @@ function add_linked_class( $classes ) { /** * Output syndicated on date * - * @param WP_Post $post Post object + * @param \WP_Post $post Post object * @since 0.8 */ function syndication_date( $post ) { @@ -247,7 +247,7 @@ function new_revisions_meta_box( $post_id ) { * * @param string $post_type Post type * @param string $context Meta box context - * @param WP_Post $post Post object + * @param \WP_Post $post Post object * @since 1.0 */ function replace_revisions_meta_box( $post_type, $context, $post ) { @@ -395,7 +395,7 @@ function link() { /** * Show syndicated post message * - * @param WP_Post $post Post object. + * @param \WP_Post $post Post object. * @since 0.8 */ function syndicated_message( $post ) { From 6b2c3ab870be3740f55c0f6cc3e447b4c2726545 Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 21:26:09 -0500 Subject: [PATCH 10/66] Clean up doc parameter spacing for syndicated-post-ui.php --- includes/syndicated-post-ui.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/syndicated-post-ui.php b/includes/syndicated-post-ui.php index cc2db76fe..87aae3273 100644 --- a/includes/syndicated-post-ui.php +++ b/includes/syndicated-post-ui.php @@ -98,8 +98,9 @@ function output_distributor_column( $column_name, $post_id ) { /** * Remove quick edit for linked posts * - * @param array $actions Array of current actions + * @param array $actions Array of current actions * @param \WP_Post $post Post object + * * @since 0.8 * @return array */ @@ -245,9 +246,10 @@ function new_revisions_meta_box( $post_id ) { /** * Remove old revisions meta box * - * @param string $post_type Post type - * @param string $context Meta box context + * @param string $post_type Post type + * @param string $context Meta box context * @param \WP_Post $post Post object + * * @since 1.0 */ function replace_revisions_meta_box( $post_type, $context, $post ) { From 64b759154b7167eab9f694afb8f2158f69cca90e Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 21:40:11 -0500 Subject: [PATCH 11/66] Resolve almost all issues in PullListTable.php - rest need reviewed. --- includes/classes/PullListTable.php | 32 ++++++++++++++++-------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/includes/classes/PullListTable.php b/includes/classes/PullListTable.php index a104965bb..c650e40cd 100644 --- a/includes/classes/PullListTable.php +++ b/includes/classes/PullListTable.php @@ -85,7 +85,7 @@ public function get_sortable_columns() { */ protected function get_views() { - $current_status = ( empty( $_GET['status'] ) ) ? 'new' : sanitize_key( $_GET['status'] ); + $current_status = ( empty( $_GET['status'] ) ) ? 'new' : sanitize_key( $_GET['status'] ); // @codingStandardsIgnoreLine No nonce needed. $request_uri = $_SERVER['REQUEST_URI']; @@ -160,7 +160,7 @@ protected function bulk_actions( $which = '' ) { public function column_date( $post ) { global $mode; - if ( ! empty( $_GET['status'] ) && 'pulled' === $_GET['status'] ) { + if ( ! empty( $_GET['status'] ) && 'pulled' === $_GET['status'] ) { // @codingStandardsIgnoreLine Nonce isn't required. if ( ! empty( $this->sync_log[ $post->ID ] ) ) { $syndicated_at = get_post_meta( $this->sync_log[ $post->ID ], 'dt_syndicate_time', true ); @@ -172,11 +172,13 @@ public function column_date( $post ) { $time_diff = time() - $syndicated_at; if ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) { + /* translators: %s: a human readable time */ $h_time = sprintf( esc_html__( '%s ago', 'distributor' ), human_time_diff( $syndicated_at ) ); } else { $h_time = date( 'F j, Y', $syndicated_at ); } + /* translators: %s: time of pull */ echo sprintf( esc_html__( 'Pulled %s', 'distributor' ), esc_html( $h_time ) ); } } @@ -193,6 +195,7 @@ public function column_date( $post ) { $time_diff = time() - $time; if ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) { + /* translators: %s: a human readable time */ $h_time = sprintf( esc_html__( '%s ago', 'distributor' ), human_time_diff( $time ) ); } else { $h_time = mysql2date( esc_html__( 'Y/m/d', 'distributor' ), $m_time ); @@ -229,8 +232,7 @@ public function column_date( $post ) { public function column_default( $item, $column_name ) { switch ( $column_name ) { case 'name': - return $item['post_title']; - break; + return $item['post_title']; // return is just as good as break case 'url': $url = get_post_meta( $item->ID, 'dt_external_connection_url', true ); @@ -238,8 +240,7 @@ public function column_default( $item, $column_name ) { $url = esc_html__( 'None', 'distributor' ); } - return $url; - break; + return $url; // no need to break, return will do. } } @@ -279,16 +280,16 @@ public function column_name( $item ) { $actions = []; - if ( empty( $_GET['status'] ) || 'new' === $_GET['status'] ) { + if ( empty( $_GET['status'] ) || 'new' === $_GET['status'] ) { // @codingStandardsIgnoreLine Nonce not needed. $actions = [ 'view' => '' . esc_html__( 'View', 'distributor' ) . '', 'skip' => sprintf( '%s', esc_url( wp_nonce_url( admin_url( 'admin.php?page=pull&action=skip&_wp_http_referer=' . rawurlencode( $_SERVER['REQUEST_URI'] ) . '&post=' . $item->ID . '&connection_type=' . $connection_type . '&connection_id=' . $connection_id ), 'dt_skip' ) ), esc_html__( 'Skip', 'distributor' ) ), ]; - } elseif ( 'skipped' === $_GET['status'] ) { + } elseif ( 'skipped' === $_GET['status'] ) { // @codingStandardsIgnoreLine Nonce not needed. $actions = [ 'view' => '' . esc_html__( 'View', 'distributor' ) . '', ]; - } elseif ( 'pulled' === $_GET['status'] ) { + } elseif ( 'pulled' === $_GET['status'] ) { // @codingStandardsIgnoreLine Nonce not needed $new_post_id = ( ! empty( $this->sync_log[ (int) $item->ID ] ) ) ? $this->sync_log[ (int) $item->ID ] : 0; $new_post = get_post( $new_post_id ); @@ -344,8 +345,8 @@ public function prepare_items() { 'post_type' => $connection_now->pull_post_type ?: 'post', ]; - if ( ! empty( $_GET['s'] ) ) { - $remote_get_args['s'] = rawurlencode( $_GET['s'] ); + if ( ! empty( $_GET['s'] ) ) { // @codingStandardsIgnoreLine Nonce isn't required. + $remote_get_args['s'] = rawurlencode( $_GET['s'] ); // @codingStandardsIgnoreLine Nonce isn't required. } if ( is_a( $connection_now, '\Distributor\ExternalConnection' ) ) { @@ -375,7 +376,7 @@ public function prepare_items() { } } - if ( empty( $_GET['status'] ) || 'new' === $_GET['status'] ) { + if ( empty( $_GET['status'] ) || 'new' === $_GET['status'] ) { // @codingStandardsIgnoreLine Nonce not required. $remote_get_args['post__not_in'] = array_merge( $skipped, $syndicated ); $remote_get_args['meta_query'] = [ @@ -384,7 +385,7 @@ public function prepare_items() { 'compare' => 'NOT EXISTS', ], ]; - } elseif ( 'skipped' === $_GET['status'] ) { + } elseif ( 'skipped' === $_GET['status'] ) { // @codingStandardsIgnoreLine Nonce not required. $remote_get_args['post__in'] = $skipped; } else { $remote_get_args['post__in'] = $syndicated; @@ -419,6 +420,7 @@ public function prepare_items() { public function column_cb( $post ) { ?> @@ -433,12 +435,12 @@ public function column_cb( $post ) { * @return array */ public function get_bulk_actions() { - if ( empty( $_GET['status'] ) || 'new' === $_GET['status'] ) { + if ( empty( $_GET['status'] ) || 'new' === $_GET['status'] ) { // @codingStandardsIgnoreLine Nonce not required. $actions = [ 'bulk-syndicate' => esc_html__( 'Pull', 'distributor' ), 'bulk-skip' => esc_html__( 'Skip', 'distributor' ), ]; - } elseif ( 'skipped' === $_GET['status'] ) { + } elseif ( 'skipped' === $_GET['status'] ) { // @codingStandardsIgnoreLine Nonce not required. $actions = [ 'bulk-syndicate' => esc_html__( 'Pull', 'distributor' ), ]; From f1af9674a38e31e16deaa1854cc5d05d04a1c1a8 Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 21:40:57 -0500 Subject: [PATCH 12/66] Docblocks must respect namespacing. --- includes/classes/PullListTable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/classes/PullListTable.php b/includes/classes/PullListTable.php index c650e40cd..7e716ed45 100644 --- a/includes/classes/PullListTable.php +++ b/includes/classes/PullListTable.php @@ -155,7 +155,7 @@ protected function bulk_actions( $which = '' ) { * * @global string $mode * - * @param WP_Post $post The current WP_Post object. + * @param \WP_Post $post The current WP_Post object. */ public function column_date( $post ) { global $mode; From 0012e2721ed9a13187403877bf56e0d049cb6dd2 Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 21:45:05 -0500 Subject: [PATCH 13/66] PullListTable - see notes column_default() * Fixed the docblock to include both object types * Added return value of empty string * Specified return value in docblock Added many namespace fixes for WP_Post to \WP_Post --- includes/classes/PullListTable.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/includes/classes/PullListTable.php b/includes/classes/PullListTable.php index 7e716ed45..a5b0eaf4f 100644 --- a/includes/classes/PullListTable.php +++ b/includes/classes/PullListTable.php @@ -225,8 +225,10 @@ public function column_date( $post ) { /** * Output standard table columns (not name) * - * @param array $item Item to output. - * @param string $column_name Column name. + * @param array|\WP_Post $item Item to output. + * @param string $column_name Column name. + * + * @return string Url, post title, or empty string. * @since 0.8 */ public function column_default( $item, $column_name ) { @@ -242,13 +244,15 @@ public function column_default( $item, $column_name ) { return $url; // no need to break, return will do. } + + return ''; } /** * Output name column wrapper * * @since 4.3.0 - * @param WP_Post $item Post object. + * @param \WP_Post $item Post object. * @param string $classes CSS classes. * @param string $data Column data. * @param string $primary Whether primary or not. @@ -263,7 +267,7 @@ protected function _column_name( $item, $classes, $data, $primary ) { /** * Output inner name column with actions * - * @param WP_Post $item Post object. + * @param \WP_Post $item Post object. * @since 0.8 */ public function column_name( $item ) { @@ -415,7 +419,7 @@ public function prepare_items() { * Handles the checkbox column output. * * @since 4.3.0 - * @param WP_Post $post The current WP_Post object. + * @param \WP_Post $post The current WP_Post object. */ public function column_cb( $post ) { ?> From 1d10b9b9935970ae07cd26bac32020fb7b168a40 Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 21:47:44 -0500 Subject: [PATCH 14/66] Alignment in PullListTable --- includes/classes/PullListTable.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/classes/PullListTable.php b/includes/classes/PullListTable.php index a5b0eaf4f..ebb3aaf52 100644 --- a/includes/classes/PullListTable.php +++ b/includes/classes/PullListTable.php @@ -253,9 +253,9 @@ public function column_default( $item, $column_name ) { * * @since 4.3.0 * @param \WP_Post $item Post object. - * @param string $classes CSS classes. - * @param string $data Column data. - * @param string $primary Whether primary or not. + * @param string $classes CSS classes. + * @param string $data Column data. + * @param string $primary Whether primary or not. */ protected function _column_name( $item, $classes, $data, $primary ) { echo ''; From 66090689cd4781b767631689ee980eb83fb86036 Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 21:48:25 -0500 Subject: [PATCH 15/66] Alignment in WordPressExternalConnection.php --- .../ExternalConnections/WordPressExternalConnection.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/classes/ExternalConnections/WordPressExternalConnection.php b/includes/classes/ExternalConnections/WordPressExternalConnection.php index cb3622207..3a4bd49b0 100644 --- a/includes/classes/ExternalConnections/WordPressExternalConnection.php +++ b/includes/classes/ExternalConnections/WordPressExternalConnection.php @@ -877,8 +877,8 @@ public function check_connections() { private function to_wp_post( $post ) { $obj = new \stdClass(); - $obj->ID = $post['id']; - $obj->post_title = $post['title']['rendered']; + $obj->ID = $post['id']; + $obj->post_title = $post['title']['rendered']; // Use raw content if both remote and local are using Gutenberg. $obj->post_content = \Distributor\Utils\is_using_gutenberg() && isset( $post['is_using_gutenberg'] ) ? @@ -893,8 +893,8 @@ private function to_wp_post( $post ) { $obj->post_excerpt = ''; } - $obj->post_status = 'draft'; - $obj->post_author = get_current_user_id(); + $obj->post_status = 'draft'; + $obj->post_author = get_current_user_id(); $obj->post_password = $post['password']; $obj->post_date = $post['date']; From 79a471e66bf5c340d7ab4a3e8e310a759e7fd2b7 Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 21:55:08 -0500 Subject: [PATCH 16/66] Clean up external-connection-cpt.php of PHPcs errors --- includes/external-connection-cpt.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/includes/external-connection-cpt.php b/includes/external-connection-cpt.php index eabcc41d4..b481c211f 100644 --- a/includes/external-connection-cpt.php +++ b/includes/external-connection-cpt.php @@ -263,7 +263,7 @@ function ajax_verify_external_connection() { * @since 0.8 */ function admin_enqueue_scripts( $hook ) { - if ( ( 'post.php' === $hook && 'dt_ext_connection' === get_post_type() ) || ( 'post-new.php' === $hook && ! empty( $_GET['post_type'] ) && 'dt_ext_connection' === $_GET['post_type'] ) ) { + if ( ( 'post.php' === $hook && 'dt_ext_connection' === get_post_type() ) || ( 'post-new.php' === $hook && ! empty( $_GET['post_type'] ) && 'dt_ext_connection' === $_GET['post_type'] ) ) { // @codingStandardsIgnoreLine Nonce not required. wp_enqueue_style( 'dt-admin-external-connection', plugins_url( '/dist/css/admin-external-connection.min.css', __DIR__ ), array(), DT_VERSION ); wp_enqueue_script( 'dt-admin-external-connection', plugins_url( '/dist/js/admin-external-connection.min.js', __DIR__ ), array( 'jquery', 'underscore' ), DT_VERSION, true ); @@ -292,7 +292,7 @@ function admin_enqueue_scripts( $hook ) { wp_dequeue_script( 'autosave' ); } - if ( ! empty( $_GET['page'] ) && 'distributor' === $_GET['page'] ) { + if ( ! empty( $_GET['page'] ) && 'distributor' === $_GET['page'] ) { // @codingStandardsIgnoreLine Nonce not required wp_enqueue_style( 'dt-admin-external-connections', plugins_url( '/dist/css/admin-external-connections.min.css', __DIR__ ), array(), DT_VERSION ); } } @@ -532,7 +532,7 @@ function dashboard() { - + @@ -598,13 +598,13 @@ function add_submenu_item() { esc_html__( 'External Connections', 'distributor' ), esc_html__( 'External Connections', 'distributor' ), /** - * Filter Distributor capabilities allowed to manage external connections. - * - * @since 1.0.0 - * - * @param string manage_options The capability allowed to manage external connections. - */ - apply_filters( 'dt_external_capabilities', 'manage_options' ), + * Filter Distributor capabilities allowed to manage external connections. + * + * @since 1.0.0 + * + * @param string manage_options The capability allowed to manage external connections. + */ + apply_filters( 'dt_external_capabilities', 'manage_options' ), 'distributor' ); } @@ -665,11 +665,13 @@ function filter_post_updated_messages( $messages ) { 2 => esc_html__( 'Custom field updated.', 'distributor' ), 3 => esc_html__( 'Custom field deleted.', 'distributor' ), 4 => esc_html__( 'External connection updated.', 'distributor' ), - 5 => isset( $_GET['revision'] ) ? sprintf( __( ' External connection restored to revision from %s', 'distributor' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, + /* translators: %s: revision title */ + 5 => isset( $_GET['revision'] ) ? sprintf( __( ' External connection restored to revision from %s', 'distributor' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, // @codingStandardsIgnoreLine Nonce not required 6 => esc_html__( 'External connection created.', 'distributor' ), 7 => esc_html__( 'External connection saved.', 'distributor' ), 8 => esc_html__( 'External connection submitted.', 'distributor' ), 9 => sprintf( + /* translators: %s: a date and time */ __( 'External connection scheduled for: %1$s.', 'distributor' ), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ) ), From 295130c735b3cd4f39954bc5e95de2ed83a0132f Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 21:56:21 -0500 Subject: [PATCH 17/66] Set docblock to respect namespacing. --- includes/external-connection-cpt.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/external-connection-cpt.php b/includes/external-connection-cpt.php index b481c211f..63cf17bf6 100644 --- a/includes/external-connection-cpt.php +++ b/includes/external-connection-cpt.php @@ -399,7 +399,7 @@ function add_meta_boxes() { * Output connection options meta box * * @since 0.8 - * @param WP_Post $post Post object. + * @param \WP_Post $post Post object. */ function meta_box_external_connection_details( $post ) { wp_nonce_field( 'dt_external_connection_details_action', 'dt_external_connection_details' ); From f46051e8b98745e1a8c118e4a2b8b16b50d956cd Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 21:59:43 -0500 Subject: [PATCH 18/66] Resolve all PHPcs complaints in push-ui.php --- includes/push-ui.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/push-ui.php b/includes/push-ui.php index c097cab93..51bd6de7e 100644 --- a/includes/push-ui.php +++ b/includes/push-ui.php @@ -60,7 +60,7 @@ function syndicatable() { return false; } - if ( ! in_array( get_post_type(), \Distributor\Utils\distributable_post_types(), true ) || ( ! empty( $_GET['post_type'] ) && 'dt_ext_connection' === $_GET['post_type'] ) ) { + if ( ! in_array( get_post_type(), \Distributor\Utils\distributable_post_types(), true ) || ( ! empty( $_GET['post_type'] ) && 'dt_ext_connection' === $_GET['post_type'] ) ) { // @codingStandardsIgnoreLine Nonce not required return false; } @@ -303,6 +303,7 @@ function menu_content() {

+ labels->singular_name ) ) ); ?> . @@ -357,7 +358,7 @@ function menu_content() { $external_connections_query = new \WP_Query( array( 'post_type' => 'dt_ext_connection', - 'posts_per_page' => 200, + 'posts_per_page' => 200, // @codingStandardsIgnoreLine This high pagination limit is purposeful 'no_found_rows' => true, 'post_status' => 'publish', ) @@ -365,7 +366,7 @@ function menu_content() { $current_post_type = get_post_type(); - if ( ! empty( $_GET['post_type'] ) ) { + if ( ! empty( $_GET['post_type'] ) ) { // @codingStandardsIgnoreLine nonce not required $current_post_type = sanitize_key( $_GET['post_type'] ); } @@ -443,6 +444,7 @@ function menu_content() {

+

ID ) ) ); ?>

From 66b00696135dd2aeb87f2f789f69c32f51c461ad Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 22:02:38 -0500 Subject: [PATCH 19/66] Add translators tag to template-tags as required by PHPcs --- includes/template-tags.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/template-tags.php b/includes/template-tags.php index b104b06c7..025a11ecf 100644 --- a/includes/template-tags.php +++ b/includes/template-tags.php @@ -174,6 +174,7 @@ function distributor_get_original_site_link( $post_id = null ) { * * @param string A formatted version of the original site link. */ + /* translators: %1$s: site url, %2$s; site name*/ return apply_filters( 'distributor_get_original_site_link', sprintf( __( 'By %2$s', 'distributor' ), esc_url( $site_url ), esc_html( $site_name ) ) ); } From 1cd0362ae1219ef18a9840e642c145b9d7f23c26 Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 22:03:31 -0500 Subject: [PATCH 20/66] Must return what the docblock requires in template-tags.php --- includes/template-tags.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/template-tags.php b/includes/template-tags.php index 025a11ecf..44455a4b7 100644 --- a/includes/template-tags.php +++ b/includes/template-tags.php @@ -164,7 +164,7 @@ function distributor_get_original_site_link( $post_id = null ) { $site_url = distributor_get_original_site_url( $post_id ); if ( empty( $site_name ) || empty( $site_url ) ) { - return; + return ''; } /** From 07d67c14758ae0bbee717aaee71bff3e40b64706 Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 22:07:05 -0500 Subject: [PATCH 21/66] Resolve all PHPcs errors in settings.php --- includes/settings.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/settings.php b/includes/settings.php index 1e5e418d3..b0526fa49 100644 --- a/includes/settings.php +++ b/includes/settings.php @@ -108,6 +108,7 @@ function update_notice( $plugin_file, $plugin_data, $status ) {

+ Register for a free Distributor key to receive updates.', 'distributor' ), esc_url( $notice_url ) ) ); ?>

@@ -126,6 +127,7 @@ function maybe_notice() { if ( preg_match( '/-dev$/', DT_VERSION ) ) { ?>
+

download and install the stable version of Distributor instead.', 'distributor' ), 'npm install && npm run build', 'https://distributorplugin.com/' ) ); ?>

+

Register Distributor to receive important plugin update notices and other Distributor news.', 'distributor' ), esc_url( $notice_url ) ) ); ?>

Date: Thu, 31 Jan 2019 22:19:43 -0500 Subject: [PATCH 22/66] Resolve all PHPcs errors in external-connection.cpt --- includes/external-connection-cpt.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/external-connection-cpt.php b/includes/external-connection-cpt.php index 63cf17bf6..1356e0905 100644 --- a/includes/external-connection-cpt.php +++ b/includes/external-connection-cpt.php @@ -82,6 +82,7 @@ function output_status_column( $column_name, $post_id ) { + title="" > From 9e649d4555782893263e30a0f4db7340b9f9a0ee Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 22:22:11 -0500 Subject: [PATCH 23/66] Clean up rest-api.php file, fix docblocks. --- includes/rest-api.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/includes/rest-api.php b/includes/rest-api.php index cb36cee3b..5bb4d30d2 100644 --- a/includes/rest-api.php +++ b/includes/rest-api.php @@ -42,10 +42,10 @@ function() { * Use the raw content for Gutenberg->Gutenberg posts. Note: `distributor_raw_content` * is only sent when the origin supports Gutenberg. * - * @param stdClass $prepared_post An object representing a single post prepared. - * @param WP_REST_Request $request Request object. + * @param Object $prepared_post An object representing a single post prepared. + * @param \WP_REST_Request $request Request object. * - * @return stdClass $prepared_post The filtered post object. + * @return Object $prepared_post The filtered post object. */ function filter_distributor_content( $prepared_post, $request ) { @@ -60,8 +60,8 @@ function filter_distributor_content( $prepared_post, $request ) { /** * When an API push is being received, handle Distributor specific attributes * - * @param WP_Post $post Post object. - * @param WP_REST_Request $request Request object. + * @param \WP_Post $post Post object. + * @param \WP_REST_Request $request Request object. * @param bool $update Update or create. * @since 1.0 */ @@ -120,8 +120,8 @@ function process_distributor_attributes( $post, $request, $update ) { * * @since 1.0 * - * @param WP_Post $post Inserted or updated post object. - * @param WP_REST_Request $request Request object. + * @param \WP_Post $post Inserted or updated post object. + * @param \WP_REST_Request $request Request object. * @param bool $update True when creating a post, false when updating. */ do_action( 'dt_process_distributor_attributes', $post, $request, $update ); @@ -130,11 +130,11 @@ function process_distributor_attributes( $post, $request, $update ) { /** * Filter the data requested over REST API when a post is pulled. * - * @param WP_REST_Response $response Response object. - * @param WP_Post $post Post object. - * @param WP_REST_Request $request Request object. + * @param \WP_REST_Response $response Response object. + * @param \WP_Post $post Post object. + * @param \WP_REST_Request $request Request object. * - * @return WP_REST_Response $response The filtered response object. + * @return \WP_REST_Response $response The filtered response object. */ function prepare_distributor_content( $response, $post, $request ) { @@ -144,7 +144,7 @@ function prepare_distributor_content( $response, $post, $request ) { } // Is the local site is running Gutenberg? if ( \Distributor\Utils\is_using_gutenberg() ) { - $post_data = $response->get_data(); + $post_data = $response->get_data(); $post_data['is_using_gutenberg'] = true; $response->set_data( $post_data ); } From 653271c6e54fa208517e0c7ab6475ef57eb4111b Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 22:26:07 -0500 Subject: [PATCH 24/66] Align docblock variables. --- includes/rest-api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/rest-api.php b/includes/rest-api.php index 5bb4d30d2..87522cfba 100644 --- a/includes/rest-api.php +++ b/includes/rest-api.php @@ -42,8 +42,8 @@ function() { * Use the raw content for Gutenberg->Gutenberg posts. Note: `distributor_raw_content` * is only sent when the origin supports Gutenberg. * - * @param Object $prepared_post An object representing a single post prepared. - * @param \WP_REST_Request $request Request object. + * @param Object $prepared_post An object representing a single post prepared. + * @param \WP_REST_Request $request Request object. * * @return Object $prepared_post The filtered post object. */ From 17d946eab2ff7a15ad9ec3e444fe9156e98c2584 Mon Sep 17 00:00:00 2001 From: JayWood Date: Thu, 31 Jan 2019 22:30:12 -0500 Subject: [PATCH 25/66] My editor hates me... add a space that apparently wasn't caught before. --- includes/rest-api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/rest-api.php b/includes/rest-api.php index 87522cfba..0c77308b7 100644 --- a/includes/rest-api.php +++ b/includes/rest-api.php @@ -62,7 +62,7 @@ function filter_distributor_content( $prepared_post, $request ) { * * @param \WP_Post $post Post object. * @param \WP_REST_Request $request Request object. - * @param bool $update Update or create. + * @param bool $update Update or create. * @since 1.0 */ function process_distributor_attributes( $post, $request, $update ) { From 37b24287fb106327f3acad53b16993891aa570e2 Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Fri, 1 Feb 2019 09:13:17 -0700 Subject: [PATCH 26/66] Make sure the new view links build the query args correctly. Make sure the search input actually works as expected. --- assets/js/admin-pull.js | 54 ++++++++++++++++++++++-------- includes/classes/PullListTable.php | 6 ++-- 2 files changed, 43 insertions(+), 17 deletions(-) diff --git a/assets/js/admin-pull.js b/assets/js/admin-pull.js index dd19d8e52..636ec098b 100755 --- a/assets/js/admin-pull.js +++ b/assets/js/admin-pull.js @@ -3,6 +3,8 @@ import jQuery from 'jquery'; const chooseConnection = document.getElementById( 'pull_connections' ); const choosePostType = document.getElementById( 'pull_post_type' ); const choosePostTypeBtn = document.getElementById( 'pull_post_type_submit' ); +const searchField = document.getElementById( 'post-search-input' ); +const searchBtn = document.getElementById( 'search-submit' ); const form = document.getElementById( 'posts-filter' ); jQuery( chooseConnection ).on( 'change', ( event ) => { @@ -12,23 +14,47 @@ jQuery( chooseConnection ).on( 'change', ( event ) => { document.body.className += ' ' + 'dt-loading'; } ); -if ( chooseConnection && choosePostType && choosePostTypeBtn && form ) { - jQuery( choosePostTypeBtn ).on( 'click', ( event ) => { +if ( chooseConnection && choosePostType && form ) { - event.preventDefault(); + if ( choosePostTypeBtn ) { + jQuery( choosePostTypeBtn ).on( 'click', ( event ) => { - const postType = choosePostType.options[ choosePostType.selectedIndex ].value; - const url = chooseConnection.options[ chooseConnection.selectedIndex ].getAttribute( 'data-pull-url' ); - let status = 'new'; + event.preventDefault(); - if ( -1 < ( ' ' + form.className + ' ' ).indexOf( ' status-skipped ' ) ) { - status = 'skipped'; - } else if ( -1 < ( ' ' + form.className + ' ' ).indexOf( ' status-pulled ' ) ) { - status = 'pulled'; - } + document.location = getURL(); - document.location = url + '&pull_post_type=' + postType + '&status=' + status; + document.body.className += ' ' + 'dt-loading'; + } ); + } - document.body.className += ' ' + 'dt-loading'; - } ); + if ( searchField && searchBtn ) { + jQuery( searchBtn ).on( 'click', ( event ) => { + event.preventDefault(); + + const search = searchField.value; + + document.location = getURL() + '&s=' + search; + + document.body.className += ' ' + 'dt-loading'; + } ); + } } + +/** + * Build our Distribution URL. + * + * @return {string} + */ +const getURL = () => { + const postType = choosePostType.options[ choosePostType.selectedIndex ].value; + const baseURL = chooseConnection.options[ chooseConnection.selectedIndex ].getAttribute( 'data-pull-url' ); + let status = 'new'; + + if ( -1 < ( ' ' + form.className + ' ' ).indexOf( ' status-skipped ' ) ) { + status = 'skipped'; + } else if ( -1 < ( ' ' + form.className + ' ' ).indexOf( ' status-pulled ' ) ) { + status = 'pulled'; + } + + return baseURL + '&pull_post_type=' + postType + '&status=' + status; +}; diff --git a/includes/classes/PullListTable.php b/includes/classes/PullListTable.php index a104965bb..3bc94068e 100644 --- a/includes/classes/PullListTable.php +++ b/includes/classes/PullListTable.php @@ -90,9 +90,9 @@ protected function get_views() { $request_uri = $_SERVER['REQUEST_URI']; $status_links = [ - 'new' => '' . esc_html__( 'New', 'distributor' ) . '', - 'pulled' => '' . esc_html__( 'Pulled', 'distributor' ) . '', - 'skipped' => '' . esc_html__( 'Skipped', 'distributor' ) . '', + 'new' => '' . esc_html__( 'New', 'distributor' ) . '', + 'pulled' => '' . esc_html__( 'Pulled', 'distributor' ) . '', + 'skipped' => '' . esc_html__( 'Skipped', 'distributor' ) . '', ]; return $status_links; From 15e6c32a7a5810406fe36727b6aa51adbd35b462 Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Fri, 1 Feb 2019 09:22:53 -0700 Subject: [PATCH 27/66] Linting clean up --- includes/classes/PullListTable.php | 32 +++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/includes/classes/PullListTable.php b/includes/classes/PullListTable.php index 3bc94068e..a2a4a8470 100644 --- a/includes/classes/PullListTable.php +++ b/includes/classes/PullListTable.php @@ -89,10 +89,36 @@ protected function get_views() { $request_uri = $_SERVER['REQUEST_URI']; + $url = add_query_arg( + array( + 'paged' => false, + 's' => false, + ), + $request_uri + ); + $new_url = add_query_arg( + array( + 'status' => 'new', + ), + $url + ); + $pulled_url = add_query_arg( + array( + 'status' => 'pulled', + ), + $url + ); + $skipped_url = add_query_arg( + array( + 'status' => 'skipped', + ), + $url + ); + $status_links = [ - 'new' => '' . esc_html__( 'New', 'distributor' ) . '', - 'pulled' => '' . esc_html__( 'Pulled', 'distributor' ) . '', - 'skipped' => '' . esc_html__( 'Skipped', 'distributor' ) . '', + 'new' => '' . esc_html__( 'New', 'distributor' ) . '', + 'pulled' => '' . esc_html__( 'Pulled', 'distributor' ) . '', + 'skipped' => '' . esc_html__( 'Skipped', 'distributor' ) . '', ]; return $status_links; From fb8e268f3bd59fe6713862c5c4162dd934cc453e Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Fri, 8 Feb 2019 13:23:35 -0700 Subject: [PATCH 28/66] Fix remaining PHPCS issues. --- includes/classes/Authentications/WordPressBasicAuth.php | 4 ++-- .../classes/InternalConnections/NetworkSiteConnection.php | 2 +- includes/classes/PullListTable.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/classes/Authentications/WordPressBasicAuth.php b/includes/classes/Authentications/WordPressBasicAuth.php index b0d9c5401..be41aa4be 100644 --- a/includes/classes/Authentications/WordPressBasicAuth.php +++ b/includes/classes/Authentications/WordPressBasicAuth.php @@ -43,7 +43,7 @@ public function __construct( $args ) { parent::__construct( $args ); if ( isset( $this->password ) && isset( $this->username ) ) { - $this->base64_encoded = base64_encode( $this->username . ':' . $this->password ); + $this->base64_encoded = base64_encode( $this->username . ':' . $this->password ); // @codingStandardsIgnoreLine valid use of base64_encode } if ( empty( $this->base64_encoded ) ) { @@ -103,7 +103,7 @@ public static function prepare_credentials( $args ) { } if ( ! empty( $args['password'] ) ) { - $auth['base64_encoded'] = base64_encode( $args['username'] . ':' . $args['password'] ); + $auth['base64_encoded'] = base64_encode( $args['username'] . ':' . $args['password'] ); // @codingStandardsIgnoreLine valid use of base64_encode } /** diff --git a/includes/classes/InternalConnections/NetworkSiteConnection.php b/includes/classes/InternalConnections/NetworkSiteConnection.php index 498eaebf5..8b49b621d 100644 --- a/includes/classes/InternalConnections/NetworkSiteConnection.php +++ b/includes/classes/InternalConnections/NetworkSiteConnection.php @@ -186,7 +186,7 @@ public function pull( $items ) { if ( ! empty( $post_props['meta']['dt_connection_map'] ) ) { foreach ( $post_props['meta']['dt_connection_map'] as $distributed ) { - $distributed = unserialize( $distributed ); + $distributed = unserialize( $distributed ); // @codingStandardsIgnoreLine valid use of unserialize if ( array_key_exists( $current_blog_id, $distributed['internal'] ) ) { $dt_pull_messages['duplicated'] = 1; diff --git a/includes/classes/PullListTable.php b/includes/classes/PullListTable.php index ebb3aaf52..878f5a98a 100644 --- a/includes/classes/PullListTable.php +++ b/includes/classes/PullListTable.php @@ -123,7 +123,7 @@ protected function bulk_actions( $which = '' ) { * * @param array $actions An array of the available bulk actions. */ - $this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions ); + $this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions ); // @codingStandardsIgnoreLine valid filter name $this->_actions = array_intersect_assoc( $this->_actions, $no_new_actions ); $two = ''; } else { @@ -257,7 +257,7 @@ public function column_default( $item, $column_name ) { * @param string $data Column data. * @param string $primary Whether primary or not. */ - protected function _column_name( $item, $classes, $data, $primary ) { + protected function _column_name( $item, $classes, $data, $primary ) { // @codingStandardsIgnoreLine valid function name echo ''; $this->column_name( $item ); echo wp_kses_post( $this->handle_row_actions( $item, 'title', $primary ) ); From 9943b3314e65287d0017137e0b6507108bad3f53 Mon Sep 17 00:00:00 2001 From: JayWood Date: Tue, 12 Feb 2019 07:41:34 -0500 Subject: [PATCH 29/66] Extend WP_Mock\Tools\TestCase not \TestCase for unit tests. --- tests/php/ConnectionsTest.php | 4 +++- tests/php/ExternalConnectionTest.php | 4 +++- tests/php/NetworkSiteConnectionsTest.php | 4 +++- tests/php/SubscriptionsTest.php | 4 +++- tests/php/UtilsTest.php | 4 +++- tests/php/WordPressExternalConnectionTest.php | 3 ++- 6 files changed, 17 insertions(+), 6 deletions(-) diff --git a/tests/php/ConnectionsTest.php b/tests/php/ConnectionsTest.php index 9dfd5027e..c188b0576 100644 --- a/tests/php/ConnectionsTest.php +++ b/tests/php/ConnectionsTest.php @@ -2,7 +2,9 @@ namespace Distributor; -class ConnectionsTest extends \TestCase { +use WP_Mock\Tools\TestCase; + +class ConnectionsTest extends TestCase { /** * Test connection registration * diff --git a/tests/php/ExternalConnectionTest.php b/tests/php/ExternalConnectionTest.php index f3353f115..747e6fd34 100644 --- a/tests/php/ExternalConnectionTest.php +++ b/tests/php/ExternalConnectionTest.php @@ -2,7 +2,9 @@ namespace Distributor; -class ExternalConnectionTest extends \TestCase { +use WP_Mock\Tools\TestCase; + +class ExternalConnectionTest extends TestCase { /** * Text External Connection instantiation failure on no type diff --git a/tests/php/NetworkSiteConnectionsTest.php b/tests/php/NetworkSiteConnectionsTest.php index 474fbbfd0..0bb210a9e 100644 --- a/tests/php/NetworkSiteConnectionsTest.php +++ b/tests/php/NetworkSiteConnectionsTest.php @@ -2,7 +2,9 @@ namespace Distributor\InternalConnections; -class NetworkSiteConnectionsTest extends \TestCase { +use WP_Mock\Tools\TestCase; + +class NetworkSiteConnectionsTest extends TestCase { public function setUp() { $this->site_obj = \Mockery::mock( diff --git a/tests/php/SubscriptionsTest.php b/tests/php/SubscriptionsTest.php index dcf52b4e2..3f166b029 100644 --- a/tests/php/SubscriptionsTest.php +++ b/tests/php/SubscriptionsTest.php @@ -2,7 +2,9 @@ namespace Distributor; -class SubscriptionsTest extends \TestCase { +use WP_Mock\Tools\TestCase; + +class SubscriptionsTest extends TestCase { /** * Test delete subscribed to post diff --git a/tests/php/UtilsTest.php b/tests/php/UtilsTest.php index e49c1a8b0..b73234776 100644 --- a/tests/php/UtilsTest.php +++ b/tests/php/UtilsTest.php @@ -2,7 +2,9 @@ namespace Distributor; -class UtilsTest extends \TestCase { +use WP_Mock\Tools\TestCase; + +class UtilsTest extends TestCase { /** * Test set meta with string value and array value diff --git a/tests/php/WordPressExternalConnectionTest.php b/tests/php/WordPressExternalConnectionTest.php index 2c1775185..7a3f5aba2 100644 --- a/tests/php/WordPressExternalConnectionTest.php +++ b/tests/php/WordPressExternalConnectionTest.php @@ -2,8 +2,9 @@ namespace Distributor\ExternalConnections; use \Distributor\Authentications\WordPressBasicAuth as WordPressBasicAuth; +use WP_Mock\Tools\TestCase; -class WordPressExternalConnectionTest extends \TestCase { +class WordPressExternalConnectionTest extends TestCase { public function setUp() { From 0d733d43034c992661db428982cf6594e11a0c6a Mon Sep 17 00:00:00 2001 From: JayWood Date: Tue, 12 Feb 2019 07:47:16 -0500 Subject: [PATCH 30/66] Ensure all Subscription tests conditions are met. --- tests/php/SubscriptionsTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/php/SubscriptionsTest.php b/tests/php/SubscriptionsTest.php index 3f166b029..bb7b5f14f 100644 --- a/tests/php/SubscriptionsTest.php +++ b/tests/php/SubscriptionsTest.php @@ -109,6 +109,7 @@ public function test_delete_subscribed_post() { Subscriptions\delete_subscriptions( 1 ); + $this->assertConditionsMet(); } /** @@ -165,6 +166,7 @@ public function test_delete_subscribing_post() { // External connection comes back WP_Error and delete_subscription isn't actually called on connection Subscriptions\delete_subscriptions( 1 ); + $this->assertConditionsMet(); } /** @@ -196,6 +198,8 @@ public function test_send_notifications_none() { ); Subscriptions\send_notifications( 1 ); + + $this->assertConditionsMet(); } /** @@ -361,6 +365,8 @@ public function test_send_notifications_no_remote_post() { ); Subscriptions\send_notifications( $post_id ); + + $this->assertConditionsMet(); } /** @@ -522,6 +528,8 @@ public function test_send_notifications_remote_post_exists() { ); Subscriptions\send_notifications( $post_id ); + + $this->assertConditionsMet(); } /** @@ -599,6 +607,8 @@ public function test_create_subscription() { ); Subscriptions\create_subscription( $post_id, $remote_post_id, $target_url, $signature ); + + $this->assertConditionsMet(); } /** @@ -681,6 +691,8 @@ public function test_create_remote_subscription() { ); Subscriptions\create_remote_subscription( $connection, $remote_post_id, $post_id ); + + $this->assertConditionsMet(); } /** @@ -718,5 +730,7 @@ public function test_delete_subscription_local() { ); Subscriptions\delete_subscription( $post_id, $signature ); + + $this->assertConditionsMet(); } } From c90f20868ceb517290df6b15b99f855afb8571ce Mon Sep 17 00:00:00 2001 From: JayWood Date: Tue, 12 Feb 2019 07:51:10 -0500 Subject: [PATCH 31/66] Ensure some risky Util tests have assertions and their conditions are met. --- tests/php/UtilsTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/php/UtilsTest.php b/tests/php/UtilsTest.php index b73234776..3703df5f6 100644 --- a/tests/php/UtilsTest.php +++ b/tests/php/UtilsTest.php @@ -61,6 +61,8 @@ public function test_set_meta_simple() { 'key' => [ [ 'value' ] ], ] ); + + $this->assertConditionsMet(); } /** @@ -143,6 +145,8 @@ public function test_set_meta_multi() { 'key2' => [ 'value3' ], ] ); + + $this->assertConditionsMet(); } /** @@ -183,6 +187,8 @@ public function test_set_meta_serialize() { 'key2' => [ 'a:1:{i:0;s:4:"test";}' ], ] ); + + $this->assertConditionsMet(); } /** @@ -252,6 +258,8 @@ public function test_set_taxonomy_terms_simple() { ], ] ); + + $this->assertConditionsMet(); } /** @@ -318,6 +326,8 @@ public function test_set_taxonomy_terms_create_term() { ], ] ); + + $this->assertConditionsMet(); } /** @@ -360,6 +370,8 @@ public function test_set_taxonomy_terms_no_taxonomy() { ], ] ); + + $this->assertConditionsMet(); } /** From 9e0686668820ba22f21b33f40551d2d4e501d95f Mon Sep 17 00:00:00 2001 From: JayWood Date: Tue, 12 Feb 2019 08:08:25 -0500 Subject: [PATCH 32/66] Resolve code review issues. --- includes/classes/PullListTable.php | 4 ++-- includes/distributed-post-ui.php | 1 - includes/pull-ui.php | 4 ++-- includes/syndicated-post-ui.php | 4 +--- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/includes/classes/PullListTable.php b/includes/classes/PullListTable.php index 878f5a98a..286eeab11 100644 --- a/includes/classes/PullListTable.php +++ b/includes/classes/PullListTable.php @@ -234,7 +234,7 @@ public function column_date( $post ) { public function column_default( $item, $column_name ) { switch ( $column_name ) { case 'name': - return $item['post_title']; // return is just as good as break + return $item['post_title']; case 'url': $url = get_post_meta( $item->ID, 'dt_external_connection_url', true ); @@ -242,7 +242,7 @@ public function column_default( $item, $column_name ) { $url = esc_html__( 'None', 'distributor' ); } - return $url; // no need to break, return will do. + return $url; } return ''; diff --git a/includes/distributed-post-ui.php b/includes/distributed-post-ui.php index b4f3168c6..a4005fa24 100644 --- a/includes/distributed-post-ui.php +++ b/includes/distributed-post-ui.php @@ -37,7 +37,6 @@ function add_help_tab() { return; } - // Set a post ID variable here for use a few times. $post_id = intval( $_GET['post'] ); // @codingStandardsIgnoreLine Nonce not necessary, simply type-casting data here from the admin. $connection_map = get_post_meta( $post_id, 'dt_connection_map', true ); diff --git a/includes/pull-ui.php b/includes/pull-ui.php index de25f5bde..476bce4d7 100644 --- a/includes/pull-ui.php +++ b/includes/pull-ui.php @@ -250,7 +250,7 @@ function( $remote_post_id ) use ( $post_type ) { } wp_safe_redirect( wp_get_referer() ); - exit; // No need to break here, exit does the job. + exit; case 'bulk-skip': case 'skip': if ( ! wp_verify_nonce( $_GET['_wpnonce'], 'dt_skip' ) && ! wp_verify_nonce( $_GET['_wpnonce'], 'bulk-distributor_page_pull' ) ) { @@ -292,7 +292,7 @@ function( $remote_post_id ) use ( $post_type ) { setcookie( 'dt-skipped', 1, time() + DAY_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, is_ssl() ); wp_safe_redirect( wp_get_referer() ); - exit; // No need to break here, exit does the job. + exit; } } diff --git a/includes/syndicated-post-ui.php b/includes/syndicated-post-ui.php index 87aae3273..1813a4af1 100644 --- a/includes/syndicated-post-ui.php +++ b/includes/syndicated-post-ui.php @@ -148,9 +148,7 @@ function add_linked_class( $classes ) { return $classes; } - // Create a var since it will be used multiple times. - $current_post_id = intval( $_GET['post'] ); // @codingStandardsIgnoreLine No nonce needed. - + $current_post_id = intval( $_GET['post'] ); // @codingStandardsIgnoreLine No nonce needed. $original_blog_id = get_post_meta( $current_post_id, 'dt_original_blog_id', true ); $original_source_id = get_post_meta( $current_post_id, 'dt_original_source_id', true ); $original_post_id = get_post_meta( $current_post_id, 'dt_original_post_id', true ); From 839acb0cbcbdde3c59b139ac9d7359e80fcf2856 Mon Sep 17 00:00:00 2001 From: JayWood Date: Tue, 12 Feb 2019 08:16:00 -0500 Subject: [PATCH 33/66] Ignore coding standards line for %s in string. --- includes/utils.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/utils.php b/includes/utils.php index f85406105..bc5c4134d 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -651,7 +651,7 @@ function process_media( $url, $post_id ) { // Distributor is in debug mode, display the issue, could be storage related. if ( is_dt_debug() ) { - error_log( sprintf( 'Distributor: %s', $file_array['tmp_name']->get_error_message() ) ); + error_log( sprintf( 'Distributor: %s', $file_array['tmp_name']->get_error_message() ) ); // @codingStandardsIgnoreLine } return false; @@ -663,7 +663,7 @@ function process_media( $url, $post_id ) { // Distributor is in debug mode, display the issue, could be storage related. if ( is_dt_debug() ) { - error_log( sprintf( 'Distributor: %s', $file_array['tmp_name']->get_error_message() ) ); + error_log( sprintf( 'Distributor: %s', $file_array['tmp_name']->get_error_message() ) ); // @codingStandardsIgnoreLine } return false; From 6869befc6c5f1aed96cce96df7182e22c33fabd7 Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Thu, 14 Feb 2019 00:09:57 -0600 Subject: [PATCH 34/66] Change labeling from connection type to authentication method Note that this does not change anything on the code level; this may be somewhat of a burden in the future but it's not a significant plugin until there's technical debt! --- .../WordPressDotcomExternalConnection.php | 8 +++++++- .../ExternalConnections/WordPressExternalConnection.php | 8 +++++++- includes/external-connection-cpt.php | 4 ++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/includes/classes/ExternalConnections/WordPressDotcomExternalConnection.php b/includes/classes/ExternalConnections/WordPressDotcomExternalConnection.php index 52e2d29b5..ce469be49 100644 --- a/includes/classes/ExternalConnections/WordPressDotcomExternalConnection.php +++ b/includes/classes/ExternalConnections/WordPressDotcomExternalConnection.php @@ -24,9 +24,15 @@ class WordPressDotcomExternalConnection extends WordPressExternalConnection { /** * Connection pretty label * + * This is to represent the authentication method, + * not the connection type. This value was previously + * "WordPress.com REST API". + * + * @since 1.4.0 Label as authentication method, not connection type + * * @var string */ - static public $label = 'WordPress.com REST API'; + static public $label = 'WordPress.com Application'; /** * Connection auth class diff --git a/includes/classes/ExternalConnections/WordPressExternalConnection.php b/includes/classes/ExternalConnections/WordPressExternalConnection.php index cb3622207..66effd10b 100644 --- a/includes/classes/ExternalConnections/WordPressExternalConnection.php +++ b/includes/classes/ExternalConnections/WordPressExternalConnection.php @@ -25,9 +25,15 @@ class WordPressExternalConnection extends ExternalConnection { /** * Connection pretty label * + * This is to represent the authentication method, + * not the connection type. This value was previously + * "WordPress REST API". + * + * @since 1.4.0 Label as authentication method, not connection type + * * @var string */ - static public $label = 'WordPress REST API'; + static public $label = 'Username / Password'; /** * Auth handler to use diff --git a/includes/external-connection-cpt.php b/includes/external-connection-cpt.php index eabcc41d4..fa3e76fe0 100644 --- a/includes/external-connection-cpt.php +++ b/includes/external-connection-cpt.php @@ -444,13 +444,13 @@ function meta_box_external_connection_details( $post ) {

-
+
- +

From 4996e493b3b5fa046477a5c22f5e62a7723b8a7e Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Thu, 14 Feb 2019 00:11:14 -0600 Subject: [PATCH 35/66] Start of some clarifications on passwords and connection name I am not loving these yet so I've grouped them in an intermediate commit. Passwords need a pointed reminder that Application Passwords is the way to go and to somehow incorporate the magic link thing. Connection name is really an arbitrary label - "Enter external connection name" made it sound like if you didn't match something precisely it wouldn't work. It needs to be clearer that it's just an arbitrary label so you can tell things apart. --- includes/classes/Authentications/WordPressBasicAuth.php | 2 ++ includes/external-connection-cpt.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/classes/Authentications/WordPressBasicAuth.php b/includes/classes/Authentications/WordPressBasicAuth.php index b0d9c5401..5b0bc9f3c 100644 --- a/includes/classes/Authentications/WordPressBasicAuth.php +++ b/includes/classes/Authentications/WordPressBasicAuth.php @@ -80,6 +80,8 @@ public static function credentials_form( $args = array() ) { + +

Date: Tue, 19 Feb 2019 01:56:26 +0400 Subject: [PATCH 36/66] Fix php Notice Undefined index --- includes/utils.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/utils.php b/includes/utils.php index 2c79e6548..e4cd789f6 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -537,7 +537,9 @@ function set_media( $post_id, $media ) { } // Transfer all meta - set_meta( $image_id, $media_item['meta'] ); + if ( isset( $media_item['meta'] ) ) { + set_meta( $image_id, $media_item['meta'] ); + } // Transfer post properties wp_update_post( From 56a7b0bbcb41f4a77b199de5c29406f400cca1f5 Mon Sep 17 00:00:00 2001 From: Ryan Welcher Date: Fri, 22 Feb 2019 17:00:49 -0500 Subject: [PATCH 37/66] Revert "Revert "Merge pull request #319 from 10up/feature/remove-pulled-checkbox"" This reverts commit 4357249f3d678030f72d6876df43c4f556b0371a. --- includes/classes/PullListTable.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/classes/PullListTable.php b/includes/classes/PullListTable.php index a104965bb..046216402 100644 --- a/includes/classes/PullListTable.php +++ b/includes/classes/PullListTable.php @@ -59,6 +59,11 @@ public function get_columns() { 'date' => esc_html__( 'Date', 'distributor' ), ]; + // Remove checkbox column on the Pulled view + if ( isset( $_GET['status'] ) && 'pulled' === $_GET['status'] ) { + unset( $columns['cb'] ); + } + return $columns; } From 21b00328e7e3bc08461a5d3bc61b9ae8cbdcf27a Mon Sep 17 00:00:00 2001 From: Ryan Welcher Date: Fri, 22 Feb 2019 17:01:13 -0500 Subject: [PATCH 38/66] Revert "Revert "Merge pull request #323 from Ritesh-patel/fix/local-media-pull"" This reverts commit 043c929b33281b1184c1809d4f41cf37c90284bc. --- includes/utils.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/utils.php b/includes/utils.php index c556e3bfa..eb149f3c7 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -665,9 +665,15 @@ function process_media( $url, $post_id ) { require_once ABSPATH . 'wp-admin/includes/file.php'; require_once ABSPATH . 'wp-admin/includes/media.php'; + // Allows to pull media from local IP addresses + // Uses a "magic number" for priority so we only unhook our call, just in case + add_filter( 'http_request_host_is_external', '__return_true', 88 ); + // Download file to temp location. $file_array['tmp_name'] = download_url( $url ); + remove_filter( 'http_request_host_is_external', '__return_true', 88 ); + // If error storing temporarily, return the error. if ( is_wp_error( $file_array['tmp_name'] ) ) { return false; From 14ceb7562eb84e40c096b35e3120f2cf8a4e9d8e Mon Sep 17 00:00:00 2001 From: Ryan Welcher Date: Fri, 22 Feb 2019 17:09:31 -0500 Subject: [PATCH 39/66] Update headers and changelog --- CHANGELOG.md | 4 ++++ distributor.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2efd87811..bad7e61c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file, per [the Keep a Changelog standard](http://keepachangelog.com/). +## [ 1.3.9 ] - 2019-02-21 +### Fixed +* Ensure posts distributed as draft can be published. + ## [ 1.3.8 ] - 2019-01-30 ### Added * Add `dt_after_set_meta` action. diff --git a/distributor.php b/distributor.php index 84753f2e3..5074d9307 100644 --- a/distributor.php +++ b/distributor.php @@ -2,7 +2,7 @@ /** * Plugin Name: Distributor * Description: Makes it easy to syndicate and reuse content across your websites, whether inside of a multisite or across the web. - * Version: 1.3.8 + * Version: 1.3.10 * Author: 10up Inc. * Author URI: https://distributorplugin.com * License: GPLv2 or later @@ -17,7 +17,7 @@ exit; // Exit if accessed directly. } -define( 'DT_VERSION', '1.3.8-dev' ); +define( 'DT_VERSION', '1.3.10-dev' ); define( 'DT_PLUGIN_FILE', preg_replace( '#^.*plugins/(.*)$#i', '$1', __FILE__ ) ); // Define a constant if we're network activated to allow plugin to respond accordingly. From c1b1b4cb5e06e9aad4800aa21c9161363ce74307 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Sat, 2 Mar 2019 11:58:39 -0500 Subject: [PATCH 40/66] Start puppeteer conversion --- tests/wpacceptance/DistributedPostTest.php | 8 ++++++-- tests/wpacceptance/ExternalConnectionCreateTest.php | 2 +- tests/wpacceptance/InternalPullTest.php | 6 +++--- tests/wpacceptance/InternalPushTest.php | 6 +++--- tests/wpacceptance/LinkUnlinkTest.php | 2 +- tests/wpacceptance/OembedTest.php | 8 ++++---- tests/wpacceptance/PushMenuTest.php | 6 +++--- tests/wpacceptance/SettingsTest.php | 4 ++-- tests/wpacceptance/includes/TestCase.php | 6 +++--- 9 files changed, 26 insertions(+), 22 deletions(-) diff --git a/tests/wpacceptance/DistributedPostTest.php b/tests/wpacceptance/DistributedPostTest.php index 5adcd2bbc..9fca75d21 100644 --- a/tests/wpacceptance/DistributedPostTest.php +++ b/tests/wpacceptance/DistributedPostTest.php @@ -15,10 +15,14 @@ class DistributedPost extends \TestCase { * locations */ public function testDistributedCount() { - $I = $this->getAnonymousUser(); + $I = $this->openBrowserPage(); $I->loginAs( 'wpsnapshots' ); + self::assertPostFieldContains( 40, 'post_title', 'Test Post' ); + + return; + // Distribute post $post_info = $this->pushPost( $I, 40, 2 ); @@ -42,7 +46,7 @@ public function testDistributedCount() { * Test UI for a post that has been distributed (not original) */ public function testDistributedFrom() { - $I = $this->getAnonymousUser(); + $I = $this->openBrowserPage(); $I->loginAs( 'wpsnapshots' ); diff --git a/tests/wpacceptance/ExternalConnectionCreateTest.php b/tests/wpacceptance/ExternalConnectionCreateTest.php index a05d5b30d..fe085628c 100644 --- a/tests/wpacceptance/ExternalConnectionCreateTest.php +++ b/tests/wpacceptance/ExternalConnectionCreateTest.php @@ -16,7 +16,7 @@ class ExternalConnectionCreateTest extends \TestCase { * Test creating an external connection. Test various connection statuses */ public function testCreateExternalConnection() { - $I = $this->getAnonymousUser(); + $I = $this->openBrowserPage(); $I->loginAs( 'wpsnapshots' ); diff --git a/tests/wpacceptance/InternalPullTest.php b/tests/wpacceptance/InternalPullTest.php index 5e007af87..2d897a386 100644 --- a/tests/wpacceptance/InternalPullTest.php +++ b/tests/wpacceptance/InternalPullTest.php @@ -14,7 +14,7 @@ class InternalPullTest extends \TestCase { * Test the correct posts show in "new", "pulled", "skipped" */ public function testPostShowingPerStatus() { - $I = $this->getAnonymousUser(); + $I = $this->openBrowserPage(); $I->loginAs( 'wpsnapshots' ); @@ -43,7 +43,7 @@ public function testPostShowingPerStatus() { * Test pulling a post */ public function testPullPost() { - $I = $this->getAnonymousUser(); + $I = $this->openBrowserPage(); $I->loginAs( 'wpsnapshots' ); @@ -68,7 +68,7 @@ public function testPullPost() { * Test skipping a post */ public function testSkipPost() { - $I = $this->getAnonymousUser(); + $I = $this->openBrowserPage(); $I->loginAs( 'wpsnapshots' ); diff --git a/tests/wpacceptance/InternalPushTest.php b/tests/wpacceptance/InternalPushTest.php index b9161f07b..87209d6be 100644 --- a/tests/wpacceptance/InternalPushTest.php +++ b/tests/wpacceptance/InternalPushTest.php @@ -16,7 +16,7 @@ class InternalPushTest extends \TestCase { * Test pushing a draft */ public function testPushDraftPost() { - $I = $this->getAnonymousUser(); + $I = $this->openBrowserPage(); $I->loginAs( 'wpsnapshots' ); @@ -34,7 +34,7 @@ public function testPushDraftPost() { * Test pushing as published */ public function testPushPublishPost() { - $I = $this->getAnonymousUser(); + $I = $this->openBrowserPage(); $I->loginAs( 'wpsnapshots' ); @@ -52,7 +52,7 @@ public function testPushPublishPost() { * Test that all data gets synced on push */ public function testPushDataSync() { - $I = $this->getAnonymousUser(); + $I = $this->openBrowserPage(); $I->loginAs( 'wpsnapshots' ); diff --git a/tests/wpacceptance/LinkUnlinkTest.php b/tests/wpacceptance/LinkUnlinkTest.php index 139c7a2c1..3484b4216 100644 --- a/tests/wpacceptance/LinkUnlinkTest.php +++ b/tests/wpacceptance/LinkUnlinkTest.php @@ -14,7 +14,7 @@ class LinkUnlinkTest extends \TestCase { * Test unlinking */ public function testUnlinkPublishPost() { - $I = $this->getAnonymousUser(); + $I = $this->openBrowserPage(); $I->loginAs( 'wpsnapshots' ); diff --git a/tests/wpacceptance/OembedTest.php b/tests/wpacceptance/OembedTest.php index 69dcd99a3..7e0f02bfc 100644 --- a/tests/wpacceptance/OembedTest.php +++ b/tests/wpacceptance/OembedTest.php @@ -14,7 +14,7 @@ class OembedTests extends \TestCase { * Test network pushing content with an oEmbed. */ public function testOembedNetworkPushedContent() { - $I = $this->getAnonymousUser(); + $I = $this->openBrowserPage(); $I->loginAs( 'wpsnapshots' ); @@ -42,7 +42,7 @@ public function testOembedNetworkPushedContent() { * Test network pulling content with an oEmbed. */ public function testOembedNetworkPulledContent() { - $I = $this->getAnonymousUser(); + $I = $this->openBrowserPage(); $I->loginAs( 'wpsnapshots' ); @@ -69,7 +69,7 @@ public function testOembedNetworkPulledContent() { * Test external pushing content with an oEmbed. */ public function testOembedExternalPushedContent() { - $I = $this->getAnonymousUser(); + $I = $this->openBrowserPage(); $I->loginAs( 'wpsnapshots' ); @@ -118,7 +118,7 @@ public function testOembedExternalPushedContent() { * Test external pulling content with an oEmbed. */ public function testOembedExternalPulledContent() { - $I = $this->getAnonymousUser(); + $I = $this->openBrowserPage(); $I->loginAs( 'wpsnapshots' ); diff --git a/tests/wpacceptance/PushMenuTest.php b/tests/wpacceptance/PushMenuTest.php index 0cda1a597..c5e230908 100644 --- a/tests/wpacceptance/PushMenuTest.php +++ b/tests/wpacceptance/PushMenuTest.php @@ -13,7 +13,7 @@ class PushMenuTest extends \TestCase { * Test that the menu shows on hover */ public function testMenuItemHover() { - $I = $this->getAnonymousUser(); + $I = $this->openBrowserPage(); $I->loginAs( 'wpsnapshots' ); @@ -32,7 +32,7 @@ public function testMenuItemHover() { * Test connection cross out */ public function testConnectionCrossOutOnPush() { - $I = $this->getAnonymousUser(); + $I = $this->openBrowserPage(); $I->loginAs( 'wpsnapshots' ); @@ -61,7 +61,7 @@ public function testConnectionCrossOutOnPush() { * Test that we can select connections properly */ public function testSelectConnection() { - $I = $this->getAnonymousUser(); + $I = $this->openBrowserPage(); $I->loginAs( 'wpsnapshots' ); diff --git a/tests/wpacceptance/SettingsTest.php b/tests/wpacceptance/SettingsTest.php index d009d6cba..7ee19e1d6 100644 --- a/tests/wpacceptance/SettingsTest.php +++ b/tests/wpacceptance/SettingsTest.php @@ -14,7 +14,7 @@ class SettingsTest extends \TestCase { * Test that settings actually save */ public function testSettingsSave() { - $I = $this->getAnonymousUser(); + $I = $this->openBrowserPage(); $I->loginAs( 'wpsnapshots' ); @@ -51,7 +51,7 @@ public function testSettingsSave() { * Test author bylines */ public function testAuthorBylineSetting() { - $I = $this->getAnonymousUser(); + $I = $this->openBrowserPage(); $I->loginAs( 'wpsnapshots' ); diff --git a/tests/wpacceptance/includes/TestCase.php b/tests/wpacceptance/includes/TestCase.php index de55270d0..49505c9e2 100644 --- a/tests/wpacceptance/includes/TestCase.php +++ b/tests/wpacceptance/includes/TestCase.php @@ -30,9 +30,9 @@ protected function pushPost( \WPAcceptance\PHPUnit\Actor $I, $post_id, $to_conne $I->moveTo( $info['original_edit_url'] ); try { - $info['original_front_url'] = $I->getElement( '#wp-admin-bar-view a')->getAttribute( 'href' ); + $info['original_front_url'] = $I->getElementAttribute( '#wp-admin-bar-view a', 'href' ); } catch ( \Exception $e ) { - $info['original_front_url'] = $I->getElement( '#wp-admin-bar-preview a')->getAttribute( 'href' ); + $info['original_front_url'] = $I->getElementAttribute( '#wp-admin-bar-preview a', 'href' ); } $I->waitUntilElementVisible( '#wp-admin-bar-distributor a' ); @@ -70,7 +70,7 @@ protected function pushPost( \WPAcceptance\PHPUnit\Actor $I, $post_id, $to_conne $info['distributed_edit_url'] = $I->getCurrentUrl(); - $info['distributed_post_id'] = (int) $I->getElement( '#post_ID' )->getAttribute( 'value' ); + $info['distributed_post_id'] = (int) $I->getElementAttribute( '#post_ID', 'value' ); } return $info; From 312ce6fe65efd43b69300c3348061e0c2adf6777 Mon Sep 17 00:00:00 2001 From: Adam Silverstein Date: Tue, 5 Mar 2019 08:21:12 -0700 Subject: [PATCH 41/66] Previous to Gutenberg 5.0, `use_block_editor_for_post` was named `gutenberg_can_edit_post` --- includes/utils.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/includes/utils.php b/includes/utils.php index eb149f3c7..d1fc29629 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -46,6 +46,15 @@ function is_using_gutenberg( $post ) { if ( ! function_exists( 'use_block_editor_for_post' ) ) { include_once ABSPATH . 'wp-admin/includes/post.php'; } + + // Previous to Gutenberg 5.0, `use_block_editor_for_post` was named `gutenberg_can_edit_post`. + if ( ! function_exists( 'use_block_editor_for_post' ) ) { + if ( function_exists( 'gutenberg_can_edit_post' ) ) { + return gutenberg_can_edit_post( $post ); + } + return false; + } + return use_block_editor_for_post( $post ); } From bd46e66608b87b23e8aa17bc905d7d41ca30bfab Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Tue, 5 Mar 2019 11:26:07 -0500 Subject: [PATCH 42/66] Puppeteer test tweaks --- .../ExternalConnectionCreateTest.php | 10 ++--- tests/wpacceptance/InternalPullTest.php | 2 +- tests/wpacceptance/InternalPushTest.php | 39 ++++++++++++------- tests/wpacceptance/OembedTest.php | 26 +++++-------- tests/wpacceptance/PushMenuTest.php | 4 ++ tests/wpacceptance/includes/TestCase.php | 4 +- 6 files changed, 48 insertions(+), 37 deletions(-) diff --git a/tests/wpacceptance/ExternalConnectionCreateTest.php b/tests/wpacceptance/ExternalConnectionCreateTest.php index fe085628c..837260878 100644 --- a/tests/wpacceptance/ExternalConnectionCreateTest.php +++ b/tests/wpacceptance/ExternalConnectionCreateTest.php @@ -22,25 +22,25 @@ public function testCreateExternalConnection() { $I->moveTo( 'wp-admin/post-new.php?post_type=dt_ext_connection' ); - $I->fillField( '#title', 'Test External Connection' ); + $I->typeInField( '#title', 'Test External Connection' ); // First test no connection warning - $I->fillField( '#dt_external_connection_url', 'badurl' ); + $I->typeInField( '#dt_external_connection_url', 'badurl' ); $I->waitUntilElementContainsText( 'No connection found', '.endpoint-result' ); // Now test limited connection warning - $I->fillField( '#dt_username', 'wpsnapshots' ); + $I->typeInField( '#dt_username', 'wpsnapshots' ); - $I->fillField( '#dt_external_connection_url', $this->getWPHomeUrl() . '/two/wp-json' ); + $I->typeInField( '#dt_external_connection_url', $this->getWPHomeUrl() . '/two/wp-json' ); $I->waitUntilElementContainsText( 'Limited connection', '.endpoint-result' ); // Now test good connection - $I->fillField( '#dt_password', 'password' ); + $I->typeInField( '#dt_password', 'password' ); $I->waitUntilElementContainsText( 'Connection established', '.endpoint-result' ); diff --git a/tests/wpacceptance/InternalPullTest.php b/tests/wpacceptance/InternalPullTest.php index 2d897a386..55b620f47 100644 --- a/tests/wpacceptance/InternalPullTest.php +++ b/tests/wpacceptance/InternalPullTest.php @@ -76,7 +76,7 @@ public function testSkipPost() { $I->waitUntilElementVisible( '.wp-list-table' ); - $I->selectOptions( '#bulk-action-selector-top', 'bulk-skip' ); + $I->selectOptionByValue( '#bulk-action-selector-top', 'bulk-skip' ); $I->checkOptions( '.wp-list-table #cb-select-40'); diff --git a/tests/wpacceptance/InternalPushTest.php b/tests/wpacceptance/InternalPushTest.php index 87209d6be..99afc969f 100644 --- a/tests/wpacceptance/InternalPushTest.php +++ b/tests/wpacceptance/InternalPushTest.php @@ -66,23 +66,27 @@ public function testPushDataSync() { // Add custom meta $I->click( '#show-settings-link' ); - usleep( 500 ); - $I->checkOptions( '#postcustom-hide' ); - $I->click( '#enternew' ); - $I->fillField( '#metakeyinput', 'custom_meta_key' ); - $I->fillField( '#metavalue', 'custom_meta_value' ); + $I->waitUntilElementVisible( '#enternew' ); + + $I->jsClick( '#enternew' ); + + $I->waitUntilElementVisible( '#metakeyinput' ); + + $I->setElementProperty( '#metakeyinput', 'value', 'custom_meta_key' ); + $I->setElementProperty( '#metavalue', 'value', 'custom_meta_value' ); + $I->click( '#newmeta-submit' ); // Add tag - $I->fillField( '#new-tag-post_tag', 'tag-one' ); + $I->setElementProperty( '#new-tag-post_tag', 'value', 'tag-one' ); $I->click( '.tagadd' ); // Add category $I->click( '#category-add-toggle' ); usleep( 500 ); - $I->fillField( '#newcategory', 'New Category' ); + $I->setElementProperty( '#newcategory', 'value', 'Test Category' ); $I->click( '#category-add-submit' ); $I->scrollTo( 0, 0 ); @@ -93,6 +97,9 @@ public function testPushDataSync() { // Set featured image $I->click( '#set-post-thumbnail' ); + + $I->waitUntilElementVisible( '.media-modal-content' ); + $I->attachFile( '.media-modal-content input[type="file"]', __DIR__ . '/img/browser-frame.jpg' ); $I->waitUntilElementEnabled( '.media-modal-content .media-button-select' ); @@ -126,21 +133,27 @@ public function testPushDataSync() { $I->seeElement( '#postimagediv img' ); // See content - $I->seeValueInAttribute( '#content', 'value', 'The content' ); + $I->seeFieldValue( '#content', 'The content' ); // Check custom meta $I->click( '#show-settings-link' ); - usleep( 500 ); - $I->checkOptions( '#postcustom-hide' ); $I->seeTextInSource( 'custom_meta_key' ); $I->seeTextInSource( 'custom_meta_value' ); // Get Element containing category, then check it for checked input - $category_parent = $I->getElementContaining( 'New Category' ); - $checked_input = $category_parent->findElement( WebDriverBy::cssSelector( 'input:checked') ); + $category_parent = $I->getElementContaining( 'Test Category' ); + + foreach ( $category_parent as $element ) { + if ( 'LABEL' === $I->getElementTagName( $element ) ) { + $category_parent = $element; + break; + } + } + + $checked = $I->getElement( 'input:checked', $category_parent ); - $this->assertTrue( ! empty( $checked_input ) ); + $this->assertTrue( ! empty( $checked ) ); } } diff --git a/tests/wpacceptance/OembedTest.php b/tests/wpacceptance/OembedTest.php index 7e0f02bfc..e0f9557cb 100644 --- a/tests/wpacceptance/OembedTest.php +++ b/tests/wpacceptance/OembedTest.php @@ -28,12 +28,10 @@ public function testOembedNetworkPushedContent() { // Grab the post content. $I->waitUntilElementVisible( '.wp-editor-area' ); - $content = $I->getElement( '.wp-editor-area' ); // Test the distributed post content. - $this->assertEquals( - "

https://twitter.com/10up/status/1067517868441387008

\n

 

", - $content->getText(), + $this->assertTrue( + (bool) preg_match( '#https://twitter.com/10up/status/1067517868441387008#', $I->getElementProperty( '.wp-editor-area', 'value' ) ), 'oEmbed was not pushed properly over a network connection' ); } @@ -55,12 +53,10 @@ public function testOembedNetworkPulledContent() { // Grab the post content. $I->waitUntilElementVisible( '.wp-editor-area' ); - $content = $I->getElement( '.wp-editor-area' ); // Test the distributed post content. - $this->assertEquals( - "https://twitter.com/10up/status/1067517868441387008\n\n ", - $content->getText(), + $this->assertTrue( + (bool) preg_match( '#https://twitter.com/10up/status/1067517868441387008#', $I->getElementProperty( '.wp-editor-area', 'value' ) ), 'oEmbed was not pulled properly over a network connection' ); } @@ -96,7 +92,7 @@ public function testOembedExternalPushedContent() { // Switch to the distributed post. $I->waitUntilElementVisible( '#the-list' ); - $I->jsClick( 'a.row-title' ); + $I->click( 'a.row-title' ); // Switch to the text editor. $I->waitUntilElementVisible( '#content-html' ); @@ -104,12 +100,10 @@ public function testOembedExternalPushedContent() { // Grab the post content. $I->waitUntilElementVisible( '.wp-editor-area' ); - $content = $I->getElement( '.wp-editor-area' ); // Test the distributed post content. - $this->assertEquals( - "

https://twitter.com/10up/status/1067517868441387008

\n

 

", - $content->getText(), + $this->assertTrue( + (bool) preg_match( '#https://twitter.com/10up/status/1067517868441387008#', $I->getElementProperty( '.wp-editor-area', 'value' ) ), 'oEmbed was not pushed properly over an external connection' ); } @@ -151,12 +145,10 @@ public function testOembedExternalPulledContent() { // Grab the post content. $I->waitUntilElementVisible( '.wp-editor-area' ); - $content = $I->getElement( '.wp-editor-area' ); // Test the distributed post content. - $this->assertEquals( - "

https://twitter.com/10up/status/1067517868441387008

\n

 

", - $content->getText(), + $this->assertTrue( + (bool) preg_match( '#https://twitter.com/10up/status/1067517868441387008#', $I->getElementProperty( '.wp-editor-area', 'value' ) ), 'oEmbed was not pulled properly over an external connection' ); } diff --git a/tests/wpacceptance/PushMenuTest.php b/tests/wpacceptance/PushMenuTest.php index c5e230908..29b81578e 100644 --- a/tests/wpacceptance/PushMenuTest.php +++ b/tests/wpacceptance/PushMenuTest.php @@ -44,6 +44,8 @@ public function testConnectionCrossOutOnPush() { $I->click( '#wp-admin-bar-distributor a' ); + $I->waitUntilElementVisible( '#distributor-push-wrapper .new-connections-list' ); + $I->click( '#distributor-push-wrapper .new-connections-list .add-connection[data-connection-id="2"]' ); usleep( 500 ); @@ -73,6 +75,8 @@ public function testSelectConnection() { $I->click( '#wp-admin-bar-distributor a' ); + $I->waitUntilElementVisible( '#distributor-push-wrapper .new-connections-list' ); + $I->click( '#distributor-push-wrapper .new-connections-list .add-connection[data-connection-id="2"]' ); usleep( 500 ); diff --git a/tests/wpacceptance/includes/TestCase.php b/tests/wpacceptance/includes/TestCase.php index 49505c9e2..7e48314d6 100644 --- a/tests/wpacceptance/includes/TestCase.php +++ b/tests/wpacceptance/includes/TestCase.php @@ -41,6 +41,8 @@ protected function pushPost( \WPAcceptance\PHPUnit\Actor $I, $post_id, $to_conne $I->click( '#wp-admin-bar-distributor a' ); + $I->waitUntilElementVisible( '#distributor-push-wrapper .new-connections-list' ); + // Distribute post $I->click( '#distributor-push-wrapper .new-connections-list .add-connection[data-connection-id="' . $to_connection_id . '"]' ); @@ -103,7 +105,7 @@ protected function pullPost( \WPAcceptance\PHPUnit\Actor $I, $original_post_id, $I->moveTo( $to_blog_slug . 'wp-admin/admin.php?page=pull' ); if ( $use_connection ) { - $I->selectOptions( '#pull_connections', $use_connection ); + $I->checkOptions( '#pull_connections', $use_connection ); $I->waitUntilElementVisible( '.wp-list-table #cb-select-' . $original_post_id ); } From 0ae49433d0f604ab285f6a3392063680580927a5 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Tue, 5 Mar 2019 11:43:26 -0500 Subject: [PATCH 43/66] Update composer --- .travis.yml | 1 - composer.json | 4 +- composer.lock | 1297 +++++++++-------- .../plugin-update-checker/Puc/v4/Factory.php | 2 +- .../Puc/v4p4/Plugin/UpdateChecker.php | 740 ---------- .../Puc/{v4p4 => v4p5}/Autoloader.php | 4 +- .../Puc/{v4p4 => v4p5}/DebugBar/Extension.php | 16 +- .../Puc/{v4p4 => v4p5}/DebugBar/Panel.php | 6 +- .../DebugBar/PluginExtension.php | 8 +- .../{v4p4 => v4p5}/DebugBar/PluginPanel.php | 6 +- .../{v4p4 => v4p5}/DebugBar/ThemePanel.php | 6 +- .../Puc/{v4p4 => v4p5}/Factory.php | 17 +- .../Puc/v4p5/InstalledPackage.php | 103 ++ .../Puc/{v4p4 => v4p5}/Metadata.php | 4 +- .../Puc/{v4p4 => v4p5}/OAuthSignature.php | 18 +- .../Puc/{v4p4 => v4p5}/Plugin/Info.php | 4 +- .../Puc/v4p5/Plugin/Package.php | 184 +++ .../Puc/v4p5/Plugin/Ui.php | 277 ++++ .../Puc/{v4p4 => v4p5}/Plugin/Update.php | 16 +- .../Puc/v4p5/Plugin/UpdateChecker.php | 396 +++++ .../Puc/{v4p4 => v4p5}/Scheduler.php | 10 +- .../Puc/{v4p4 => v4p5}/StateStore.php | 18 +- .../Puc/v4p5/Theme/Package.php | 65 + .../Puc/{v4p4 => v4p5}/Theme/Update.php | 8 +- .../{v4p4 => v4p5}/Theme/UpdateChecker.php | 61 +- .../Puc/{v4p4 => v4p5}/Update.php | 4 +- .../Puc/{v4p4 => v4p5}/UpdateChecker.php | 172 ++- .../Puc/{v4p4 => v4p5}/UpgraderStatus.php | 4 +- .../Puc/{v4p4 => v4p5}/Utils.php | 4 +- .../Puc/{v4p4 => v4p5}/Vcs/Api.php | 14 +- .../Puc/{v4p4 => v4p5}/Vcs/BaseChecker.php | 6 +- .../Puc/{v4p4 => v4p5}/Vcs/BitBucketApi.php | 22 +- .../Puc/{v4p4 => v4p5}/Vcs/GitHubApi.php | 20 +- .../Puc/{v4p4 => v4p5}/Vcs/GitLabApi.php | 59 +- .../Vcs/PluginUpdateChecker.php | 30 +- .../Puc/{v4p4 => v4p5}/Vcs/Reference.php | 4 +- .../{v4p4 => v4p5}/Vcs/ThemeUpdateChecker.php | 24 +- .../plugin-update-checker/README.md | 31 +- .../languages/plugin-update-checker-fr_CA.mo | Bin 0 -> 1208 bytes .../languages/plugin-update-checker-fr_CA.po | 48 + .../languages/plugin-update-checker-nl_BE.mo | Bin 0 -> 1211 bytes .../languages/plugin-update-checker-nl_BE.po | 48 + .../languages/plugin-update-checker-nl_NL.mo | Bin 0 -> 1211 bytes .../languages/plugin-update-checker-nl_NL.po | 48 + .../plugin-update-checker.php | 24 +- .../vendor/readme-parser.php | 23 +- 46 files changed, 2231 insertions(+), 1625 deletions(-) delete mode 100644 vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Plugin/UpdateChecker.php rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/Autoloader.php (94%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/DebugBar/Extension.php (91%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/DebugBar/Panel.php (96%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/DebugBar/PluginExtension.php (75%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/DebugBar/PluginPanel.php (82%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/DebugBar/ThemePanel.php (68%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/Factory.php (94%) create mode 100644 vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/InstalledPackage.php rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/Metadata.php (97%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/OAuthSignature.php (88%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/Plugin/Info.php (97%) create mode 100644 vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Plugin/Package.php create mode 100644 vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Plugin/Ui.php rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/Plugin/Update.php (87%) create mode 100644 vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Plugin/UpdateChecker.php rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/Scheduler.php (96%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/StateStore.php (89%) create mode 100644 vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Theme/Package.php rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/Theme/Update.php (89%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/Theme/UpdateChecker.php (70%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/Update.php (84%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/UpdateChecker.php (89%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/UpgraderStatus.php (98%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/Utils.php (96%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/Vcs/Api.php (96%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/Vcs/BaseChecker.php (75%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/Vcs/BitBucketApi.php (92%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/Vcs/GitHubApi.php (96%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/Vcs/GitLabApi.php (79%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/Vcs/PluginUpdateChecker.php (87%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/Vcs/Reference.php (92%) rename vendor/yahnis-elsts/plugin-update-checker/Puc/{v4p4 => v4p5}/Vcs/ThemeUpdateChecker.php (79%) create mode 100644 vendor/yahnis-elsts/plugin-update-checker/languages/plugin-update-checker-fr_CA.mo create mode 100644 vendor/yahnis-elsts/plugin-update-checker/languages/plugin-update-checker-fr_CA.po create mode 100644 vendor/yahnis-elsts/plugin-update-checker/languages/plugin-update-checker-nl_BE.mo create mode 100644 vendor/yahnis-elsts/plugin-update-checker/languages/plugin-update-checker-nl_BE.po create mode 100644 vendor/yahnis-elsts/plugin-update-checker/languages/plugin-update-checker-nl_NL.mo create mode 100644 vendor/yahnis-elsts/plugin-update-checker/languages/plugin-update-checker-nl_NL.po diff --git a/.travis.yml b/.travis.yml index 4f9f31163..6329a1e81 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,6 @@ script: - if [ -n "$AWS_ACCESS_KEY" ]; then ./vendor/bin/wpsnapshots configure 10up --aws_key=$AWS_ACCESS_KEY --aws_secret=$SECRET_ACCESS_KEY --user_name=Travis --user_email=travis@10up.com; fi - if [ -n "$AWS_ACCESS_KEY" ]; then bash run-wpacceptance.sh; fi - composer run-script lint - - ./vendor/bin/phpunit notifications: email: false sudo: required diff --git a/composer.json b/composer.json index 2e1c572e3..babcdb6be 100644 --- a/composer.json +++ b/composer.json @@ -17,10 +17,8 @@ } }, "require-dev": { - "10up/wp_mock": "dev-dev", "10up/phpcs-composer": "dev-master", - "phpunit/phpunit": "^6.5", - "10up/wpacceptance": "~0.10.0" + "10up/wpacceptance": "~0.12.0" }, "scripts": { "lint": "phpcs .", diff --git a/composer.lock b/composer.lock index a02839a11..dbfdad631 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8aa029e6e924ae44a425030f73928577", + "content-hash": "3175aad4d6366c50bfd6e7f7b0236b1d", "packages": [ { "name": "yahnis-elsts/plugin-update-checker", - "version": "v4.4", + "version": "v4.5.1", "source": { "type": "git", "url": "https://github.com/YahnisElsts/plugin-update-checker.git", - "reference": "da4286343601e1f5c01836e1d51e1c57cedb0f6d" + "reference": "57a25d905a9a4db2fdb60bc8f0b0f861cc3ee110" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/YahnisElsts/plugin-update-checker/zipball/da4286343601e1f5c01836e1d51e1c57cedb0f6d", - "reference": "da4286343601e1f5c01836e1d51e1c57cedb0f6d", + "url": "https://api.github.com/repos/YahnisElsts/plugin-update-checker/zipball/57a25d905a9a4db2fdb60bc8f0b0f861cc3ee110", + "reference": "57a25d905a9a4db2fdb60bc8f0b0f861cc3ee110", "shasum": "" }, "require": { @@ -49,7 +49,7 @@ "theme updates", "wordpress" ], - "time": "2017-12-22T10:39:11+00:00" + "time": "2019-01-04T17:13:39+00:00" } ], "packages-dev": [ @@ -59,28 +59,21 @@ "source": { "type": "git", "url": "https://github.com/10up/phpcs-composer.git", - "reference": "4ce232a05a4ad5a09d03abaf9ee55c710dd3f410" + "reference": "00940fa9732fb0069d7b4624f10bb46fdf7e1a28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/10up/phpcs-composer/zipball/4ce232a05a4ad5a09d03abaf9ee55c710dd3f410", - "reference": "4ce232a05a4ad5a09d03abaf9ee55c710dd3f410", + "url": "https://api.github.com/repos/10up/phpcs-composer/zipball/00940fa9732fb0069d7b4624f10bb46fdf7e1a28", + "reference": "00940fa9732fb0069d7b4624f10bb46fdf7e1a28", "shasum": "" }, "require": { - "composer-plugin-api": "^1.1", - "wimg/php-compatibility": "*", + "dealerdirect/phpcodesniffer-composer-installer": "*", + "phpcompatibility/phpcompatibility-wp": "^2", + "squizlabs/php_codesniffer": "^3.4.0", "wp-coding-standards/wpcs": "*" }, - "type": "composer-plugin", - "extra": { - "class": "TenUp\\PHPCS_Composer\\PHPCSConfig" - }, - "autoload": { - "psr-4": { - "TenUp\\PHPCS_Composer\\": "src/" - } - }, + "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" @@ -91,69 +84,29 @@ "email": "ephraim.gregor@10up.com" } ], - "time": "2018-11-22T01:54:34+00:00" - }, - { - "name": "10up/wp_mock", - "version": "dev-dev", - "source": { - "type": "git", - "url": "https://github.com/10up/wp_mock.git", - "reference": "0354413d63cbae920ffc0676443c6d9dd330ce40" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/10up/wp_mock/zipball/0354413d63cbae920ffc0676443c6d9dd330ce40", - "reference": "0354413d63cbae920ffc0676443c6d9dd330ce40", - "shasum": "" - }, - "require": { - "antecedent/patchwork": "^2.1", - "mockery/mockery": "^1.0", - "php": ">=7.0", - "phpunit/phpunit": ">=6.0" - }, - "require-dev": { - "behat/behat": "^3.0", - "satooshi/php-coveralls": "^1.0", - "sebastian/comparator": ">=1.2.3" - }, - "type": "library", - "autoload": { - "psr-4": { - "WP_Mock\\": "./php/WP_Mock" - }, - "classmap": [ - "php/WP_Mock.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0+" - ], - "description": "A mocking library to take the pain out of unit testing for WordPress", - "time": "2017-12-03T19:27:57+00:00" + "time": "2019-03-04T14:40:41+00:00" }, { "name": "10up/wpacceptance", - "version": "0.10.1", + "version": "0.12", "source": { "type": "git", "url": "https://github.com/10up/wpacceptance.git", - "reference": "4458e327ba515946173475f4f3c67d9aeeebcad5" + "reference": "c7c178a533ed7ca9a5fc8611201543f25511fe37" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/10up/wpacceptance/zipball/4458e327ba515946173475f4f3c67d9aeeebcad5", - "reference": "4458e327ba515946173475f4f3c67d9aeeebcad5", + "url": "https://api.github.com/repos/10up/wpacceptance/zipball/c7c178a533ed7ca9a5fc8611201543f25511fe37", + "reference": "c7c178a533ed7ca9a5fc8611201543f25511fe37", "shasum": "" }, "require": { "10up/wpsnapshots": "~1.5", "docker-php/docker-php": "^2.0", "facebook/webdriver": "^1.6", - "php": ">=7.1", - "phpunit/phpunit": "^6.5", + "nesk/puphpeteer": "^1.4", + "php": ">=7.2", + "phpunit/phpunit": "^7.5", "symfony/console": "^3.3" }, "require-dev": { @@ -187,20 +140,20 @@ "testing", "wordpress" ], - "time": "2019-01-08T15:32:20+00:00" + "time": "2019-03-05T16:32:54+00:00" }, { "name": "10up/wpsnapshots", - "version": "1.5.2", + "version": "1.5.3", "source": { "type": "git", "url": "https://github.com/10up/wpsnapshots.git", - "reference": "3aa7dad9994c7a9244b596bbd5a32e31dd87877e" + "reference": "5c3c70464dd38917f6b1d8d7e43d767c885a760a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/10up/wpsnapshots/zipball/3aa7dad9994c7a9244b596bbd5a32e31dd87877e", - "reference": "3aa7dad9994c7a9244b596bbd5a32e31dd87877e", + "url": "https://api.github.com/repos/10up/wpsnapshots/zipball/5c3c70464dd38917f6b1d8d7e43d767c885a760a", + "reference": "5c3c70464dd38917f6b1d8d7e43d767c885a760a", "shasum": "" }, "require": { @@ -240,68 +193,26 @@ "snapshots", "wordpress" ], - "time": "2018-11-15T04:50:03+00:00" - }, - { - "name": "antecedent/patchwork", - "version": "2.1.8", - "source": { - "type": "git", - "url": "https://github.com/antecedent/patchwork.git", - "reference": "3bb81ace3914c220aa273d1c0603d5e1b454c0d7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/antecedent/patchwork/zipball/3bb81ace3914c220aa273d1c0603d5e1b454c0d7", - "reference": "3bb81ace3914c220aa273d1c0603d5e1b454c0d7", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "type": "library", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ignas Rudaitis", - "email": "ignas.rudaitis@gmail.com" - } - ], - "description": "Method redefinition (monkey-patching) functionality for PHP.", - "homepage": "http://patchwork2.org/", - "keywords": [ - "aop", - "aspect", - "interception", - "monkeypatching", - "redefinition", - "runkit", - "testing" - ], - "time": "2018-02-19T18:52:50+00:00" + "time": "2018-12-10T04:37:49+00:00" }, { "name": "aws/aws-sdk-php", - "version": "3.80.3", + "version": "3.87.23", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "f1f724c48a49350250950d80d16b348e5e748e3c" + "reference": "4f042410335c06aa7ab81365194782a30c144bc2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/f1f724c48a49350250950d80d16b348e5e748e3c", - "reference": "f1f724c48a49350250950d80d16b348e5e748e3c", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/4f042410335c06aa7ab81365194782a30c144bc2", + "reference": "4f042410335c06aa7ab81365194782a30c144bc2", "shasum": "" }, "require": { "ext-json": "*", "ext-pcre": "*", "ext-simplexml": "*", - "ext-spl": "*", "guzzlehttp/guzzle": "^5.3.3|^6.2.1", "guzzlehttp/promises": "~1.0", "guzzlehttp/psr7": "^1.4.1", @@ -364,7 +275,62 @@ "s3", "sdk" ], - "time": "2018-12-04T20:31:51+00:00" + "time": "2019-03-04T19:19:05+00:00" + }, + { + "name": "clue/socket-raw", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/clue/php-socket-raw.git", + "reference": "2f6654445233407900c9a804490cecd8e4f2ae86" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/php-socket-raw/zipball/2f6654445233407900c9a804490cecd8e4f2ae86", + "reference": "2f6654445233407900c9a804490cecd8e4f2ae86", + "shasum": "" + }, + "require": { + "ext-sockets": "*", + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "^7.0 || ^6.0 || ^5.2 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "Socket\\Raw\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@lueck.tv" + } + ], + "description": "Simple and lightweight OOP wrapper for PHP's low level sockets extension (ext-sockets)", + "homepage": "https://github.com/clue/php-socket-raw", + "keywords": [ + "Socket", + "client", + "datagram", + "dgram", + "icmp", + "ipv6", + "server", + "stream", + "tcp", + "udg", + "udp", + "unix" + ], + "time": "2019-01-22T11:08:01+00:00" }, { "name": "clue/stream-filter", @@ -418,6 +384,72 @@ ], "time": "2017-08-18T09:54:01+00:00" }, + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v0.5.0", + "source": { + "type": "git", + "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", + "reference": "e749410375ff6fb7a040a68878c656c2e610b132" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e749410375ff6fb7a040a68878c656c2e610b132", + "reference": "e749410375ff6fb7a040a68878c656c2e610b132", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0", + "php": "^5.3|^7", + "squizlabs/php_codesniffer": "^2|^3" + }, + "require-dev": { + "composer/composer": "*", + "phpcompatibility/php-compatibility": "^9.0", + "sensiolabs/security-checker": "^4.1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "time": "2018-10-26T13:21:45+00:00" + }, { "name": "docker-php/docker-php", "version": "v2.0.0", @@ -817,54 +849,6 @@ ], "time": "2018-12-04T20:46:45+00:00" }, - { - "name": "hamcrest/hamcrest-php", - "version": "v2.0.0", - "source": { - "type": "git", - "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/776503d3a8e85d4f9a1148614f95b7a608b046ad", - "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad", - "shasum": "" - }, - "require": { - "php": "^5.3|^7.0" - }, - "replace": { - "cordoval/hamcrest-php": "*", - "davedevelopment/hamcrest-php": "*", - "kodova/hamcrest-php": "*" - }, - "require-dev": { - "phpunit/php-file-iterator": "1.3.3", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "hamcrest" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD" - ], - "description": "This is the PHP port of Hamcrest Matchers", - "keywords": [ - "test" - ], - "time": "2016-01-20T08:20:44+00:00" - }, { "name": "jane-php/json-schema-runtime", "version": "v4.0.4", @@ -1430,71 +1414,6 @@ ], "time": "2018-11-26T08:09:30+00:00" }, - { - "name": "mockery/mockery", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/mockery/mockery.git", - "reference": "100633629bf76d57430b86b7098cd6beb996a35a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/100633629bf76d57430b86b7098cd6beb996a35a", - "reference": "100633629bf76d57430b86b7098cd6beb996a35a", - "shasum": "" - }, - "require": { - "hamcrest/hamcrest-php": "~2.0", - "lib-pcre": ">=7.0", - "php": ">=5.6.0" - }, - "require-dev": { - "phpunit/phpunit": "~5.7.10|~6.5|~7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "Mockery": "library/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - }, - { - "name": "Dave Marshall", - "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" - } - ], - "description": "Mockery is a simple yet flexible PHP mock object framework", - "homepage": "https://github.com/mockery/mockery", - "keywords": [ - "BDD", - "TDD", - "library", - "mock", - "mock objects", - "mockery", - "stub", - "test", - "test double", - "testing" - ], - "time": "2018-10-02T21:52:37+00:00" - }, { "name": "mtdowling/jmespath.php", "version": "2.4.0", @@ -1598,24 +1517,133 @@ ], "time": "2018-06-11T23:09:50+00:00" }, + { + "name": "nesk/puphpeteer", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/nesk/puphpeteer.git", + "reference": "34fb35e5b64488b076df25d2d69ac9d09497bda8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nesk/puphpeteer/zipball/34fb35e5b64488b076df25d2d69ac9d09497bda8", + "reference": "34fb35e5b64488b076df25d2d69ac9d09497bda8", + "shasum": "" + }, + "require": { + "nesk/rialto": "^1.2.0", + "php": ">=7.1", + "psr/log": "^1.0", + "vierbergenlars/php-semver": "^3.0.2" + }, + "require-dev": { + "codedungeon/phpunit-result-printer": ">=0.6 <1.0", + "monolog/monolog": "^1.23", + "phpunit/phpunit": "^6.5|^7.0", + "symfony/process": "^4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Nesk\\Puphpeteer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Johann Pardanaud", + "email": "pardanaud.j@gmail.com" + } + ], + "description": "A Puppeteer bridge for PHP, supporting the entire API.", + "keywords": [ + "automation", + "developer-tools", + "headless-chrome", + "php", + "puppeteer", + "testing", + "web" + ], + "time": "2018-11-27T20:52:51+00:00" + }, + { + "name": "nesk/rialto", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/nesk/rialto.git", + "reference": "0d5cefa953d3fabf37e24de5f3cbad412053f131" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nesk/rialto/zipball/0d5cefa953d3fabf37e24de5f3cbad412053f131", + "reference": "0d5cefa953d3fabf37e24de5f3cbad412053f131", + "shasum": "" + }, + "require": { + "clue/socket-raw": "^1.2", + "php": ">=7.1", + "psr/log": "^1.0", + "symfony/process": "^3.3|^4.0" + }, + "require-dev": { + "codedungeon/phpunit-result-printer": ">=0.6 <1.0", + "monolog/monolog": "^1.23", + "phpunit/phpunit": "^6.5|^7.0" + }, + "suggest": { + "ext-weakref": "Required to run all the tests" + }, + "type": "library", + "autoload": { + "psr-4": { + "Nesk\\Rialto\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Johann Pardanaud", + "email": "pardanaud.j@gmail.com" + } + ], + "description": "Manage Node resources from PHP", + "keywords": [ + "Bridge", + "Socket", + "communication", + "node", + "php", + "wrapper" + ], + "time": "2018-08-28T12:05:30+00:00" + }, { "name": "phar-io/manifest", - "version": "1.0.1", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", "shasum": "" }, "require": { "ext-dom": "*", "ext-phar": "*", - "phar-io/version": "^1.0.1", + "phar-io/version": "^2.0", "php": "^5.6 || ^7.0" }, "type": "library", @@ -1651,20 +1679,20 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05T18:14:27+00:00" + "time": "2018-07-08T19:23:20+00:00" }, { "name": "phar-io/version", - "version": "1.0.1", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", "shasum": "" }, "require": { @@ -1698,20 +1726,20 @@ } ], "description": "Library for handling version information and constraints", - "time": "2017-03-05T17:38:23+00:00" + "time": "2018-07-08T19:19:57+00:00" }, { "name": "php-http/client-common", - "version": "1.8.1", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/php-http/client-common.git", - "reference": "0b9ce659aa46aee106f8c66597ea0c070fcd9dff" + "reference": "0e156a12cc3e46f590c73bf57592a2252fc3dc48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/client-common/zipball/0b9ce659aa46aee106f8c66597ea0c070fcd9dff", - "reference": "0b9ce659aa46aee106f8c66597ea0c070fcd9dff", + "url": "https://api.github.com/repos/php-http/client-common/zipball/0e156a12cc3e46f590c73bf57592a2252fc3dc48", + "reference": "0e156a12cc3e46f590c73bf57592a2252fc3dc48", "shasum": "" }, "require": { @@ -1733,7 +1761,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.9.x-dev" } }, "autoload": { @@ -1759,28 +1787,30 @@ "http", "httplug" ], - "time": "2018-10-09T06:46:29+00:00" + "time": "2019-02-02T07:03:15+00:00" }, { "name": "php-http/discovery", - "version": "1.4.0", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/php-http/discovery.git", - "reference": "9a6cb24de552bfe1aa9d7d1569e2d49c5b169a33" + "reference": "684855f2c2e9d0a61868b8f8d6bd0295c8a4b651" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/discovery/zipball/9a6cb24de552bfe1aa9d7d1569e2d49c5b169a33", - "reference": "9a6cb24de552bfe1aa9d7d1569e2d49c5b169a33", + "url": "https://api.github.com/repos/php-http/discovery/zipball/684855f2c2e9d0a61868b8f8d6bd0295c8a4b651", + "reference": "684855f2c2e9d0a61868b8f8d6bd0295c8a4b651", "shasum": "" }, "require": { "php": "^5.5 || ^7.0" }, + "conflict": { + "nyholm/psr7": "<1.0" + }, "require-dev": { - "henrikbjorn/phpspec-code-coverage": "^2.0.2", - "php-http/httplug": "^1.0", + "php-http/httplug": "^1.0 || ^2.0", "php-http/message-factory": "^1.0", "phpspec/phpspec": "^2.4", "puli/composer-plugin": "1.0.0-beta10" @@ -1792,7 +1822,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.5-dev" } }, "autoload": { @@ -1821,7 +1851,7 @@ "message", "psr7" ], - "time": "2018-02-06T10:55:24+00:00" + "time": "2019-02-23T07:42:53+00:00" }, { "name": "php-http/httplug", @@ -2110,109 +2140,267 @@ }, { "name": "php-http/socket-client", - "version": "v1.4.0", + "version": "v1.4.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/socket-client.git", + "reference": "e2833e0242c5c4aba1bfbab1ad403019adefd4d4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/socket-client/zipball/e2833e0242c5c4aba1bfbab1ad403019adefd4d4", + "reference": "e2833e0242c5c4aba1bfbab1ad403019adefd4d4", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "php-http/discovery": "^1.0", + "php-http/httplug": "^1.0", + "php-http/message-factory": "^1.0.2", + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" + }, + "provide": { + "php-http/client-implementation": "1.0" + }, + "require-dev": { + "guzzlehttp/psr7": "^1.2", + "php-http/client-common": "^1.0", + "php-http/client-integration-tests": "^0.6", + "php-http/message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Socket\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Joel Wurtz", + "email": "jwurtz@jolicode.com" + } + ], + "description": "Socket client for PHP-HTTP", + "time": "2017-11-30T13:30:09+00:00" + }, + { + "name": "php-jsonpointer/php-jsonpointer", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/raphaelstolt/php-jsonpointer.git", + "reference": "4428f86c6f23846e9faa5a420c4ef14e485b3afb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/raphaelstolt/php-jsonpointer/zipball/4428f86c6f23846e9faa5a420c4ef14e485b3afb", + "reference": "4428f86c6f23846e9faa5a420c4ef14e485b3afb", + "shasum": "" + }, + "require": { + "php": ">=5.4" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^1.11", + "phpunit/phpunit": "4.6.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Rs\\Json": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Raphael Stolt", + "email": "raphael.stolt@gmail.com", + "homepage": "http://raphaelstolt.blogspot.com/" + } + ], + "description": "Implementation of JSON Pointer (http://tools.ietf.org/html/rfc6901)", + "homepage": "https://github.com/raphaelstolt/php-jsonpointer", + "keywords": [ + "json", + "json pointer", + "json traversal" + ], + "time": "2016-08-29T08:51:01+00:00" + }, + { + "name": "phpcompatibility/php-compatibility", + "version": "9.1.1", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "2b63c5d284ab8857f7b1d5c240ddb507a6b2293c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/2b63c5d284ab8857f7b1d5c240ddb507a6b2293c", + "reference": "2b63c5d284ab8857f7b1d5c240ddb507a6b2293c", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Contributors", + "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + }, + { + "name": "Wim Godden", + "homepage": "https://github.com/wimg", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + } + ], + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "keywords": [ + "compatibility", + "phpcs", + "standards" + ], + "time": "2018-12-30T23:16:27+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-paragonie", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/php-http/socket-client.git", - "reference": "26075bf4f98234d41d082a3bdd112a64c4d8699b" + "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", + "reference": "9160de79fcd683b5c99e9c4133728d91529753ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/socket-client/zipball/26075bf4f98234d41d082a3bdd112a64c4d8699b", - "reference": "26075bf4f98234d41d082a3bdd112a64c4d8699b", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/9160de79fcd683b5c99e9c4133728d91529753ea", + "reference": "9160de79fcd683b5c99e9c4133728d91529753ea", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "php-http/discovery": "^1.0", - "php-http/httplug": "^1.0", - "php-http/message-factory": "^1.0.2", - "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" - }, - "provide": { - "php-http/client-implementation": "1.0" + "phpcompatibility/php-compatibility": "^9.0" }, "require-dev": { - "guzzlehttp/psr7": "^1.2", - "php-http/client-common": "^1.0", - "php-http/client-integration-tests": "^0.6", - "php-http/message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4" }, - "autoload": { - "psr-4": { - "Http\\Client\\Socket\\": "src/" - } + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, + "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "LGPL-3.0-or-later" ], "authors": [ { - "name": "Joel Wurtz", - "email": "jwurtz@jolicode.com" + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" } ], - "description": "Socket client for PHP-HTTP", - "time": "2017-11-29T20:46:45+00:00" + "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "paragonie", + "phpcs", + "polyfill", + "standards" + ], + "time": "2018-12-16T19:10:44+00:00" }, { - "name": "php-jsonpointer/php-jsonpointer", - "version": "v3.0.2", + "name": "phpcompatibility/phpcompatibility-wp", + "version": "2.0.0", "source": { "type": "git", - "url": "https://github.com/raphaelstolt/php-jsonpointer.git", - "reference": "4428f86c6f23846e9faa5a420c4ef14e485b3afb" + "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", + "reference": "cb303f0067cd5b366a41d4fb0e254fb40ff02efd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/raphaelstolt/php-jsonpointer/zipball/4428f86c6f23846e9faa5a420c4ef14e485b3afb", - "reference": "4428f86c6f23846e9faa5a420c4ef14e485b3afb", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/cb303f0067cd5b366a41d4fb0e254fb40ff02efd", + "reference": "cb303f0067cd5b366a41d4fb0e254fb40ff02efd", "shasum": "" }, "require": { - "php": ">=5.4" + "phpcompatibility/php-compatibility": "^9.0", + "phpcompatibility/phpcompatibility-paragonie": "^1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^1.11", - "phpunit/phpunit": "4.6.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3" }, - "autoload": { - "psr-0": { - "Rs\\Json": "src/" - } + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, + "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "LGPL-3.0-or-later" ], "authors": [ { - "name": "Raphael Stolt", - "email": "raphael.stolt@gmail.com", - "homepage": "http://raphaelstolt.blogspot.com/" + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" } ], - "description": "Implementation of JSON Pointer (http://tools.ietf.org/html/rfc6901)", - "homepage": "https://github.com/raphaelstolt/php-jsonpointer", + "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", + "homepage": "http://phpcompatibility.com/", "keywords": [ - "json", - "json pointer", - "json traversal" + "compatibility", + "phpcs", + "standards", + "wordpress" ], - "time": "2016-08-29T08:51:01+00:00" + "time": "2018-10-07T18:31:37+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -2431,40 +2619,40 @@ }, { "name": "phpunit/php-code-coverage", - "version": "5.3.2", + "version": "6.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac" + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.0", - "phpunit/php-file-iterator": "^1.4.2", + "php": "^7.1", + "phpunit/php-file-iterator": "^2.0", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^2.0.1", + "phpunit/php-token-stream": "^3.0", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.0", + "sebastian/environment": "^3.1 || ^4.0", "sebastian/version": "^2.0.1", "theseer/tokenizer": "^1.1" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^7.0" }, "suggest": { - "ext-xdebug": "^2.5.5" + "ext-xdebug": "^2.6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3.x-dev" + "dev-master": "6.1-dev" } }, "autoload": { @@ -2490,29 +2678,32 @@ "testing", "xunit" ], - "time": "2018-04-06T15:36:58+00:00" + "time": "2018-10-31T16:06:48+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "reference": "050bedf145a257b1ff02746c31894800e5122946" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -2527,7 +2718,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -2537,7 +2728,7 @@ "filesystem", "iterator" ], - "time": "2017-11-27T13:52:08+00:00" + "time": "2018-09-13T20:33:42+00:00" }, { "name": "phpunit/php-text-template", @@ -2582,28 +2773,28 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.9", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "reference": "8b389aebe1b8b0578430bda0c7c95a829608e059" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8b389aebe1b8b0578430bda0c7c95a829608e059", + "reference": "8b389aebe1b8b0578430bda0c7c95a829608e059", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.1-dev" } }, "autoload": { @@ -2618,7 +2809,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -2627,33 +2818,33 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2019-02-20T10:12:59+00:00" }, { "name": "phpunit/php-token-stream", - "version": "2.0.2", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" + "reference": "c99e3be9d3e85f60646f152f9002d46ed7770d18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/c99e3be9d3e85f60646f152f9002d46ed7770d18", + "reference": "c99e3be9d3e85f60646f152f9002d46ed7770d18", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.2.4" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2676,57 +2867,57 @@ "keywords": [ "tokenizer" ], - "time": "2017-11-27T05:48:46+00:00" + "time": "2018-10-30T05:52:18+00:00" }, { "name": "phpunit/phpunit", - "version": "6.5.13", + "version": "7.5.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "0973426fb012359b2f18d3bd1e90ef1172839693" + "reference": "09c85e14994df92e5ff1f5ec0b481bdb7d3d3df9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0973426fb012359b2f18d3bd1e90ef1172839693", - "reference": "0973426fb012359b2f18d3bd1e90ef1172839693", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/09c85e14994df92e5ff1f5ec0b481bdb7d3d3df9", + "reference": "09c85e14994df92e5ff1f5ec0b481bdb7d3d3df9", "shasum": "" }, "require": { + "doctrine/instantiator": "^1.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.6.1", - "phar-io/manifest": "^1.0.1", - "phar-io/version": "^1.0", - "php": "^7.0", + "myclabs/deep-copy": "^1.7", + "phar-io/manifest": "^1.0.2", + "phar-io/version": "^2.0", + "php": "^7.1", "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^5.3", - "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-code-coverage": "^6.0.7", + "phpunit/php-file-iterator": "^2.0.1", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^1.0.9", - "phpunit/phpunit-mock-objects": "^5.0.9", - "sebastian/comparator": "^2.1", - "sebastian/diff": "^2.0", - "sebastian/environment": "^3.1", + "phpunit/php-timer": "^2.0", + "sebastian/comparator": "^3.0", + "sebastian/diff": "^3.0", + "sebastian/environment": "^4.0", "sebastian/exporter": "^3.1", "sebastian/global-state": "^2.0", "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^1.0", + "sebastian/resource-operations": "^2.0", "sebastian/version": "^2.0.1" }, "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2", - "phpunit/dbunit": "<3.0" + "phpunit/phpunit-mock-objects": "*" }, "require-dev": { "ext-pdo": "*" }, "suggest": { + "ext-soap": "*", "ext-xdebug": "*", - "phpunit/php-invoker": "^1.1" + "phpunit/php-invoker": "^2.0" }, "bin": [ "phpunit" @@ -2734,7 +2925,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.5.x-dev" + "dev-master": "7.5-dev" } }, "autoload": { @@ -2760,66 +2951,7 @@ "testing", "xunit" ], - "time": "2018-09-08T15:10:43+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "5.0.10", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", - "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.5", - "php": "^7.0", - "phpunit/php-text-template": "^1.2.1", - "sebastian/exporter": "^3.1" - }, - "conflict": { - "phpunit/phpunit": "<6.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.5.11" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2018-08-09T05:50:03+00:00" + "time": "2019-02-18T09:24:50+00:00" }, { "name": "psr/http-message", @@ -3102,30 +3234,30 @@ }, { "name": "sebastian/comparator", - "version": "2.1.3", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/diff": "^2.0 || ^3.0", + "php": "^7.1", + "sebastian/diff": "^3.0", "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "^6.4" + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -3162,32 +3294,33 @@ "compare", "equality" ], - "time": "2018-02-01T13:46:46+00:00" + "time": "2018-07-12T15:12:46+00:00" }, { "name": "sebastian/diff", - "version": "2.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.2" + "phpunit/phpunit": "^7.5 || ^8.0", + "symfony/process": "^2 || ^3.3 || ^4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -3212,34 +3345,40 @@ "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "diff" + "diff", + "udiff", + "unidiff", + "unified diff" ], - "time": "2017-08-03T08:09:46+00:00" + "time": "2019-02-04T06:01:07+00:00" }, { "name": "sebastian/environment", - "version": "3.1.0", + "version": "4.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + "reference": "6fda8ce1974b62b14935adc02a9ed38252eca656" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6fda8ce1974b62b14935adc02a9ed38252eca656", + "reference": "6fda8ce1974b62b14935adc02a9ed38252eca656", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.1" + "phpunit/phpunit": "^7.5" + }, + "suggest": { + "ext-posix": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3264,7 +3403,7 @@ "environment", "hhvm" ], - "time": "2017-07-01T08:51:00+00:00" + "time": "2019-02-01T05:27:49+00:00" }, { "name": "sebastian/exporter", @@ -3531,25 +3670,25 @@ }, { "name": "sebastian/resource-operations", - "version": "1.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -3569,7 +3708,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "time": "2018-10-04T04:07:39+00:00" }, { "name": "sebastian/version", @@ -3616,16 +3755,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.3.2", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "6ad28354c04b364c3c71a34e4a18b629cc3b231e" + "reference": "379deb987e26c7cd103a7b387aea178baec96e48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6ad28354c04b364c3c71a34e4a18b629cc3b231e", - "reference": "6ad28354c04b364c3c71a34e4a18b629cc3b231e", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/379deb987e26c7cd103a7b387aea178baec96e48", + "reference": "379deb987e26c7cd103a7b387aea178baec96e48", "shasum": "" }, "require": { @@ -3663,20 +3802,20 @@ "phpcs", "standards" ], - "time": "2018-09-23T23:08:17+00:00" + "time": "2018-12-19T23:57:18+00:00" }, { "name": "symfony/console", - "version": "v3.4.19", + "version": "v3.4.23", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8f80fc39bbc3b7c47ee54ba7aa2653521ace94bb" + "reference": "71ce77f37af0c5ffb9590e43cc4f70e426945c5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8f80fc39bbc3b7c47ee54ba7aa2653521ace94bb", - "reference": "8f80fc39bbc3b7c47ee54ba7aa2653521ace94bb", + "url": "https://api.github.com/repos/symfony/console/zipball/71ce77f37af0c5ffb9590e43cc4f70e426945c5e", + "reference": "71ce77f37af0c5ffb9590e43cc4f70e426945c5e", "shasum": "" }, "require": { @@ -3688,6 +3827,9 @@ "symfony/dependency-injection": "<3.4", "symfony/process": "<3.3" }, + "provide": { + "psr/log-implementation": "1.0" + }, "require-dev": { "psr/log": "~1.0", "symfony/config": "~3.3|~4.0", @@ -3697,7 +3839,7 @@ "symfony/process": "~3.3|~4.0" }, "suggest": { - "psr/log-implementation": "For using the console logger", + "psr/log": "For using the console logger", "symfony/event-dispatcher": "", "symfony/lock": "", "symfony/process": "" @@ -3732,20 +3874,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-11-26T12:48:07+00:00" + "time": "2019-02-23T15:06:07+00:00" }, { "name": "symfony/debug", - "version": "v4.2.0", + "version": "v4.2.4", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "e0a2b92ee0b5b934f973d90c2f58e18af109d276" + "reference": "de73f48977b8eaf7ce22814d66e43a1662cc864f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/e0a2b92ee0b5b934f973d90c2f58e18af109d276", - "reference": "e0a2b92ee0b5b934f973d90c2f58e18af109d276", + "url": "https://api.github.com/repos/symfony/debug/zipball/de73f48977b8eaf7ce22814d66e43a1662cc864f", + "reference": "de73f48977b8eaf7ce22814d66e43a1662cc864f", "shasum": "" }, "require": { @@ -3788,20 +3930,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-11-28T18:24:18+00:00" + "time": "2019-03-03T18:11:24+00:00" }, { "name": "symfony/filesystem", - "version": "v4.2.0", + "version": "v4.2.4", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "2f4c8b999b3b7cadb2a69390b01af70886753710" + "reference": "e16b9e471703b2c60b95f14d31c1239f68f11601" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/2f4c8b999b3b7cadb2a69390b01af70886753710", - "reference": "2f4c8b999b3b7cadb2a69390b01af70886753710", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/e16b9e471703b2c60b95f14d31c1239f68f11601", + "reference": "e16b9e471703b2c60b95f14d31c1239f68f11601", "shasum": "" }, "require": { @@ -3838,20 +3980,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-11-11T19:52:12+00:00" + "time": "2019-02-07T11:40:08+00:00" }, { "name": "symfony/options-resolver", - "version": "v4.2.0", + "version": "v4.2.4", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "a9c38e8a3da2c03b3e71fdffa6efb0bda51390ba" + "reference": "3896e5a7d06fd15fa4947694c8dcdd371ff147d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a9c38e8a3da2c03b3e71fdffa6efb0bda51390ba", - "reference": "a9c38e8a3da2c03b3e71fdffa6efb0bda51390ba", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/3896e5a7d06fd15fa4947694c8dcdd371ff147d1", + "reference": "3896e5a7d06fd15fa4947694c8dcdd371ff147d1", "shasum": "" }, "require": { @@ -3892,7 +4034,7 @@ "configuration", "options" ], - "time": "2018-11-11T19:52:12+00:00" + "time": "2019-02-23T15:17:42+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4013,16 +4155,16 @@ }, { "name": "symfony/process", - "version": "v4.2.0", + "version": "v4.2.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "2b341009ccec76837a7f46f59641b431e4d4c2b0" + "reference": "6c05edb11fbeff9e2b324b4270ecb17911a8b7ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/2b341009ccec76837a7f46f59641b431e4d4c2b0", - "reference": "2b341009ccec76837a7f46f59641b431e4d4c2b0", + "url": "https://api.github.com/repos/symfony/process/zipball/6c05edb11fbeff9e2b324b4270ecb17911a8b7ad", + "reference": "6c05edb11fbeff9e2b324b4270ecb17911a8b7ad", "shasum": "" }, "require": { @@ -4058,20 +4200,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-11-20T16:22:05+00:00" + "time": "2019-01-24T22:05:03+00:00" }, { "name": "symfony/serializer", - "version": "v4.2.0", + "version": "v4.2.4", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "830a3add86777766b4fc6490e3f5e72d693704c2" + "reference": "705ac7bdb9c920465b1c64fb6c9fc9ce9fe064ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/830a3add86777766b4fc6490e3f5e72d693704c2", - "reference": "830a3add86777766b4fc6490e3f5e72d693704c2", + "url": "https://api.github.com/repos/symfony/serializer/zipball/705ac7bdb9c920465b1c64fb6c9fc9ce9fe064ae", + "reference": "705ac7bdb9c920465b1c64fb6c9fc9ce9fe064ae", "shasum": "" }, "require": { @@ -4138,20 +4280,20 @@ ], "description": "Symfony Serializer Component", "homepage": "https://symfony.com", - "time": "2018-11-11T19:52:12+00:00" + "time": "2019-02-23T15:17:42+00:00" }, { "name": "symfony/yaml", - "version": "v4.2.0", + "version": "v4.2.4", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "c41175c801e3edfda90f32e292619d10c27103d7" + "reference": "761fa560a937fd7686e5274ff89dcfa87a5047df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/c41175c801e3edfda90f32e292619d10c27103d7", - "reference": "c41175c801e3edfda90f32e292619d10c27103d7", + "url": "https://api.github.com/repos/symfony/yaml/zipball/761fa560a937fd7686e5274ff89dcfa87a5047df", + "reference": "761fa560a937fd7686e5274ff89dcfa87a5047df", "shasum": "" }, "require": { @@ -4197,7 +4339,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-11-11T19:52:12+00:00" + "time": "2019-02-23T15:17:42+00:00" }, { "name": "theseer/tokenizer", @@ -4240,36 +4382,38 @@ "time": "2017-04-07T12:08:54+00:00" }, { - "name": "webmozart/assert", - "version": "1.3.0", + "name": "vierbergenlars/php-semver", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + "url": "https://github.com/vierbergenlars/php-semver.git", + "reference": "be22b86be4c1133acc42fd1685276792024af5f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "url": "https://api.github.com/repos/vierbergenlars/php-semver/zipball/be22b86be4c1133acc42fd1685276792024af5f9", + "reference": "be22b86be4c1133acc42fd1685276792024af5f9", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" + "phpunit/phpunit": "~4" }, + "bin": [ + "bin/semver", + "bin/update-versions" + ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } + "psr-0": { + "vierbergenlars\\SemVer\\": "src/", + "vierbergenlars\\LibJs\\": "src/" + }, + "classmap": [ + "src/vierbergenlars/SemVer/internal.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -4277,97 +4421,91 @@ ], "authors": [ { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" + "name": "Lars Vierbergen", + "email": "vierbergenlars@gmail.com" } ], - "description": "Assertions to validate method input/output with nice error messages.", + "description": "The Semantic Versioner for PHP", "keywords": [ - "assert", - "check", - "validate" + "semantic", + "semver", + "versioning" ], - "time": "2018-01-29T19:49:41+00:00" + "time": "2017-07-11T09:53:59+00:00" }, { - "name": "wimg/php-compatibility", - "version": "9.0.0", + "name": "webmozart/assert", + "version": "1.4.0", "source": { "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "e9f4047e5edf53c88f36f1dafc0d49454ce13e25" + "url": "https://github.com/webmozart/assert.git", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/e9f4047e5edf53c88f36f1dafc0d49454ce13e25", - "reference": "e9f4047e5edf53c88f36f1dafc0d49454ce13e25", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", "shasum": "" }, "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" - }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" }, "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } }, - "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-or-later" + "MIT" ], "authors": [ { - "name": "Contributors", - "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" - }, - { - "name": "Wim Godden", - "homepage": "https://github.com/wimg", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", - "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "description": "Assertions to validate method input/output with nice error messages.", "keywords": [ - "compatibility", - "phpcs", - "standards" + "assert", + "check", + "validate" ], - "abandoned": "phpcompatibility/php-compatibility", - "time": "2018-10-07T17:38:02+00:00" + "time": "2018-12-25T11:19:39+00:00" }, { "name": "wp-coding-standards/wpcs", - "version": "1.2.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git", - "reference": "7aa217ab38156c5cb4eae0f04ae376027c407a9b" + "reference": "c9eaadaafefce36b3cb7e06eb15305b8c4cae9ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/7aa217ab38156c5cb4eae0f04ae376027c407a9b", - "reference": "7aa217ab38156c5cb4eae0f04ae376027c407a9b", + "url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/c9eaadaafefce36b3cb7e06eb15305b8c4cae9ce", + "reference": "c9eaadaafefce36b3cb7e06eb15305b8c4cae9ce", "shasum": "" }, "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.9.0 || ^3.0.2" + "php": ">=5.4", + "squizlabs/php_codesniffer": "^3.3.1" }, "require-dev": { - "phpcompatibility/php-compatibility": "^9.0" + "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", + "phpcompatibility/php-compatibility": "^9.0", + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." @@ -4389,13 +4527,12 @@ "standards", "wordpress" ], - "time": "2018-11-12T10:13:12+00:00" + "time": "2019-01-16T10:13:16+00:00" } ], "aliases": [], "minimum-stability": "dev", "stability-flags": { - "10up/wp_mock": 20, "10up/phpcs-composer": 20 }, "prefer-stable": true, diff --git a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4/Factory.php b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4/Factory.php index 3ab674c27..e0b0e3c3e 100644 --- a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4/Factory.php +++ b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4/Factory.php @@ -1,6 +1,6 @@ pluginAbsolutePath = $pluginFile; - $this->pluginFile = plugin_basename($this->pluginAbsolutePath); - $this->muPluginFile = $muPluginFile; - - //If no slug is specified, use the name of the main plugin file as the slug. - //For example, 'my-cool-plugin/cool-plugin.php' becomes 'cool-plugin'. - if ( empty($slug) ){ - $slug = basename($this->pluginFile, '.php'); - } - - //Plugin slugs must be unique. - $slugCheckFilter = 'puc_is_slug_in_use-' . $this->slug; - $slugUsedBy = apply_filters($slugCheckFilter, false); - if ( $slugUsedBy ) { - $this->triggerError(sprintf( - 'Plugin slug "%s" is already in use by %s. Slugs must be unique.', - htmlentities($this->slug), - htmlentities($slugUsedBy) - ), E_USER_ERROR); - } - add_filter($slugCheckFilter, array($this, 'getAbsolutePath')); - - //Backwards compatibility: If the plugin is a mu-plugin but no $muPluginFile is specified, assume - //it's the same as $pluginFile given that it's not in a subdirectory (WP only looks in the base dir). - if ( (strpbrk($this->pluginFile, '/\\') === false) && $this->isUnknownMuPlugin() ) { - $this->muPluginFile = $this->pluginFile; - } - - //To prevent a crash during plugin uninstallation, remove updater hooks when the user removes the plugin. - //Details: https://github.com/YahnisElsts/plugin-update-checker/issues/138#issuecomment-335590964 - add_action('uninstall_' . $this->pluginFile, array($this, 'removeHooks')); - - $this->manualCheckErrorTransient = $this->getUniqueName('manual_check_errors'); - - parent::__construct($metadataUrl, dirname($this->pluginFile), $slug, $checkPeriod, $optionName); - } - - /** - * Create an instance of the scheduler. - * - * @param int $checkPeriod - * @return Puc_v4p4_Scheduler - */ - protected function createScheduler($checkPeriod) { - $scheduler = new Puc_v4p4_Scheduler($this, $checkPeriod, array('load-plugins.php')); - register_deactivation_hook($this->pluginFile, array($scheduler, 'removeUpdaterCron')); - return $scheduler; - } - - /** - * Install the hooks required to run periodic update checks and inject update info - * into WP data structures. - * - * @return void - */ - protected function installHooks(){ - //Override requests for plugin information - add_filter('plugins_api', array($this, 'injectInfo'), 20, 3); - - add_filter('plugin_row_meta', array($this, 'addViewDetailsLink'), 10, 3); - add_filter('plugin_row_meta', array($this, 'addCheckForUpdatesLink'), 10, 2); - add_action('admin_init', array($this, 'handleManualCheck')); - add_action('all_admin_notices', array($this, 'displayManualCheckResult')); - - //Clear the version number cache when something - anything - is upgraded or WP clears the update cache. - add_filter('upgrader_post_install', array($this, 'clearCachedVersion')); - add_action('delete_site_transient_update_plugins', array($this, 'clearCachedVersion')); - - parent::installHooks(); - } - - /** - * Remove update checker hooks. - * - * The intent is to prevent a fatal error that can happen if the plugin has an uninstall - * hook. During uninstallation, WP includes the main plugin file (which creates a PUC instance), - * the uninstall hook runs, WP deletes the plugin files and then updates some transients. - * If PUC hooks are still around at this time, they could throw an error while trying to - * autoload classes from files that no longer exist. - * - * The "site_transient_{$transient}" filter is the main problem here, but let's also remove - * most other PUC hooks to be safe. - * - * @internal - */ - public function removeHooks() { - parent::removeHooks(); - - remove_filter('plugins_api', array($this, 'injectInfo'), 20); - - remove_filter('plugin_row_meta', array($this, 'addViewDetailsLink'), 10); - remove_filter('plugin_row_meta', array($this, 'addCheckForUpdatesLink'), 10); - remove_action('admin_init', array($this, 'handleManualCheck')); - remove_action('all_admin_notices', array($this, 'displayManualCheckResult')); - - remove_filter('upgrader_post_install', array($this, 'clearCachedVersion')); - remove_action('delete_site_transient_update_plugins', array($this, 'clearCachedVersion')); - } - - /** - * Retrieve plugin info from the configured API endpoint. - * - * @uses wp_remote_get() - * - * @param array $queryArgs Additional query arguments to append to the request. Optional. - * @return Puc_v4p4_Plugin_Info - */ - public function requestInfo($queryArgs = array()) { - list($pluginInfo, $result) = $this->requestMetadata('Puc_v4p4_Plugin_Info', 'request_info', $queryArgs); - - if ( $pluginInfo !== null ) { - /** @var Puc_v4p4_Plugin_Info $pluginInfo */ - $pluginInfo->filename = $this->pluginFile; - $pluginInfo->slug = $this->slug; - } - - $pluginInfo = apply_filters($this->getUniqueName('request_info_result'), $pluginInfo, $result); - return $pluginInfo; - } - - /** - * Retrieve the latest update (if any) from the configured API endpoint. - * - * @uses PluginUpdateChecker::requestInfo() - * - * @return Puc_v4p4_Update|null An instance of Plugin_Update, or NULL when no updates are available. - */ - public function requestUpdate() { - //For the sake of simplicity, this function just calls requestInfo() - //and transforms the result accordingly. - $pluginInfo = $this->requestInfo(array('checking_for_updates' => '1')); - if ( $pluginInfo === null ){ - return null; - } - $update = Puc_v4p4_Plugin_Update::fromPluginInfo($pluginInfo); - - $update = $this->filterUpdateResult($update); - - return $update; - } - - /** - * Get the currently installed version of the plugin. - * - * @return string Version number. - */ - public function getInstalledVersion(){ - if ( isset($this->cachedInstalledVersion) ) { - return $this->cachedInstalledVersion; - } - - $pluginHeader = $this->getPluginHeader(); - if ( isset($pluginHeader['Version']) ) { - $this->cachedInstalledVersion = $pluginHeader['Version']; - return $pluginHeader['Version']; - } else { - //This can happen if the filename points to something that is not a plugin. - $this->triggerError( - sprintf( - "Can't to read the Version header for '%s'. The filename is incorrect or is not a plugin.", - $this->pluginFile - ), - E_USER_WARNING - ); - return null; - } - } - - /** - * Get plugin's metadata from its file header. - * - * @return array - */ - protected function getPluginHeader() { - if ( !is_file($this->pluginAbsolutePath) ) { - //This can happen if the plugin filename is wrong. - $this->triggerError( - sprintf( - "Can't to read the plugin header for '%s'. The file does not exist.", - $this->pluginFile - ), - E_USER_WARNING - ); - return array(); - } - - if ( !function_exists('get_plugin_data') ){ - /** @noinspection PhpIncludeInspection */ - require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); - } - return get_plugin_data($this->pluginAbsolutePath, false, false); - } - - /** - * @return array - */ - protected function getHeaderNames() { - return array( - 'Name' => 'Plugin Name', - 'PluginURI' => 'Plugin URI', - 'Version' => 'Version', - 'Description' => 'Description', - 'Author' => 'Author', - 'AuthorURI' => 'Author URI', - 'TextDomain' => 'Text Domain', - 'DomainPath' => 'Domain Path', - 'Network' => 'Network', - - //The newest WordPress version that this plugin requires or has been tested with. - //We support several different formats for compatibility with other libraries. - 'Tested WP' => 'Tested WP', - 'Requires WP' => 'Requires WP', - 'Tested up to' => 'Tested up to', - 'Requires at least' => 'Requires at least', - ); - } - - - /** - * Intercept plugins_api() calls that request information about our plugin and - * use the configured API endpoint to satisfy them. - * - * @see plugins_api() - * - * @param mixed $result - * @param string $action - * @param array|object $args - * @return mixed - */ - public function injectInfo($result, $action = null, $args = null){ - $relevant = ($action == 'plugin_information') && isset($args->slug) && ( - ($args->slug == $this->slug) || ($args->slug == dirname($this->pluginFile)) - ); - if ( !$relevant ) { - return $result; - } - - $pluginInfo = $this->requestInfo(); - $pluginInfo = apply_filters($this->getUniqueName('pre_inject_info'), $pluginInfo); - if ( $pluginInfo ) { - return $pluginInfo->toWpFormat(); - } - - return $result; - } - - protected function shouldShowUpdates() { - //No update notifications for mu-plugins unless explicitly enabled. The MU plugin file - //is usually different from the main plugin file so the update wouldn't show up properly anyway. - return !$this->isUnknownMuPlugin(); - } - - /** - * @param stdClass|null $updates - * @param stdClass $updateToAdd - * @return stdClass - */ - protected function addUpdateToList($updates, $updateToAdd) { - if ( $this->isMuPlugin() ) { - //WP does not support automatic update installation for mu-plugins, but we can - //still display a notice. - $updateToAdd->package = null; - } - return parent::addUpdateToList($updates, $updateToAdd); - } - - /** - * @param stdClass|null $updates - * @return stdClass|null - */ - protected function removeUpdateFromList($updates) { - $updates = parent::removeUpdateFromList($updates); - if ( !empty($this->muPluginFile) && isset($updates, $updates->response) ) { - unset($updates->response[$this->muPluginFile]); - } - return $updates; - } - - /** - * For plugins, the update array is indexed by the plugin filename relative to the "plugins" - * directory. Example: "plugin-name/plugin.php". - * - * @return string - */ - protected function getUpdateListKey() { - if ( $this->isMuPlugin() ) { - return $this->muPluginFile; - } - return $this->pluginFile; - } - - /** - * Alias for isBeingUpgraded(). - * - * @deprecated - * @param WP_Upgrader|null $upgrader The upgrader that's performing the current update. - * @return bool - */ - public function isPluginBeingUpgraded($upgrader = null) { - return $this->isBeingUpgraded($upgrader); - } - - /** - * Is there an update being installed for this plugin, right now? - * - * @param WP_Upgrader|null $upgrader - * @return bool - */ - public function isBeingUpgraded($upgrader = null) { - return $this->upgraderStatus->isPluginBeingUpgraded($this->pluginFile, $upgrader); - } - - /** - * Get the details of the currently available update, if any. - * - * If no updates are available, or if the last known update version is below or equal - * to the currently installed version, this method will return NULL. - * - * Uses cached update data. To retrieve update information straight from - * the metadata URL, call requestUpdate() instead. - * - * @return Puc_v4p4_Plugin_Update|null - */ - public function getUpdate() { - $update = parent::getUpdate(); - if ( isset($update) ) { - /** @var Puc_v4p4_Plugin_Update $update */ - $update->filename = $this->pluginFile; - } - return $update; - } - - /** - * Add a "Check for updates" link to the plugin row in the "Plugins" page. By default, - * the new link will appear after the "Visit plugin site" link if present, otherwise - * after the "View plugin details" link. - * - * You can change the link text by using the "puc_manual_check_link-$slug" filter. - * Returning an empty string from the filter will disable the link. - * - * @param array $pluginMeta Array of meta links. - * @param string $pluginFile - * @return array - */ - public function addCheckForUpdatesLink($pluginMeta, $pluginFile) { - $isRelevant = ($pluginFile == $this->pluginFile) - || (!empty($this->muPluginFile) && $pluginFile == $this->muPluginFile); - - if ( $isRelevant && $this->userCanInstallUpdates() ) { - $linkUrl = wp_nonce_url( - add_query_arg( - array( - 'puc_check_for_updates' => 1, - 'puc_slug' => $this->slug, - ), - self_admin_url('plugins.php') - ), - 'puc_check_for_updates' - ); - - $linkText = apply_filters( - $this->getUniqueName('manual_check_link'), - __('Check for updates', 'plugin-update-checker') - ); - if ( !empty($linkText) ) { - /** @noinspection HtmlUnknownTarget */ - $pluginMeta[] = sprintf('%s', esc_attr($linkUrl), $linkText); - } - } - return $pluginMeta; - } - - /** - * Add a "View Details" link to the plugin row in the "Plugins" page. By default, - * the new link will appear before the "Visit plugin site" link (if present). - * - * You can change the link text by using the "puc_view_details_link-$slug" filter. - * Returning an empty string from the filter will disable the link. - * - * You can change the position of the link using the - * "puc_view_details_link_position-$slug" filter. - * Returning 'before' or 'after' will place the link immediately before/after the - * "Visit plugin site" link - * Returning 'append' places the link after any existing links at the time of the hook. - * Returning 'replace' replaces the "Visit plugin site" link - * Returning anything else disables the link when there is a "Visit plugin site" link. - * - * If there is no "Visit plugin site" link 'append' is always used! - * - * @param array $pluginMeta Array of meta links. - * @param string $pluginFile - * @param array $pluginData Array of plugin header data. - * @return array - */ - public function addViewDetailsLink($pluginMeta, $pluginFile, $pluginData = array()) { - $isRelevant = ($pluginFile == $this->pluginFile) - || (!empty($this->muPluginFile) && $pluginFile == $this->muPluginFile); - - if ( $isRelevant && $this->userCanInstallUpdates() && !isset($pluginData['slug']) ) { - $linkText = apply_filters($this->getUniqueName('view_details_link'), __('View details')); - if ( !empty($linkText) ) { - $viewDetailsLinkPosition = 'append'; - - //Find the "Visit plugin site" link (if present). - $visitPluginSiteLinkIndex = count($pluginMeta) - 1; - if ( $pluginData['PluginURI'] ) { - $escapedPluginUri = esc_url($pluginData['PluginURI']); - foreach ($pluginMeta as $linkIndex => $existingLink) { - if ( strpos($existingLink, $escapedPluginUri) !== false ) { - $visitPluginSiteLinkIndex = $linkIndex; - $viewDetailsLinkPosition = apply_filters( - $this->getUniqueName('view_details_link_position'), - 'before' - ); - break; - } - } - } - - $viewDetailsLink = sprintf('%s', - esc_url(network_admin_url('plugin-install.php?tab=plugin-information&plugin=' . urlencode($this->slug) . - '&TB_iframe=true&width=600&height=550')), - esc_attr(sprintf(__('More information about %s'), $pluginData['Name'])), - esc_attr($pluginData['Name']), - $linkText - ); - switch ($viewDetailsLinkPosition) { - case 'before': - array_splice($pluginMeta, $visitPluginSiteLinkIndex, 0, $viewDetailsLink); - break; - case 'after': - array_splice($pluginMeta, $visitPluginSiteLinkIndex + 1, 0, $viewDetailsLink); - break; - case 'replace': - $pluginMeta[$visitPluginSiteLinkIndex] = $viewDetailsLink; - break; - case 'append': - default: - $pluginMeta[] = $viewDetailsLink; - break; - } - } - } - return $pluginMeta; - } - - - /** - * Check for updates when the user clicks the "Check for updates" link. - * @see self::addCheckForUpdatesLink() - * - * @return void - */ - public function handleManualCheck() { - $shouldCheck = - isset($_GET['puc_check_for_updates'], $_GET['puc_slug']) - && $_GET['puc_slug'] == $this->slug - && $this->userCanInstallUpdates() - && check_admin_referer('puc_check_for_updates'); - - if ( $shouldCheck ) { - $update = $this->checkForUpdates(); - $status = ($update === null) ? 'no_update' : 'update_available'; - - if ( ($update === null) && !empty($this->lastRequestApiErrors) ) { - //Some errors are not critical. For example, if PUC tries to retrieve the readme.txt - //file from GitHub and gets a 404, that's an API error, but it doesn't prevent updates - //from working. Maybe the plugin simply doesn't have a readme. - //Let's only show important errors. - $foundCriticalErrors = false; - $questionableErrorCodes = array( - 'puc-github-http-error', - 'puc-gitlab-http-error', - 'puc-bitbucket-http-error', - ); - - foreach ($this->lastRequestApiErrors as $item) { - $wpError = $item['error']; - /** @var WP_Error $wpError */ - if ( !in_array($wpError->get_error_code(), $questionableErrorCodes) ) { - $foundCriticalErrors = true; - break; - } - } - - if ( $foundCriticalErrors ) { - $status = 'error'; - set_site_transient($this->manualCheckErrorTransient, $this->lastRequestApiErrors, 60); - } - } - - wp_redirect(add_query_arg( - array( - 'puc_update_check_result' => $status, - 'puc_slug' => $this->slug, - ), - self_admin_url('plugins.php') - )); - } - } - - /** - * Display the results of a manual update check. - * @see self::handleManualCheck() - * - * You can change the result message by using the "puc_manual_check_message-$slug" filter. - */ - public function displayManualCheckResult() { - if ( isset($_GET['puc_update_check_result'], $_GET['puc_slug']) && ($_GET['puc_slug'] == $this->slug) ) { - $status = strval($_GET['puc_update_check_result']); - $title = $this->getPluginTitle(); - $noticeClass = 'updated notice-success'; - $details = ''; - - if ( $status == 'no_update' ) { - $message = sprintf(_x('The %s plugin is up to date.', 'the plugin title', 'plugin-update-checker'), $title); - } else if ( $status == 'update_available' ) { - $message = sprintf(_x('A new version of the %s plugin is available.', 'the plugin title', 'plugin-update-checker'), $title); - } else if ( $status === 'error' ) { - $message = sprintf(_x('Could not determine if updates are available for %s.', 'the plugin title', 'plugin-update-checker'), $title); - $noticeClass = 'error notice-error'; - - $details = $this->formatManualCheckErrors(get_site_transient($this->manualCheckErrorTransient)); - delete_site_transient($this->manualCheckErrorTransient); - } else { - $message = sprintf(__('Unknown update checker status "%s"', 'plugin-update-checker'), htmlentities($status)); - $noticeClass = 'error notice-error'; - } - printf( - '

%s

%s
', - $noticeClass, - apply_filters($this->getUniqueName('manual_check_message'), $message, $status), - $details - ); - } - } - - /** - * Format the list of errors that were thrown during an update check. - * - * @param array $errors - * @return string - */ - protected function formatManualCheckErrors($errors) { - if ( empty($errors) ) { - return ''; - } - $output = ''; - - $showAsList = count($errors) > 1; - if ( $showAsList ) { - $output .= '
    '; - $formatString = '
  1. %1$s %2$s
  2. '; - } else { - $formatString = '

    %1$s %2$s

    '; - } - foreach ($errors as $item) { - $wpError = $item['error']; - /** @var WP_Error $wpError */ - $output .= sprintf( - $formatString, - $wpError->get_error_message(), - $wpError->get_error_code() - ); - } - if ( $showAsList ) { - $output .= '
'; - } - - return $output; - } - - /** - * Get the translated plugin title. - * - * @return string - */ - protected function getPluginTitle() { - $title = ''; - $header = $this->getPluginHeader(); - if ( $header && !empty($header['Name']) && isset($header['TextDomain']) ) { - $title = translate($header['Name'], $header['TextDomain']); - } - return $title; - } - - /** - * Check if the current user has the required permissions to install updates. - * - * @return bool - */ - public function userCanInstallUpdates() { - return current_user_can('update_plugins'); - } - - /** - * Check if the plugin file is inside the mu-plugins directory. - * - * @return bool - */ - protected function isMuPlugin() { - static $cachedResult = null; - - if ( $cachedResult === null ) { - //Convert both paths to the canonical form before comparison. - $muPluginDir = realpath(WPMU_PLUGIN_DIR); - $pluginPath = realpath($this->pluginAbsolutePath); - - $cachedResult = (strpos($pluginPath, $muPluginDir) === 0); - } - - return $cachedResult; - } - - /** - * MU plugins are partially supported, but only when we know which file in mu-plugins - * corresponds to this plugin. - * - * @return bool - */ - protected function isUnknownMuPlugin() { - return empty($this->muPluginFile) && $this->isMuPlugin(); - } - - /** - * Clear the cached plugin version. This method can be set up as a filter (hook) and will - * return the filter argument unmodified. - * - * @param mixed $filterArgument - * @return mixed - */ - public function clearCachedVersion($filterArgument = null) { - $this->cachedInstalledVersion = null; - return $filterArgument; - } - - /** - * Get absolute path to the main plugin file. - * - * @return string - */ - public function getAbsolutePath() { - return $this->pluginAbsolutePath; - } - - /** - * @return string - */ - public function getAbsoluteDirectoryPath() { - return dirname($this->pluginAbsolutePath); - } - - /** - * Register a callback for filtering query arguments. - * - * The callback function should take one argument - an associative array of query arguments. - * It should return a modified array of query arguments. - * - * @uses add_filter() This method is a convenience wrapper for add_filter(). - * - * @param callable $callback - * @return void - */ - public function addQueryArgFilter($callback){ - $this->addFilter('request_info_query_args', $callback); - } - - /** - * Register a callback for filtering arguments passed to wp_remote_get(). - * - * The callback function should take one argument - an associative array of arguments - - * and return a modified array or arguments. See the WP documentation on wp_remote_get() - * for details on what arguments are available and how they work. - * - * @uses add_filter() This method is a convenience wrapper for add_filter(). - * - * @param callable $callback - * @return void - */ - public function addHttpRequestArgFilter($callback) { - $this->addFilter('request_info_options', $callback); - } - - /** - * Register a callback for filtering the plugin info retrieved from the external API. - * - * The callback function should take two arguments. If the plugin info was retrieved - * successfully, the first argument passed will be an instance of PluginInfo. Otherwise, - * it will be NULL. The second argument will be the corresponding return value of - * wp_remote_get (see WP docs for details). - * - * The callback function should return a new or modified instance of PluginInfo or NULL. - * - * @uses add_filter() This method is a convenience wrapper for add_filter(). - * - * @param callable $callback - * @return void - */ - public function addResultFilter($callback) { - $this->addFilter('request_info_result', $callback, 10, 2); - } - - protected function createDebugBarExtension() { - return new Puc_v4p4_DebugBar_PluginExtension($this); - } - } - -endif; diff --git a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Autoloader.php b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Autoloader.php similarity index 94% rename from vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Autoloader.php rename to vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Autoloader.php index e435f6650..1f3ad687a 100644 --- a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Autoloader.php +++ b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Autoloader.php @@ -1,8 +1,8 @@ updateChecker = $updateChecker; @@ -150,11 +150,11 @@ private function getLibraryUrl($filePath) { $absolutePath = realpath(dirname(__FILE__) . '/../../../' . ltrim($filePath, '/')); //Where is the library located inside the WordPress directory structure? - $absolutePath = Puc_v4p4_Factory::normalizePath($absolutePath); + $absolutePath = Puc_v4p5_Factory::normalizePath($absolutePath); - $pluginDir = Puc_v4p4_Factory::normalizePath(WP_PLUGIN_DIR); - $muPluginDir = Puc_v4p4_Factory::normalizePath(WPMU_PLUGIN_DIR); - $themeDir = Puc_v4p4_Factory::normalizePath(get_theme_root()); + $pluginDir = Puc_v4p5_Factory::normalizePath(WP_PLUGIN_DIR); + $muPluginDir = Puc_v4p5_Factory::normalizePath(WPMU_PLUGIN_DIR); + $themeDir = Puc_v4p5_Factory::normalizePath(get_theme_root()); if ( (strpos($absolutePath, $pluginDir) === 0) || (strpos($absolutePath, $muPluginDir) === 0) ) { //It's part of a plugin. diff --git a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/DebugBar/Panel.php b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/DebugBar/Panel.php similarity index 96% rename from vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/DebugBar/Panel.php rename to vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/DebugBar/Panel.php index 728eb8095..8016bc7a7 100644 --- a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/DebugBar/Panel.php +++ b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/DebugBar/Panel.php @@ -1,9 +1,9 @@
'; diff --git a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/DebugBar/PluginExtension.php b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/DebugBar/PluginExtension.php similarity index 75% rename from vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/DebugBar/PluginExtension.php rename to vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/DebugBar/PluginExtension.php index f8faf33fd..5196ba1c4 100644 --- a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/DebugBar/PluginExtension.php +++ b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/DebugBar/PluginExtension.php @@ -1,12 +1,12 @@ 'GitHub', 'bitbucket.org' => 'BitBucket', diff --git a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/InstalledPackage.php b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/InstalledPackage.php new file mode 100644 index 000000000..fd5d71b27 --- /dev/null +++ b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/InstalledPackage.php @@ -0,0 +1,103 @@ +updateChecker = $updateChecker; + } + + /** + * Get the currently installed version of the plugin or theme. + * + * @return string|null Version number. + */ + abstract public function getInstalledVersion(); + + /** + * Get the full path of the plugin or theme directory (without a trailing slash). + * + * @return string + */ + abstract public function getAbsoluteDirectoryPath(); + + /** + * Check whether a regular file exists in the package's directory. + * + * @param string $relativeFileName File name relative to the package directory. + * @return bool + */ + public function fileExists($relativeFileName) { + return is_file( + $this->getAbsoluteDirectoryPath() + . DIRECTORY_SEPARATOR + . ltrim($relativeFileName, '/\\') + ); + } + + /* ------------------------------------------------------------------- + * File header parsing + * ------------------------------------------------------------------- + */ + + /** + * Parse plugin or theme metadata from the header comment. + * + * This is basically a simplified version of the get_file_data() function from /wp-includes/functions.php. + * It's intended as a utility for subclasses that detect updates by parsing files in a VCS. + * + * @param string|null $content File contents. + * @return string[] + */ + public function getFileHeader($content) { + $content = (string)$content; + + //WordPress only looks at the first 8 KiB of the file, so we do the same. + $content = substr($content, 0, 8192); + //Normalize line endings. + $content = str_replace("\r", "\n", $content); + + $headers = $this->getHeaderNames(); + $results = array(); + foreach ($headers as $field => $name) { + $success = preg_match('/^[ \t\/*#@]*' . preg_quote($name, '/') . ':(.*)$/mi', $content, $matches); + + if ( ($success === 1) && $matches[1] ) { + $value = $matches[1]; + if ( function_exists('_cleanup_header_comment') ) { + $value = _cleanup_header_comment($value); + } + $results[$field] = $value; + } else { + $results[$field] = ''; + } + } + + return $results; + } + + /** + * @return array Format: ['HeaderKey' => 'Header Name'] + */ + abstract protected function getHeaderNames(); + + /** + * Get the value of a specific plugin or theme header. + * + * @param string $headerName + * @return string Either the value of the header, or an empty string if the header doesn't exist. + */ + abstract public function getHeaderValue($headerName); + + } +endif; \ No newline at end of file diff --git a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Metadata.php b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Metadata.php similarity index 97% rename from vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Metadata.php rename to vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Metadata.php index 40e8ffae8..6a89ca883 100644 --- a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Metadata.php +++ b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Metadata.php @@ -1,5 +1,5 @@ pluginAbsolutePath = $pluginAbsolutePath; + $this->pluginFile = plugin_basename($this->pluginAbsolutePath); + + parent::__construct($updateChecker); + + //Clear the version number cache when something - anything - is upgraded or WP clears the update cache. + add_filter('upgrader_post_install', array($this, 'clearCachedVersion')); + add_action('delete_site_transient_update_plugins', array($this, 'clearCachedVersion')); + } + + public function getInstalledVersion() { + if ( isset($this->cachedInstalledVersion) ) { + return $this->cachedInstalledVersion; + } + + $pluginHeader = $this->getPluginHeader(); + if ( isset($pluginHeader['Version']) ) { + $this->cachedInstalledVersion = $pluginHeader['Version']; + return $pluginHeader['Version']; + } else { + //This can happen if the filename points to something that is not a plugin. + $this->updateChecker->triggerError( + sprintf( + "Can't to read the Version header for '%s'. The filename is incorrect or is not a plugin.", + $this->updateChecker->pluginFile + ), + E_USER_WARNING + ); + return null; + } + } + + /** + * Clear the cached plugin version. This method can be set up as a filter (hook) and will + * return the filter argument unmodified. + * + * @param mixed $filterArgument + * @return mixed + */ + public function clearCachedVersion($filterArgument = null) { + $this->cachedInstalledVersion = null; + return $filterArgument; + } + + public function getAbsoluteDirectoryPath() { + return dirname($this->pluginAbsolutePath); + } + + /** + * Get the value of a specific plugin or theme header. + * + * @param string $headerName + * @param string $defaultValue + * @return string Either the value of the header, or $defaultValue if the header doesn't exist or is empty. + */ + public function getHeaderValue($headerName, $defaultValue = '') { + $headers = $this->getPluginHeader(); + if ( isset($headers[$headerName]) && ($headers[$headerName] !== '') ) { + return $headers[$headerName]; + } + return $defaultValue; + } + + protected function getHeaderNames() { + return array( + 'Name' => 'Plugin Name', + 'PluginURI' => 'Plugin URI', + 'Version' => 'Version', + 'Description' => 'Description', + 'Author' => 'Author', + 'AuthorURI' => 'Author URI', + 'TextDomain' => 'Text Domain', + 'DomainPath' => 'Domain Path', + 'Network' => 'Network', + + //The newest WordPress version that this plugin requires or has been tested with. + //We support several different formats for compatibility with other libraries. + 'Tested WP' => 'Tested WP', + 'Requires WP' => 'Requires WP', + 'Tested up to' => 'Tested up to', + 'Requires at least' => 'Requires at least', + ); + } + + /** + * Get the translated plugin title. + * + * @return string + */ + public function getPluginTitle() { + $title = ''; + $header = $this->getPluginHeader(); + if ( $header && !empty($header['Name']) && isset($header['TextDomain']) ) { + $title = translate($header['Name'], $header['TextDomain']); + } + return $title; + } + + /** + * Get plugin's metadata from its file header. + * + * @return array + */ + public function getPluginHeader() { + if ( !is_file($this->pluginAbsolutePath) ) { + //This can happen if the plugin filename is wrong. + $this->updateChecker->triggerError( + sprintf( + "Can't to read the plugin header for '%s'. The file does not exist.", + $this->updateChecker->pluginFile + ), + E_USER_WARNING + ); + return array(); + } + + if ( !function_exists('get_plugin_data') ) { + /** @noinspection PhpIncludeInspection */ + require_once(ABSPATH . '/wp-admin/includes/plugin.php'); + } + return get_plugin_data($this->pluginAbsolutePath, false, false); + } + + public function removeHooks() { + remove_filter('upgrader_post_install', array($this, 'clearCachedVersion')); + remove_action('delete_site_transient_update_plugins', array($this, 'clearCachedVersion')); + } + + /** + * Check if the plugin file is inside the mu-plugins directory. + * + * @return bool + */ + public function isMuPlugin() { + static $cachedResult = null; + + if ( $cachedResult === null ) { + if ( !defined('WPMU_PLUGIN_DIR') || !is_string(WPMU_PLUGIN_DIR) ) { + $cachedResult = false; + return $cachedResult; + } + + //Convert both paths to the canonical form before comparison. + $muPluginDir = realpath(WPMU_PLUGIN_DIR); + $pluginPath = realpath($this->pluginAbsolutePath); + //If realpath() fails, just normalize the syntax instead. + if (($muPluginDir === false) || ($pluginPath === false)) { + $muPluginDir = Puc_v4p5_Factory::normalizePath(WPMU_PLUGIN_DIR); + $pluginPath = Puc_v4p5_Factory::normalizePath($this->pluginAbsolutePath); + } + + $cachedResult = (strpos($pluginPath, $muPluginDir) === 0); + } + + return $cachedResult; + } + } + +endif; \ No newline at end of file diff --git a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Plugin/Ui.php b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Plugin/Ui.php new file mode 100644 index 000000000..46b6a4dc2 --- /dev/null +++ b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Plugin/Ui.php @@ -0,0 +1,277 @@ +updateChecker = $updateChecker; + $this->manualCheckErrorTransient = $this->updateChecker->getUniqueName('manual_check_errors'); + + add_action('admin_init', array($this, 'onAdminInit')); + } + + public function onAdminInit() { + if ( $this->updateChecker->userCanInstallUpdates() ) { + $this->handleManualCheck(); + + add_filter('plugin_row_meta', array($this, 'addViewDetailsLink'), 10, 3); + add_filter('plugin_row_meta', array($this, 'addCheckForUpdatesLink'), 10, 2); + add_action('all_admin_notices', array($this, 'displayManualCheckResult')); + } + } + + /** + * Add a "View Details" link to the plugin row in the "Plugins" page. By default, + * the new link will appear before the "Visit plugin site" link (if present). + * + * You can change the link text by using the "puc_view_details_link-$slug" filter. + * Returning an empty string from the filter will disable the link. + * + * You can change the position of the link using the + * "puc_view_details_link_position-$slug" filter. + * Returning 'before' or 'after' will place the link immediately before/after + * the "Visit plugin site" link. + * Returning 'append' places the link after any existing links at the time of the hook. + * Returning 'replace' replaces the "Visit plugin site" link. + * Returning anything else disables the link when there is a "Visit plugin site" link. + * + * If there is no "Visit plugin site" link 'append' is always used! + * + * @param array $pluginMeta Array of meta links. + * @param string $pluginFile + * @param array $pluginData Array of plugin header data. + * @return array + */ + public function addViewDetailsLink($pluginMeta, $pluginFile, $pluginData = array()) { + if ( $this->isMyPluginFile($pluginFile) && !isset($pluginData['slug']) ) { + $linkText = apply_filters($this->updateChecker->getUniqueName('view_details_link'), __('View details')); + if ( !empty($linkText) ) { + $viewDetailsLinkPosition = 'append'; + + //Find the "Visit plugin site" link (if present). + $visitPluginSiteLinkIndex = count($pluginMeta) - 1; + if ( $pluginData['PluginURI'] ) { + $escapedPluginUri = esc_url($pluginData['PluginURI']); + foreach ($pluginMeta as $linkIndex => $existingLink) { + if ( strpos($existingLink, $escapedPluginUri) !== false ) { + $visitPluginSiteLinkIndex = $linkIndex; + $viewDetailsLinkPosition = apply_filters( + $this->updateChecker->getUniqueName('view_details_link_position'), + 'before' + ); + break; + } + } + } + + $viewDetailsLink = sprintf('%s', + esc_url(network_admin_url('plugin-install.php?tab=plugin-information&plugin=' . urlencode($this->updateChecker->slug) . + '&TB_iframe=true&width=600&height=550')), + esc_attr(sprintf(__('More information about %s'), $pluginData['Name'])), + esc_attr($pluginData['Name']), + $linkText + ); + switch ($viewDetailsLinkPosition) { + case 'before': + array_splice($pluginMeta, $visitPluginSiteLinkIndex, 0, $viewDetailsLink); + break; + case 'after': + array_splice($pluginMeta, $visitPluginSiteLinkIndex + 1, 0, $viewDetailsLink); + break; + case 'replace': + $pluginMeta[$visitPluginSiteLinkIndex] = $viewDetailsLink; + break; + case 'append': + default: + $pluginMeta[] = $viewDetailsLink; + break; + } + } + } + return $pluginMeta; + } + + /** + * Add a "Check for updates" link to the plugin row in the "Plugins" page. By default, + * the new link will appear after the "Visit plugin site" link if present, otherwise + * after the "View plugin details" link. + * + * You can change the link text by using the "puc_manual_check_link-$slug" filter. + * Returning an empty string from the filter will disable the link. + * + * @param array $pluginMeta Array of meta links. + * @param string $pluginFile + * @return array + */ + public function addCheckForUpdatesLink($pluginMeta, $pluginFile) { + if ( $this->isMyPluginFile($pluginFile) ) { + $linkUrl = wp_nonce_url( + add_query_arg( + array( + 'puc_check_for_updates' => 1, + 'puc_slug' => $this->updateChecker->slug, + ), + self_admin_url('plugins.php') + ), + 'puc_check_for_updates' + ); + + $linkText = apply_filters( + $this->updateChecker->getUniqueName('manual_check_link'), + __('Check for updates', 'plugin-update-checker') + ); + if ( !empty($linkText) ) { + /** @noinspection HtmlUnknownTarget */ + $pluginMeta[] = sprintf('%s', esc_attr($linkUrl), $linkText); + } + } + return $pluginMeta; + } + + protected function isMyPluginFile($pluginFile) { + return ($pluginFile == $this->updateChecker->pluginFile) + || (!empty($this->updateChecker->muPluginFile) && ($pluginFile == $this->updateChecker->muPluginFile)); + } + + /** + * Check for updates when the user clicks the "Check for updates" link. + * + * @see self::addCheckForUpdatesLink() + * + * @return void + */ + public function handleManualCheck() { + $shouldCheck = + isset($_GET['puc_check_for_updates'], $_GET['puc_slug']) + && $_GET['puc_slug'] == $this->updateChecker->slug + && check_admin_referer('puc_check_for_updates'); + + if ( $shouldCheck ) { + $update = $this->updateChecker->checkForUpdates(); + $status = ($update === null) ? 'no_update' : 'update_available'; + + if ( ($update === null) && !empty($this->lastRequestApiErrors) ) { + //Some errors are not critical. For example, if PUC tries to retrieve the readme.txt + //file from GitHub and gets a 404, that's an API error, but it doesn't prevent updates + //from working. Maybe the plugin simply doesn't have a readme. + //Let's only show important errors. + $foundCriticalErrors = false; + $questionableErrorCodes = array( + 'puc-github-http-error', + 'puc-gitlab-http-error', + 'puc-bitbucket-http-error', + ); + + foreach ($this->lastRequestApiErrors as $item) { + $wpError = $item['error']; + /** @var WP_Error $wpError */ + if ( !in_array($wpError->get_error_code(), $questionableErrorCodes) ) { + $foundCriticalErrors = true; + break; + } + } + + if ( $foundCriticalErrors ) { + $status = 'error'; + set_site_transient($this->manualCheckErrorTransient, $this->lastRequestApiErrors, 60); + } + } + + wp_redirect(add_query_arg( + array( + 'puc_update_check_result' => $status, + 'puc_slug' => $this->updateChecker->slug, + ), + self_admin_url('plugins.php') + )); + exit; + } + } + + /** + * Display the results of a manual update check. + * + * @see self::handleManualCheck() + * + * You can change the result message by using the "puc_manual_check_message-$slug" filter. + */ + public function displayManualCheckResult() { + if ( isset($_GET['puc_update_check_result'], $_GET['puc_slug']) && ($_GET['puc_slug'] == $this->updateChecker->slug) ) { + $status = strval($_GET['puc_update_check_result']); + $title = $this->updateChecker->getInstalledPackage()->getPluginTitle(); + $noticeClass = 'updated notice-success'; + $details = ''; + + if ( $status == 'no_update' ) { + $message = sprintf(_x('The %s plugin is up to date.', 'the plugin title', 'plugin-update-checker'), $title); + } else if ( $status == 'update_available' ) { + $message = sprintf(_x('A new version of the %s plugin is available.', 'the plugin title', 'plugin-update-checker'), $title); + } else if ( $status === 'error' ) { + $message = sprintf(_x('Could not determine if updates are available for %s.', 'the plugin title', 'plugin-update-checker'), $title); + $noticeClass = 'error notice-error'; + + $details = $this->formatManualCheckErrors(get_site_transient($this->manualCheckErrorTransient)); + delete_site_transient($this->manualCheckErrorTransient); + } else { + $message = sprintf(__('Unknown update checker status "%s"', 'plugin-update-checker'), htmlentities($status)); + $noticeClass = 'error notice-error'; + } + printf( + '

%s

%s
', + $noticeClass, + apply_filters($this->updateChecker->getUniqueName('manual_check_message'), $message, $status), + $details + ); + } + } + + /** + * Format the list of errors that were thrown during an update check. + * + * @param array $errors + * @return string + */ + protected function formatManualCheckErrors($errors) { + if ( empty($errors) ) { + return ''; + } + $output = ''; + + $showAsList = count($errors) > 1; + if ( $showAsList ) { + $output .= '
    '; + $formatString = '
  1. %1$s %2$s
  2. '; + } else { + $formatString = '

    %1$s %2$s

    '; + } + foreach ($errors as $item) { + $wpError = $item['error']; + /** @var WP_Error $wpError */ + $output .= sprintf( + $formatString, + $wpError->get_error_message(), + $wpError->get_error_code() + ); + } + if ( $showAsList ) { + $output .= '
'; + } + + return $output; + } + + public function removeHooks() { + remove_action('admin_init', array($this, 'onAdminInit')); + remove_filter('plugin_row_meta', array($this, 'addViewDetailsLink'), 10); + remove_filter('plugin_row_meta', array($this, 'addCheckForUpdatesLink'), 10); + remove_action('all_admin_notices', array($this, 'displayManualCheckResult')); + } + } +endif; \ No newline at end of file diff --git a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Plugin/Update.php b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Plugin/Update.php similarity index 87% rename from vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Plugin/Update.php rename to vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Plugin/Update.php index 7b093554d..499f43a3a 100644 --- a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Plugin/Update.php +++ b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Plugin/Update.php @@ -1,5 +1,5 @@ pluginAbsolutePath = $pluginFile; + $this->pluginFile = plugin_basename($this->pluginAbsolutePath); + $this->muPluginFile = $muPluginFile; + + //If no slug is specified, use the name of the main plugin file as the slug. + //For example, 'my-cool-plugin/cool-plugin.php' becomes 'cool-plugin'. + if ( empty($slug) ){ + $slug = basename($this->pluginFile, '.php'); + } + + //Plugin slugs must be unique. + $slugCheckFilter = 'puc_is_slug_in_use-' . $slug; + $slugUsedBy = apply_filters($slugCheckFilter, false); + if ( $slugUsedBy ) { + $this->triggerError(sprintf( + 'Plugin slug "%s" is already in use by %s. Slugs must be unique.', + htmlentities($slug), + htmlentities($slugUsedBy) + ), E_USER_ERROR); + } + add_filter($slugCheckFilter, array($this, 'getAbsolutePath')); + + //Backwards compatibility: If the plugin is a mu-plugin but no $muPluginFile is specified, assume + //it's the same as $pluginFile given that it's not in a subdirectory (WP only looks in the base dir). + if ( (strpbrk($this->pluginFile, '/\\') === false) && $this->isUnknownMuPlugin() ) { + $this->muPluginFile = $this->pluginFile; + } + + //To prevent a crash during plugin uninstallation, remove updater hooks when the user removes the plugin. + //Details: https://github.com/YahnisElsts/plugin-update-checker/issues/138#issuecomment-335590964 + add_action('uninstall_' . $this->pluginFile, array($this, 'removeHooks')); + + parent::__construct($metadataUrl, dirname($this->pluginFile), $slug, $checkPeriod, $optionName); + + $this->extraUi = new Puc_v4p5_Plugin_Ui($this); + } + + /** + * Create an instance of the scheduler. + * + * @param int $checkPeriod + * @return Puc_v4p5_Scheduler + */ + protected function createScheduler($checkPeriod) { + $scheduler = new Puc_v4p5_Scheduler($this, $checkPeriod, array('load-plugins.php')); + register_deactivation_hook($this->pluginFile, array($scheduler, 'removeUpdaterCron')); + return $scheduler; + } + + /** + * Install the hooks required to run periodic update checks and inject update info + * into WP data structures. + * + * @return void + */ + protected function installHooks(){ + //Override requests for plugin information + add_filter('plugins_api', array($this, 'injectInfo'), 20, 3); + + parent::installHooks(); + } + + /** + * Remove update checker hooks. + * + * The intent is to prevent a fatal error that can happen if the plugin has an uninstall + * hook. During uninstallation, WP includes the main plugin file (which creates a PUC instance), + * the uninstall hook runs, WP deletes the plugin files and then updates some transients. + * If PUC hooks are still around at this time, they could throw an error while trying to + * autoload classes from files that no longer exist. + * + * The "site_transient_{$transient}" filter is the main problem here, but let's also remove + * most other PUC hooks to be safe. + * + * @internal + */ + public function removeHooks() { + parent::removeHooks(); + $this->extraUi->removeHooks(); + $this->package->removeHooks(); + + remove_filter('plugins_api', array($this, 'injectInfo'), 20); + } + + /** + * Retrieve plugin info from the configured API endpoint. + * + * @uses wp_remote_get() + * + * @param array $queryArgs Additional query arguments to append to the request. Optional. + * @return Puc_v4p5_Plugin_Info + */ + public function requestInfo($queryArgs = array()) { + list($pluginInfo, $result) = $this->requestMetadata('Puc_v4p5_Plugin_Info', 'request_info', $queryArgs); + + if ( $pluginInfo !== null ) { + /** @var Puc_v4p5_Plugin_Info $pluginInfo */ + $pluginInfo->filename = $this->pluginFile; + $pluginInfo->slug = $this->slug; + } + + $pluginInfo = apply_filters($this->getUniqueName('request_info_result'), $pluginInfo, $result); + return $pluginInfo; + } + + /** + * Retrieve the latest update (if any) from the configured API endpoint. + * + * @uses PluginUpdateChecker::requestInfo() + * + * @return Puc_v4p5_Update|null An instance of Plugin_Update, or NULL when no updates are available. + */ + public function requestUpdate() { + //For the sake of simplicity, this function just calls requestInfo() + //and transforms the result accordingly. + $pluginInfo = $this->requestInfo(array('checking_for_updates' => '1')); + if ( $pluginInfo === null ){ + return null; + } + $update = Puc_v4p5_Plugin_Update::fromPluginInfo($pluginInfo); + + $update = $this->filterUpdateResult($update); + + return $update; + } + + /** + * Intercept plugins_api() calls that request information about our plugin and + * use the configured API endpoint to satisfy them. + * + * @see plugins_api() + * + * @param mixed $result + * @param string $action + * @param array|object $args + * @return mixed + */ + public function injectInfo($result, $action = null, $args = null){ + $relevant = ($action == 'plugin_information') && isset($args->slug) && ( + ($args->slug == $this->slug) || ($args->slug == dirname($this->pluginFile)) + ); + if ( !$relevant ) { + return $result; + } + + $pluginInfo = $this->requestInfo(); + $pluginInfo = apply_filters($this->getUniqueName('pre_inject_info'), $pluginInfo); + if ( $pluginInfo ) { + return $pluginInfo->toWpFormat(); + } + + return $result; + } + + protected function shouldShowUpdates() { + //No update notifications for mu-plugins unless explicitly enabled. The MU plugin file + //is usually different from the main plugin file so the update wouldn't show up properly anyway. + return !$this->isUnknownMuPlugin(); + } + + /** + * @param stdClass|null $updates + * @param stdClass $updateToAdd + * @return stdClass + */ + protected function addUpdateToList($updates, $updateToAdd) { + if ( $this->package->isMuPlugin() ) { + //WP does not support automatic update installation for mu-plugins, but we can + //still display a notice. + $updateToAdd->package = null; + } + return parent::addUpdateToList($updates, $updateToAdd); + } + + /** + * @param stdClass|null $updates + * @return stdClass|null + */ + protected function removeUpdateFromList($updates) { + $updates = parent::removeUpdateFromList($updates); + if ( !empty($this->muPluginFile) && isset($updates, $updates->response) ) { + unset($updates->response[$this->muPluginFile]); + } + return $updates; + } + + /** + * For plugins, the update array is indexed by the plugin filename relative to the "plugins" + * directory. Example: "plugin-name/plugin.php". + * + * @return string + */ + protected function getUpdateListKey() { + if ( $this->package->isMuPlugin() ) { + return $this->muPluginFile; + } + return $this->pluginFile; + } + + /** + * Alias for isBeingUpgraded(). + * + * @deprecated + * @param WP_Upgrader|null $upgrader The upgrader that's performing the current update. + * @return bool + */ + public function isPluginBeingUpgraded($upgrader = null) { + return $this->isBeingUpgraded($upgrader); + } + + /** + * Is there an update being installed for this plugin, right now? + * + * @param WP_Upgrader|null $upgrader + * @return bool + */ + public function isBeingUpgraded($upgrader = null) { + return $this->upgraderStatus->isPluginBeingUpgraded($this->pluginFile, $upgrader); + } + + /** + * Get the details of the currently available update, if any. + * + * If no updates are available, or if the last known update version is below or equal + * to the currently installed version, this method will return NULL. + * + * Uses cached update data. To retrieve update information straight from + * the metadata URL, call requestUpdate() instead. + * + * @return Puc_v4p5_Plugin_Update|null + */ + public function getUpdate() { + $update = parent::getUpdate(); + if ( isset($update) ) { + /** @var Puc_v4p5_Plugin_Update $update */ + $update->filename = $this->pluginFile; + } + return $update; + } + + /** + * Get the translated plugin title. + * + * @deprecated + * @return string + */ + public function getPluginTitle() { + return $this->package->getPluginTitle(); + } + + /** + * Check if the current user has the required permissions to install updates. + * + * @return bool + */ + public function userCanInstallUpdates() { + return current_user_can('update_plugins'); + } + + /** + * Check if the plugin file is inside the mu-plugins directory. + * + * @deprecated + * @return bool + */ + protected function isMuPlugin() { + return $this->package->isMuPlugin(); + } + + /** + * MU plugins are partially supported, but only when we know which file in mu-plugins + * corresponds to this plugin. + * + * @return bool + */ + protected function isUnknownMuPlugin() { + return empty($this->muPluginFile) && $this->package->isMuPlugin(); + } + + /** + * Get absolute path to the main plugin file. + * + * @return string + */ + public function getAbsolutePath() { + return $this->pluginAbsolutePath; + } + + /** + * Register a callback for filtering query arguments. + * + * The callback function should take one argument - an associative array of query arguments. + * It should return a modified array of query arguments. + * + * @uses add_filter() This method is a convenience wrapper for add_filter(). + * + * @param callable $callback + * @return void + */ + public function addQueryArgFilter($callback){ + $this->addFilter('request_info_query_args', $callback); + } + + /** + * Register a callback for filtering arguments passed to wp_remote_get(). + * + * The callback function should take one argument - an associative array of arguments - + * and return a modified array or arguments. See the WP documentation on wp_remote_get() + * for details on what arguments are available and how they work. + * + * @uses add_filter() This method is a convenience wrapper for add_filter(). + * + * @param callable $callback + * @return void + */ + public function addHttpRequestArgFilter($callback) { + $this->addFilter('request_info_options', $callback); + } + + /** + * Register a callback for filtering the plugin info retrieved from the external API. + * + * The callback function should take two arguments. If the plugin info was retrieved + * successfully, the first argument passed will be an instance of PluginInfo. Otherwise, + * it will be NULL. The second argument will be the corresponding return value of + * wp_remote_get (see WP docs for details). + * + * The callback function should return a new or modified instance of PluginInfo or NULL. + * + * @uses add_filter() This method is a convenience wrapper for add_filter(). + * + * @param callable $callback + * @return void + */ + public function addResultFilter($callback) { + $this->addFilter('request_info_result', $callback, 10, 2); + } + + protected function createDebugBarExtension() { + return new Puc_v4p5_DebugBar_PluginExtension($this); + } + + /** + * Create a package instance that represents this plugin or theme. + * + * @return Puc_v4p5_InstalledPackage + */ + protected function createInstalledPackage() { + return new Puc_v4p5_Plugin_Package($this->pluginAbsolutePath, $this); + } + + /** + * @return Puc_v4p5_Plugin_Package + */ + public function getInstalledPackage() { + return $this->package; + } + } + +endif; diff --git a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Scheduler.php b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Scheduler.php similarity index 96% rename from vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Scheduler.php rename to vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Scheduler.php index 4fa1e6db9..c2bd55c14 100644 --- a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Scheduler.php +++ b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Scheduler.php @@ -1,11 +1,11 @@ lazyLoad(); @@ -73,10 +73,10 @@ public function getUpdate() { } /** - * @param Puc_v4p4_Update|null $update + * @param Puc_v4p5_Update|null $update * @return $this */ - public function setUpdate(Puc_v4p4_Update $update = null) { + public function setUpdate(Puc_v4p5_Update $update = null) { $this->lazyLoad(); $this->update = $update; return $this; @@ -138,7 +138,7 @@ public function save() { $updateClass = get_class($this->update); $state->updateClass = $updateClass; $prefix = $this->getLibPrefix(); - if ( Puc_v4p4_Utils::startsWith($updateClass, $prefix) ) { + if ( Puc_v4p5_Utils::startsWith($updateClass, $prefix) ) { $state->updateBaseClass = substr($updateClass, strlen($prefix)); } } @@ -169,8 +169,8 @@ protected function load() { return; } - $this->lastCheck = intval(Puc_v4p4_Utils::get($state, 'lastCheck', 0)); - $this->checkedVersion = Puc_v4p4_Utils::get($state, 'checkedVersion', ''); + $this->lastCheck = intval(Puc_v4p5_Utils::get($state, 'lastCheck', 0)); + $this->checkedVersion = Puc_v4p5_Utils::get($state, 'checkedVersion', ''); $this->update = null; if ( isset($state->update) ) { diff --git a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Theme/Package.php b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Theme/Package.php new file mode 100644 index 000000000..49daee86e --- /dev/null +++ b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Theme/Package.php @@ -0,0 +1,65 @@ +stylesheet = $stylesheet; + $this->theme = wp_get_theme($this->stylesheet); + + parent::__construct($updateChecker); + } + + public function getInstalledVersion() { + return $this->theme->get('Version'); + } + + public function getAbsoluteDirectoryPath() { + if ( method_exists($this->theme, 'get_stylesheet_directory') ) { + return $this->theme->get_stylesheet_directory(); //Available since WP 3.4. + } + return get_theme_root($this->stylesheet) . '/' . $this->stylesheet; + } + + /** + * Get the value of a specific plugin or theme header. + * + * @param string $headerName + * @param string $defaultValue + * @return string Either the value of the header, or $defaultValue if the header doesn't exist or is empty. + */ + public function getHeaderValue($headerName, $defaultValue = '') { + $value = $this->theme->get($headerName); + if ( ($headerName === false) || ($headerName === '') ) { + return $defaultValue; + } + return $value; + } + + protected function getHeaderNames() { + return array( + 'Name' => 'Theme Name', + 'ThemeURI' => 'Theme URI', + 'Description' => 'Description', + 'Author' => 'Author', + 'AuthorURI' => 'Author URI', + 'Version' => 'Version', + 'Template' => 'Template', + 'Status' => 'Status', + 'Tags' => 'Tags', + 'TextDomain' => 'Text Domain', + 'DomainPath' => 'Domain Path', + ); + } + } + +endif; \ No newline at end of file diff --git a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Theme/Update.php b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Theme/Update.php similarity index 89% rename from vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Theme/Update.php rename to vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Theme/Update.php index 5a43e11b7..9b28a9ad7 100644 --- a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Theme/Update.php +++ b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Theme/Update.php @@ -1,8 +1,8 @@ stylesheet = $stylesheet; - $this->theme = wp_get_theme($this->stylesheet); parent::__construct( $metadataUrl, @@ -45,13 +39,13 @@ protected function getUpdateListKey() { /** * Retrieve the latest update (if any) from the configured API endpoint. * - * @return Puc_v4p4_Update|null An instance of Update, or NULL when no updates are available. + * @return Puc_v4p5_Update|null An instance of Update, or NULL when no updates are available. */ public function requestUpdate() { - list($themeUpdate, $result) = $this->requestMetadata('Puc_v4p4_Theme_Update', 'request_update'); + list($themeUpdate, $result) = $this->requestMetadata('Puc_v4p5_Theme_Update', 'request_update'); if ( $themeUpdate !== null ) { - /** @var Puc_v4p4_Theme_Update $themeUpdate */ + /** @var Puc_v4p5_Theme_Update $themeUpdate */ $themeUpdate->slug = $this->slug; } @@ -63,33 +57,14 @@ public function userCanInstallUpdates() { return current_user_can('update_themes'); } - /** - * Get the currently installed version of the plugin or theme. - * - * @return string Version number. - */ - public function getInstalledVersion() { - return $this->theme->get('Version'); - } - - /** - * @return string - */ - public function getAbsoluteDirectoryPath() { - if ( method_exists($this->theme, 'get_stylesheet_directory') ) { - return $this->theme->get_stylesheet_directory(); //Available since WP 3.4. - } - return get_theme_root($this->stylesheet) . '/' . $this->stylesheet; - } - /** * Create an instance of the scheduler. * * @param int $checkPeriod - * @return Puc_v4p4_Scheduler + * @return Puc_v4p5_Scheduler */ protected function createScheduler($checkPeriod) { - return new Puc_v4p4_Scheduler($this, $checkPeriod, array('load-themes.php')); + return new Puc_v4p5_Scheduler($this, $checkPeriod, array('load-themes.php')); } /** @@ -103,7 +78,7 @@ public function isBeingUpgraded($upgrader = null) { } protected function createDebugBarExtension() { - return new Puc_v4p4_DebugBar_Extension($this, 'Puc_v4p4_DebugBar_ThemePanel'); + return new Puc_v4p5_DebugBar_Extension($this, 'Puc_v4p5_DebugBar_ThemePanel'); } /** @@ -155,22 +130,12 @@ public function addResultFilter($callback) { } /** - * @return array + * Create a package instance that represents this plugin or theme. + * + * @return Puc_v4p5_InstalledPackage */ - protected function getHeaderNames() { - return array( - 'Name' => 'Theme Name', - 'ThemeURI' => 'Theme URI', - 'Description' => 'Description', - 'Author' => 'Author', - 'AuthorURI' => 'Author URI', - 'Version' => 'Version', - 'Template' => 'Template', - 'Status' => 'Status', - 'Tags' => 'Tags', - 'TextDomain' => 'Text Domain', - 'DomainPath' => 'Domain Path', - ); + protected function createInstalledPackage() { + return new Puc_v4p5_Theme_Package($this->stylesheet, $this); } } diff --git a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Update.php b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Update.php similarity index 84% rename from vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Update.php rename to vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Update.php index af66eb28f..14cde22d3 100644 --- a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Update.php +++ b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Update.php @@ -1,5 +1,5 @@ package = $this->createInstalledPackage(); $this->scheduler = $this->createScheduler($checkPeriod); - $this->upgraderStatus = new Puc_v4p4_UpgraderStatus(); - $this->updateState = new Puc_v4p4_StateStore($this->optionName); + $this->upgraderStatus = new Puc_v4p5_UpgraderStatus(); + $this->updateState = new Puc_v4p5_StateStore($this->optionName); if ( did_action('init') ) { $this->loadTextDomain(); @@ -192,6 +198,20 @@ public function allowMetadataHost($allow, $host) { return $allow; } + /** + * Create a package instance that represents this plugin or theme. + * + * @return Puc_v4p5_InstalledPackage + */ + abstract protected function createInstalledPackage(); + + /** + * @return Puc_v4p5_InstalledPackage + */ + public function getInstalledPackage() { + return $this->package; + } + /** * Create an instance of the scheduler. * @@ -199,14 +219,14 @@ public function allowMetadataHost($allow, $host) { * and substitute their own scheduler. * * @param int $checkPeriod - * @return Puc_v4p4_Scheduler + * @return Puc_v4p5_Scheduler */ abstract protected function createScheduler($checkPeriod); /** * Check for updates. The results are stored in the DB option specified in $optionName. * - * @return Puc_v4p4_Update|null + * @return Puc_v4p5_Update|null */ public function checkForUpdates() { $installedVersion = $this->getInstalledVersion(); @@ -240,7 +260,7 @@ public function checkForUpdates() { /** * Load the update checker state from the DB. * - * @return Puc_v4p4_StateStore + * @return Puc_v4p5_StateStore */ public function getUpdateState() { return $this->updateState->lazyLoad(); @@ -265,7 +285,7 @@ public function resetUpdateState() { * Uses cached update data. To retrieve update information straight from * the metadata URL, call requestUpdate() instead. * - * @return Puc_v4p4_Update|null + * @return Puc_v4p5_Update|null */ public function getUpdate() { $update = $this->updateState->getUpdate(); @@ -286,21 +306,23 @@ public function getUpdate() { * * Subclasses should run the update through filterUpdateResult before returning it. * - * @return Puc_v4p4_Update An instance of Update, or NULL when no updates are available. + * @return Puc_v4p5_Update An instance of Update, or NULL when no updates are available. */ abstract public function requestUpdate(); /** * Filter the result of a requestUpdate() call. * - * @param Puc_v4p4_Update|null $update + * @param Puc_v4p5_Update|null $update * @param array|WP_Error|null $httpResult The value returned by wp_remote_get(), if any. - * @return Puc_v4p4_Update + * @return Puc_v4p5_Update */ protected function filterUpdateResult($update, $httpResult = null) { //Let plugins/themes modify the update. $update = apply_filters($this->getUniqueName('request_update_result'), $update, $httpResult); + $this->fixSupportedWordpressVersion($update); + if ( isset($update, $update->translations) ) { //Keep only those translation updates that apply to this site. $update->translations = $this->filterApplicableTranslations($update->translations); @@ -309,19 +331,63 @@ protected function filterUpdateResult($update, $httpResult = null) { return $update; } + /** + * The "Tested up to" field in the plugin metadata is supposed to be in the form of "major.minor", + * while WordPress core's list_plugin_updates() expects the $update->tested field to be an exact + * version, e.g. "major.minor.patch", to say it's compatible. In other case it shows + * "Compatibility: Unknown". + * The function mimics how wordpress.org API crafts the "tested" field out of "Tested up to". + * + * @param Puc_v4p5_Update|null $update + */ + protected function fixSupportedWordpressVersion(Puc_v4p5_Update $update = null) { + if ( !isset($update->tested) || !preg_match('/^\d++\.\d++$/', $update->tested) ) { + return; + } + + $actualWpVersions = array(); + + $wpVersion = $GLOBALS['wp_version']; + + if ( function_exists('get_preferred_from_update_core') ) { + $coreUpdate = get_preferred_from_update_core(); + if ( isset($coreUpdate->current) && version_compare($coreUpdate->current, $wpVersion, '>') ) { + $actualWpVersions[] = $coreUpdate->current; + } + } + + $actualWpVersions[] = $wpVersion; + + $actualWpPatchNumber = "999"; + foreach ($actualWpVersions as $version) { + if ( preg_match('/^(?P\d++\.\d++)\.(?P\d++)/', $version, $versionParts) ) { + if ( $versionParts['majorMinor'] === $update->tested ) { + $actualWpPatchNumber = $versionParts['patch']; + break; + } + } + } + + $update->tested .= '.' . $actualWpPatchNumber; + } + /** * Get the currently installed version of the plugin or theme. * * @return string|null Version number. */ - abstract public function getInstalledVersion(); + public function getInstalledVersion() { + return $this->package->getInstalledVersion(); + } /** * Get the full path of the plugin or theme directory. * * @return string */ - abstract public function getAbsoluteDirectoryPath(); + public function getAbsoluteDirectoryPath() { + return $this->package->getAbsoluteDirectoryPath(); + } /** * Trigger a PHP error, but only when $debugMode is enabled. @@ -329,12 +395,22 @@ abstract public function getAbsoluteDirectoryPath(); * @param string $message * @param int $errorType */ - protected function triggerError($message, $errorType) { - if ($this->debugMode) { + public function triggerError($message, $errorType) { + if ( $this->isDebugModeEnabled() ) { trigger_error($message, $errorType); } } + /** + * @return bool + */ + protected function isDebugModeEnabled() { + if ( $this->debugMode === null ) { + $this->debugMode = (bool)(constant('WP_DEBUG')); + } + return $this->debugMode; + } + /** * Get the full name of an update checker filter, action or DB entry. * @@ -346,7 +422,7 @@ protected function triggerError($message, $errorType) { */ public function getUniqueName($baseTag) { $name = 'puc_' . $baseTag; - if ($this->filterSuffix !== '') { + if ( $this->filterSuffix !== '' ) { $name .= '_' . $this->filterSuffix; } return $name . '-' . $this->slug; @@ -494,7 +570,7 @@ protected function shouldShowUpdates() { * @param string $metaClass Parse the JSON as an instance of this class. It must have a static fromJson method. * @param string $filterRoot * @param array $queryArgs Additional query arguments. - * @return array [Puc_v4p4_Metadata|null, array|WP_Error] A metadata instance and the value returned by wp_remote_get(). + * @return array [Puc_v4p5_Metadata|null, array|WP_Error] A metadata instance and the value returned by wp_remote_get(). */ protected function requestMetadata($metaClass, $filterRoot, $queryArgs = array()) { //Query args to append to the URL. Plugins can add their own by using a filter callback (see addQueryArgFilter()). @@ -593,7 +669,7 @@ protected function filterApplicableTranslations($translations) { $installedTranslations = $this->getInstalledTranslations(); $applicableTranslations = array(); - foreach($translations as $translation) { + foreach ($translations as $translation) { //Does it match one of the available core languages? $isApplicable = array_key_exists($translation->language, $languages); //Is it more recent than an already-installed translation? @@ -818,52 +894,6 @@ protected function isBadDirectoryStructure($remoteSource) { return false; } - /* ------------------------------------------------------------------- - * File header parsing - * ------------------------------------------------------------------- - */ - - /** - * Parse plugin or theme metadata from the header comment. - * - * This is basically a simplified version of the get_file_data() function from /wp-includes/functions.php. - * It's intended as a utility for subclasses that detect updates by parsing files in a VCS. - * - * @param string|null $content File contents. - * @return string[] - */ - public function getFileHeader($content) { - $content = (string) $content; - - //WordPress only looks at the first 8 KiB of the file, so we do the same. - $content = substr($content, 0, 8192); - //Normalize line endings. - $content = str_replace("\r", "\n", $content); - - $headers = $this->getHeaderNames(); - $results = array(); - foreach ($headers as $field => $name) { - $success = preg_match('/^[ \t\/*#@]*' . preg_quote($name, '/') . ':(.*)$/mi', $content, $matches); - - if ( ($success === 1) && $matches[1] ) { - $value = $matches[1]; - if ( function_exists('_cleanup_header_comment') ) { - $value = _cleanup_header_comment($value); - } - $results[$field] = $value; - } else { - $results[$field] = ''; - } - } - - return $results; - } - - /** - * @return array Format: ['HeaderKey' => 'Header Name'] - */ - abstract protected function getHeaderNames(); - /* ------------------------------------------------------------------- * DebugBar integration * ------------------------------------------------------------------- @@ -873,19 +903,19 @@ abstract protected function getHeaderNames(); * Initialize the update checker Debug Bar plugin/add-on thingy. */ public function maybeInitDebugBar() { - if ( class_exists('Debug_Bar', false) && file_exists(dirname(__FILE__ . '/DebugBar')) ) { + if ( class_exists('Debug_Bar', false) && file_exists(dirname(__FILE__) . '/DebugBar') ) { $this->createDebugBarExtension(); } } protected function createDebugBarExtension() { - return new Puc_v4p4_DebugBar_Extension($this); + return new Puc_v4p5_DebugBar_Extension($this); } /** * Display additional configuration details in the Debug Bar panel. * - * @param Puc_v4p4_DebugBar_Panel $panel + * @param Puc_v4p5_DebugBar_Panel $panel */ public function onDisplayConfiguration($panel) { //Do nothing. Subclasses can use this to add additional info to the panel. diff --git a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/UpgraderStatus.php b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/UpgraderStatus.php similarity index 98% rename from vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/UpgraderStatus.php rename to vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/UpgraderStatus.php index 14194d8bb..ba41189f1 100644 --- a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/UpgraderStatus.php +++ b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/UpgraderStatus.php @@ -1,5 +1,5 @@ $branch->name, 'updated' => $branch->target->date, 'downloadUrl' => $this->getDownloadUrl($branch->name), @@ -70,7 +70,7 @@ public function getBranch($branchName) { * Get a specific tag. * * @param string $tagName - * @return Puc_v4p4_Vcs_Reference|null + * @return Puc_v4p5_Vcs_Reference|null */ public function getTag($tagName) { $tag = $this->api('/refs/tags/' . $tagName); @@ -78,7 +78,7 @@ public function getTag($tagName) { return null; } - return new Puc_v4p4_Vcs_Reference(array( + return new Puc_v4p5_Vcs_Reference(array( 'name' => $tag->name, 'version' => ltrim($tag->name, 'v'), 'updated' => $tag->target->date, @@ -89,7 +89,7 @@ public function getTag($tagName) { /** * Get the tag that looks like the highest version number. * - * @return Puc_v4p4_Vcs_Reference|null + * @return Puc_v4p5_Vcs_Reference|null */ public function getLatestTag() { $tags = $this->api('/refs/tags?sort=-target.date'); @@ -103,7 +103,7 @@ public function getLatestTag() { //Return the first result. if ( !empty($versionTags) ) { $tag = $versionTags[0]; - return new Puc_v4p4_Vcs_Reference(array( + return new Puc_v4p5_Vcs_Reference(array( 'name' => $tag->name, 'version' => ltrim($tag->name, 'v'), 'updated' => $tag->target->date, @@ -117,7 +117,7 @@ public function getLatestTag() { * Get the tag/ref specified by the "Stable tag" header in the readme.txt of a given branch. * * @param string $branch - * @return null|Puc_v4p4_Vcs_Reference + * @return null|Puc_v4p5_Vcs_Reference */ protected function getStableTag($branch) { $remoteReadme = $this->getRemoteReadme($branch); @@ -233,7 +233,7 @@ public function setAuthentication($credentials) { parent::setAuthentication($credentials); if ( !empty($credentials) && !empty($credentials['consumer_key']) ) { - $this->oauth = new Puc_v4p4_OAuthSignature( + $this->oauth = new Puc_v4p5_OAuthSignature( $credentials['consumer_key'], $credentials['consumer_secret'] ); diff --git a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Vcs/GitHubApi.php b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Vcs/GitHubApi.php similarity index 96% rename from vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Vcs/GitHubApi.php rename to vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Vcs/GitHubApi.php index e3f1e57dd..5ddaa7c80 100644 --- a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Vcs/GitHubApi.php +++ b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Vcs/GitHubApi.php @@ -1,8 +1,8 @@ api('/repos/:user/:repo/releases/latest'); @@ -60,7 +60,7 @@ public function getLatestRelease() { return null; } - $reference = new Puc_v4p4_Vcs_Reference(array( + $reference = new Puc_v4p5_Vcs_Reference(array( 'name' => $release->tag_name, 'version' => ltrim($release->tag_name, 'v'), //Remove the "v" prefix from "v1.2.3". 'downloadUrl' => $this->signDownloadUrl($release->zipball_url), @@ -103,7 +103,7 @@ public function getLatestRelease() { /** * Get the tag that looks like the highest version number. * - * @return Puc_v4p4_Vcs_Reference|null + * @return Puc_v4p5_Vcs_Reference|null */ public function getLatestTag() { $tags = $this->api('/repos/:user/:repo/tags'); @@ -118,7 +118,7 @@ public function getLatestTag() { } $tag = $versionTags[0]; - return new Puc_v4p4_Vcs_Reference(array( + return new Puc_v4p5_Vcs_Reference(array( 'name' => $tag->name, 'version' => ltrim($tag->name, 'v'), 'downloadUrl' => $this->signDownloadUrl($tag->zipball_url), @@ -130,7 +130,7 @@ public function getLatestTag() { * Get a branch by name. * * @param string $branchName - * @return null|Puc_v4p4_Vcs_Reference + * @return null|Puc_v4p5_Vcs_Reference */ public function getBranch($branchName) { $branch = $this->api('/repos/:user/:repo/branches/' . $branchName); @@ -138,7 +138,7 @@ public function getBranch($branchName) { return null; } - $reference = new Puc_v4p4_Vcs_Reference(array( + $reference = new Puc_v4p5_Vcs_Reference(array( 'name' => $branch->name, 'downloadUrl' => $this->buildArchiveDownloadUrl($branch->name), 'apiResponse' => $branch, @@ -290,7 +290,7 @@ public function buildArchiveDownloadUrl($ref = 'master') { * Get a specific tag. * * @param string $tagName - * @return Puc_v4p4_Vcs_Reference|null + * @return void */ public function getTag($tagName) { //The current GitHub update checker doesn't use getTag, so I didn't bother to implement it. @@ -306,7 +306,7 @@ public function setAuthentication($credentials) { * Figure out which reference (i.e tag or branch) contains the latest version. * * @param string $configBranch Start looking in this branch. - * @return null|Puc_v4p4_Vcs_Reference + * @return null|Puc_v4p5_Vcs_Reference */ public function chooseReference($configBranch) { $updateSource = null; diff --git a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Vcs/GitLabApi.php b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Vcs/GitLabApi.php similarity index 79% rename from vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Vcs/GitLabApi.php rename to vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Vcs/GitLabApi.php index 574c309cb..5179c534a 100644 --- a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Vcs/GitLabApi.php +++ b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Vcs/GitLabApi.php @@ -1,8 +1,8 @@ repositoryHost = @parse_url($repositoryUrl, PHP_URL_HOST); + $port = @parse_url($repositoryUrl, PHP_URL_PORT); + if ( !empty($port) ){ + $port = ':' . $port; + } + $this->repositoryHost = @parse_url($repositoryUrl, PHP_URL_HOST) . $port; //Find the repository information $path = @parse_url($repositoryUrl, PHP_URL_PATH); if ( preg_match('@^/?(?P[^/]+?)/(?P[^/#?&]+?)/?$@', $path, $matches) ) { $this->userName = $matches['username']; $this->repositoryName = $matches['repository']; + } elseif ( ($this->repositoryHost === 'gitlab.com') ) { + //This is probably a repository in a subgroup, e.g. "/organization/category/repo". + $parts = explode('/', trim($path, '/')); + if ( count($parts) < 3 ) { + throw new InvalidArgumentException('Invalid GitLab.com repository URL: "' . $repositoryUrl . '"'); + } + $lastPart = array_pop($parts); + $this->userName = implode('/', $parts); + $this->repositoryName = $lastPart; } else { //This is not a traditional url, it could be gitlab is in a deeper subdirectory. //Get the path segments. @@ -57,7 +70,7 @@ public function __construct($repositoryUrl, $accessToken = null) { /** * Get the latest release from GitLab. * - * @return Puc_v4p4_Vcs_Reference|null + * @return Puc_v4p5_Vcs_Reference|null */ public function getLatestRelease() { return $this->getLatestTag(); @@ -66,10 +79,10 @@ public function getLatestRelease() { /** * Get the tag that looks like the highest version number. * - * @return Puc_v4p4_Vcs_Reference|null + * @return Puc_v4p5_Vcs_Reference|null */ public function getLatestTag() { - $tags = $this->api('/:user/:repo/repository/tags'); + $tags = $this->api('/:id/repository/tags'); if ( is_wp_error($tags) || empty($tags) || !is_array($tags) ) { return null; } @@ -80,7 +93,7 @@ public function getLatestTag() { } $tag = $versionTags[0]; - return new Puc_v4p4_Vcs_Reference(array( + return new Puc_v4p5_Vcs_Reference(array( 'name' => $tag->name, 'version' => ltrim($tag->name, 'v'), 'downloadUrl' => $this->buildArchiveDownloadUrl($tag->name), @@ -92,15 +105,15 @@ public function getLatestTag() { * Get a branch by name. * * @param string $branchName - * @return null|Puc_v4p4_Vcs_Reference + * @return null|Puc_v4p5_Vcs_Reference */ public function getBranch($branchName) { - $branch = $this->api('/:user/:repo/repository/branches/' . $branchName); + $branch = $this->api('/:id/repository/branches/' . $branchName); if ( is_wp_error($branch) || empty($branch) ) { return null; } - $reference = new Puc_v4p4_Vcs_Reference(array( + $reference = new Puc_v4p5_Vcs_Reference(array( 'name' => $branch->name, 'downloadUrl' => $this->buildArchiveDownloadUrl($branch->name), 'apiResponse' => $branch, @@ -120,7 +133,7 @@ public function getBranch($branchName) { * @return string|null */ public function getLatestCommitTime($ref) { - $commits = $this->api('/:user/:repo/repository/commits/', array('ref_name' => $ref)); + $commits = $this->api('/:id/repository/commits/', array('ref_name' => $ref)); if ( is_wp_error($commits) || !is_array($commits) || !isset($commits[0]) ) { return null; } @@ -175,14 +188,15 @@ protected function api($url, $queryParams = array()) { protected function buildApiUrl($url, $queryParams) { $variables = array( 'user' => $this->userName, - 'repo' => $this->repositoryName + 'repo' => $this->repositoryName, + 'id' => $this->userName . '/' . $this->repositoryName, ); foreach ($variables as $name => $value) { - $url = str_replace("/:{$name}", urlencode('/' . $value), $url); + $url = str_replace("/:{$name}", '/' . urlencode($value), $url); } - $url = substr($url, 3); + $url = substr($url, 1); $url = sprintf('https://%1$s/api/v4/projects/%2$s', $this->repositoryHost, $url); if ( !empty($this->accessToken) ) { @@ -204,7 +218,7 @@ protected function buildApiUrl($url, $queryParams) { * @return null|string Either the contents of the file, or null if the file doesn't exist or there's an error. */ public function getRemoteFile($path, $ref = 'master') { - $response = $this->api('/:user/:repo/repository/files/' . $path, array('ref' => $ref)); + $response = $this->api('/:id/repository/files/' . $path, array('ref' => $ref)); if ( is_wp_error($response) || !isset($response->content) || $response->encoding !== 'base64' ) { return null; } @@ -220,12 +234,11 @@ public function getRemoteFile($path, $ref = 'master') { */ public function buildArchiveDownloadUrl($ref = 'master') { $url = sprintf( - 'https://%1$s/%2$s/%3$s/repository/%4$s/archive.zip', + 'https://%1$s/api/v4/projects/%2$s/repository/archive.zip', $this->repositoryHost, - urlencode($this->userName), - urlencode($this->repositoryName), - urlencode($ref) + urlencode($this->userName . '/' . $this->repositoryName) ); + $url = add_query_arg('sha', urlencode($ref), $url); if ( !empty($this->accessToken) ) { $url = add_query_arg('private_token', $this->accessToken, $url); @@ -238,7 +251,7 @@ public function buildArchiveDownloadUrl($ref = 'master') { * Get a specific tag. * * @param string $tagName - * @return Puc_v4p4_Vcs_Reference|null + * @return void */ public function getTag($tagName) { throw new LogicException('The ' . __METHOD__ . ' method is not implemented and should not be used.'); @@ -248,7 +261,7 @@ public function getTag($tagName) { * Figure out which reference (i.e tag or branch) contains the latest version. * * @param string $configBranch Start looking in this branch. - * @return null|Puc_v4p4_Vcs_Reference + * @return null|Puc_v4p5_Vcs_Reference */ public function chooseReference($configBranch) { $updateSource = null; @@ -271,4 +284,4 @@ public function setAuthentication($credentials) { } } -endif; \ No newline at end of file +endif; diff --git a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Vcs/PluginUpdateChecker.php b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Vcs/PluginUpdateChecker.php similarity index 87% rename from vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Vcs/PluginUpdateChecker.php rename to vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Vcs/PluginUpdateChecker.php index 3b96e814f..4f0535d58 100644 --- a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Vcs/PluginUpdateChecker.php +++ b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Vcs/PluginUpdateChecker.php @@ -1,21 +1,21 @@ api; - $api->setLocalDirectory($this->getAbsoluteDirectoryPath()); + $api->setLocalDirectory($this->package->getAbsoluteDirectoryPath()); - $info = new Puc_v4p4_Plugin_Info(); + $info = new Puc_v4p5_Plugin_Info(); $info->filename = $this->pluginFile; $info->slug = $this->slug; - $this->setInfoFromHeader($this->getPluginHeader(), $info); + $this->setInfoFromHeader($this->package->getPluginHeader(), $info); //Pick a branch or tag. $updateSource = $api->chooseReference($this->branch); @@ -81,7 +81,7 @@ public function requestInfo($unusedParameter = null) { $mainPluginFile = basename($this->pluginFile); $remotePlugin = $api->getRemoteFile($mainPluginFile, $ref); if ( !empty($remotePlugin) ) { - $remoteHeader = $this->getFileHeader($remotePlugin); + $remoteHeader = $this->package->getFileHeader($remotePlugin); $this->setInfoFromHeader($remoteHeader, $info); } @@ -93,7 +93,7 @@ public function requestInfo($unusedParameter = null) { //The changelog might be in a separate file. if ( empty($info->sections['changelog']) ) { - $info->sections['changelog'] = $api->getRemoteChangelog($ref, dirname($this->getAbsolutePath())); + $info->sections['changelog'] = $api->getRemoteChangelog($ref, $this->package->getAbsoluteDirectoryPath()); if ( empty($info->sections['changelog']) ) { $info->sections['changelog'] = __('There is no changelog available.', 'plugin-update-checker'); } @@ -117,18 +117,14 @@ public function requestInfo($unusedParameter = null) { * @return bool */ protected function readmeTxtExistsLocally() { - $pluginDirectory = $this->getAbsoluteDirectoryPath(); - if ( empty($pluginDirectory) || !is_dir($pluginDirectory) || ($pluginDirectory === '.') ) { - return false; - } - return is_file($pluginDirectory . '/' . $this->api->getLocalReadmeName()); + return $this->package->fileExists($this->api->getLocalReadmeName()); } /** * Copy plugin metadata from a file header to a Plugin Info object. * * @param array $fileHeader - * @param Puc_v4p4_Plugin_Info $pluginInfo + * @param Puc_v4p5_Plugin_Info $pluginInfo */ protected function setInfoFromHeader($fileHeader, $pluginInfo) { $headerToPropertyMap = array( @@ -159,7 +155,7 @@ protected function setInfoFromHeader($fileHeader, $pluginInfo) { * Copy plugin metadata from the remote readme.txt file. * * @param string $ref GitHub tag or branch where to look for the readme. - * @param Puc_v4p4_Plugin_Info $pluginInfo + * @param Puc_v4p5_Plugin_Info $pluginInfo */ protected function setInfoFromRemoteReadme($ref, $pluginInfo) { $readme = $this->api->getRemoteReadme($ref); diff --git a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Vcs/Reference.php b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Vcs/Reference.php similarity index 92% rename from vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Vcs/Reference.php rename to vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Vcs/Reference.php index 8a708770e..d59ed5049 100644 --- a/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Vcs/Reference.php +++ b/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Vcs/Reference.php @@ -1,5 +1,5 @@ api; - $api->setLocalDirectory($this->getAbsoluteDirectoryPath()); + $api->setLocalDirectory($this->package->getAbsoluteDirectoryPath()); - $update = new Puc_v4p4_Theme_Update(); + $update = new Puc_v4p5_Theme_Update(); $update->slug = $this->slug; //Figure out which reference (tag or branch) we'll use to get the latest version of the theme. @@ -59,16 +59,16 @@ public function requestUpdate() { //Get headers from the main stylesheet in this branch/tag. Its "Version" header and other metadata //are what the WordPress install will actually see after upgrading, so they take precedence over releases/tags. - $remoteHeader = $this->getFileHeader($api->getRemoteFile('style.css', $ref)); - $update->version = Puc_v4p4_Utils::findNotEmpty(array( + $remoteHeader = $this->package->getFileHeader($api->getRemoteFile('style.css', $ref)); + $update->version = Puc_v4p5_Utils::findNotEmpty(array( $remoteHeader['Version'], - Puc_v4p4_Utils::get($updateSource, 'version'), + Puc_v4p5_Utils::get($updateSource, 'version'), )); //The details URL defaults to the Theme URI header or the repository URL. - $update->details_url = Puc_v4p4_Utils::findNotEmpty(array( + $update->details_url = Puc_v4p5_Utils::findNotEmpty(array( $remoteHeader['ThemeURI'], - $this->theme->get('ThemeURI'), + $this->package->getHeaderValue('ThemeURI'), $this->metadataUrl, )); diff --git a/vendor/yahnis-elsts/plugin-update-checker/README.md b/vendor/yahnis-elsts/plugin-update-checker/README.md index 212a99cde..61f72fcb3 100644 --- a/vendor/yahnis-elsts/plugin-update-checker/README.md +++ b/vendor/yahnis-elsts/plugin-update-checker/README.md @@ -20,6 +20,7 @@ From the users' perspective, it works just like with plugins and themes hosted o - [How to Release an Update](#how-to-release-an-update-2) - [GitLab Integration](#gitlab-integration) - [How to Release an Update](#how-to-release-an-update-3) +- [License Management](#license-management) - [Resources](#resources) @@ -63,7 +64,7 @@ Getting Started require 'path/to/plugin-update-checker/plugin-update-checker.php'; $myUpdateChecker = Puc_v4_Factory::buildUpdateChecker( 'http://example.com/path/to/details.json', - __FILE__, + __FILE__, //Full path to the main plugin file or functions.php. 'unique-plugin-or-theme-slug' ); ``` @@ -115,6 +116,11 @@ This library supports a couple of different ways to release updates on GitHub. P Create a new release using the "Releases" feature on GitHub. The tag name and release title don't matter. The description is optional, but if you do provide one, it will be displayed when the user clicks the "View version x.y.z details" link on the "Plugins" page. Note that PUC ignores releases marked as "This is a pre-release". + If you want to use release assets, call the `enableReleaseAssets()` method after creating the update checker instance: + ```php + $myUpdateChecker->getVcsApi()->enableReleaseAssets(); + ``` + - **Tags** To release version 1.2.3, create a new Git tag named `v1.2.3` or `1.2.3`. That's it. @@ -229,19 +235,23 @@ BitBucket doesn't have an equivalent to GitHub's releases, so the process is sli 'unique-plugin-or-theme-slug' ); - //Note: Self-hosted instances of GitLab must be initialized like this: - $myUpdateChecker = new Puc_v4_Vcs_PluginUpdateChecker( - new Puc_v4p4_Vcs_GitLabApi('https://myserver.com/user-name/repo-name/'), - __FILE__, - 'unique-plugin-or-theme-slug' - ); - //Optional: If you're using a private repository, specify the access token like this: $myUpdateChecker->setAuthentication('your-token-here'); //Optional: Set the branch that contains the stable release. $myUpdateChecker->setBranch('stable-branch-name'); ``` + + Alternatively, if you're using a self-hosted GitLab instance, initialize the update checker like this: + ```php + $myUpdateChecker = new Puc_v4p5_Vcs_PluginUpdateChecker( + new Puc_v4p5_Vcs_GitLabApi('https://myserver.com/user-name/repo-name/'), + __FILE__, + 'unique-plugin-or-theme-slug' + ); + //Optional: Add setAuthentication(...) and setBranch(...) as shown above. + ``` + 3. Plugins only: Add a `readme.txt` file formatted according to the [WordPress.org plugin readme standard](https://wordpress.org/plugins/about/readme.txt) to your repository. The contents of this file will be shown when the user clicks the "View version 1.2.3 details" link. #### How to Release an Update @@ -264,6 +274,11 @@ GitLab doesn't have an equivalent to GitHub's releases, so the process is slight Caveat: If you set the branch to `master` (the default), the update checker will look for recent releases and tags first. It'll only use the `master` branch if it doesn't find anything else suitable. +License Management +------------------ + +Currently, the update checker doesn't have any built-in license management features. It only provides some hooks that you can use to, for example, append license keys to update requests (`$updateChecker->addQueryArgFilter()`). If you're looking for ways to manage and verify licenses, please post your feedback in [this issue](https://github.com/YahnisElsts/plugin-update-checker/issues/222). + Resources --------- diff --git a/vendor/yahnis-elsts/plugin-update-checker/languages/plugin-update-checker-fr_CA.mo b/vendor/yahnis-elsts/plugin-update-checker/languages/plugin-update-checker-fr_CA.mo new file mode 100644 index 0000000000000000000000000000000000000000..24639b694e7ba21e2b5f9997b9f12d2d831ac69a GIT binary patch literal 1208 zcmZuwO>Y}F5M>&-1=K^)9{T|d3>Zk!aJ##85MxybNff&LJ!fDKMyPa&$<1lrsRn<7q_YSWChrKqFfjXPxdlxFOM zc9z_TT8pi4VT5Rx0=(tjbB(E>CsM_c{Zv~B99<|T1-&cxc`jQad0PV#doyHHQ*_j3 zoru1754nu;ppp+3DvPB!xhRZW=Gp0gKaf4oDk2kk56%VUX?9a)nasB-yIG|9mua4+ zFqA*=Ot%@Y?RI3E%PglXExyiWdINTcsBxplEC;Nn1$B-Nj`r3fvLx;FoQ-Uw9GumN z7Wr}fsy0g7ZhJvKaNIo}?8}|ComV!D*vmazx=Pz|K|3cpc7BxKvSqKL^9A)CS2|Lj zq{%k^ESB=F3S6r=DJV%gebabl{uqVi|VxZd)2mcduExMcEhKwf}wB_>y}I zSp_Y0txo@r&rY4M!l4eapy9APLq+?eP?k zF)7{j)~a{~jr_28=aLXszMS-ticFDAM?5%x>GeqCr5X-2)dAo0U+EzPivvUU?U zks{TUjh*jWW$@nSmKTOp=}|W|+S-OVL<)_cG3N7DIL2GGu9>kh zylMa(YY-0?$#&imXoc4E^6>}L+J(@DYE@L{FPASLou;Y5sci}?VQ+d 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: Eric Gagnon \n" +"Language: fr_CA\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Vérifier les mises à jour" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "L’extension %s est à jour." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Une nouvelle version de l’extension %s est disponible." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "Impossible de déterminer si une mise à jour est disponible pour \"%s\"" + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Un problème inconnu est survenu \"%s\"" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "Il n’y a aucun journal de mise à jour disponible." diff --git a/vendor/yahnis-elsts/plugin-update-checker/languages/plugin-update-checker-nl_BE.mo b/vendor/yahnis-elsts/plugin-update-checker/languages/plugin-update-checker-nl_BE.mo new file mode 100644 index 0000000000000000000000000000000000000000..1cea26dda30ca887087e965d5b494716e48d8416 GIT binary patch literal 1211 zcmah|&59F25N>rQ;T9t9u4ClK@z{3ericUi%PFW*e3e!i-y`f+yUy}&sMoC5~HDc}uIo=?CT;4?tL zH((9;33PzdM}+8sx4;to4*U!F0+jJS9ur~}{2hE1{2P1`yuKnt8~g}d`n?6iWpR$; z7iI!i;`ri5h!aaLbuLbK%E^qz)=`nCDzF!WDLW?Z$yiFJ%1k)36H?nsXKIvjB%Yd? zu{&nz02@SLM?R=fcv@TcYa&dU@~oI>LqUg(S8kKx9olB+wKZhNR9dY2T_a@Mm*9|h z*A`g{J%LgV?B?1);CNRtDd_#{zNls0M~5|_u!AX!oPwpY>PYmReZfhP_fz?-QW-DB z$*M7OS!b>Pa3H&mRX`>3E}Ua()*CHZzapF0sL_fW*DltZ^*RjYW8T(f#s9Rs(yZ(@ z(c?l*SPodtW2$Z4-|Fp&Xhii|*P6g4$ib@|*#f@|m-9?%(=I=d^Bg))2OF}rXXljh zV|KD<5}Rr>iK#Wxq4r$fW5Z4b>tgC#PIaJ0)QYZ04g6PK$UDk&uEI2?D5~|d!l_Jd zSU2}E8GKW``cAW5HV2QL^M+PC)VR>z3-H7iF5zyaET&4@-|!Fk)sA(k-_$MZqVmCOx1&*+}D-m~#^V_d%9vU$*R{TijsRlrF2D6#XK@UB`3 zsoC&OZ=WVsE}8aGmaL<&nkZZ9Y{nQ|o0HL8>~J-oSb?4^=YPU%_HDq3eKOUvky0)a z53v?AHYx9p{Ybx{WEt~N#JJjuDr_0`Kt9@5rX0)z2_9fgU=?tis|+sK8EE~VBXmdN gF4LUZ2XdTXY!*|$SiQwsPx$KxgJsRi;?qd{0TG{S#Q*>R literal 0 HcmV?d00001 diff --git a/vendor/yahnis-elsts/plugin-update-checker/languages/plugin-update-checker-nl_BE.po b/vendor/yahnis-elsts/plugin-update-checker/languages/plugin-update-checker-nl_BE.po new file mode 100644 index 000000000..e1734bb52 --- /dev/null +++ b/vendor/yahnis-elsts/plugin-update-checker/languages/plugin-update-checker-nl_BE.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2018-03-25 18:15+0200\n" +"PO-Revision-Date: 2018-03-25 18:32+0200\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.7.1\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: Frank Goossens \n" +"Language: nl_BE\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Controleer op nieuwe versies" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "De meest recente %s versie is geïnstalleerd." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Er is een nieuwe versie van %s beschikbaar." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "Kon niet bepalen of er nieuwe versie van %s beschikbaar is." + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Ongekende status bij controle op nieuwe versie: \"%s\"" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "Er is geen changelog beschikbaar." diff --git a/vendor/yahnis-elsts/plugin-update-checker/languages/plugin-update-checker-nl_NL.mo b/vendor/yahnis-elsts/plugin-update-checker/languages/plugin-update-checker-nl_NL.mo new file mode 100644 index 0000000000000000000000000000000000000000..16dde622ba6040399cc911e0d5ef1c970a541b88 GIT binary patch literal 1211 zcmah|&59F25N>rYShMgp(iFTo-2 zt}U_@dIF^!*v+(oz|pQ^QqcR?eO}9oj}B`FtAI-6JvhhItT$S+epNQFQ==6(u3xG*>vb5)r@X1livMYMwOQG% zqsN6Bv+T2)#Z=pPu(7%)q7l_=U26iHAp1KxvIX7_SMp40(=I=d^Bg+Q`)jhbXXljh zBX)AtBsSG%98+tkL+z!!&xV}}*2UDboa#W0s1@Ca8u+iekav~mT!l$YQB>6P~&2IFTgWfxP-fvvY0Aqf5SiIoh|E9zpj0VX)tIH zxINg88<(32xVEl5>MZqVmCQ9fPwBq3-m~#^b5y?Hwt3Jq{TijsRKQ61D6z9!@UB`3 zsoCJs`aVspTr%mQELlfkHBq+I*^Du`HYcOG*y3tFu>z~Eoc}Si*|z~h_Q^y~hf29f zJjPl~*`&NX_Cx)Ol10oz5#wqrs<36$1NmrEnQ|}>BzTB5fmOh5t}?h_XQ1_ej?f*6 gdrUKCAINcnv6)Z(eD&sQJ?5_;43;%3i%%o*2Pb`M*Z=?k literal 0 HcmV?d00001 diff --git a/vendor/yahnis-elsts/plugin-update-checker/languages/plugin-update-checker-nl_NL.po b/vendor/yahnis-elsts/plugin-update-checker/languages/plugin-update-checker-nl_NL.po new file mode 100644 index 000000000..7f57a89fb --- /dev/null +++ b/vendor/yahnis-elsts/plugin-update-checker/languages/plugin-update-checker-nl_NL.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2018-03-25 18:15+0200\n" +"PO-Revision-Date: 2018-03-25 18:32+0200\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.7.1\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: Frank Goossens \n" +"Language: nl_NL\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Controleer op nieuwe versies" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "De meest recente %s versie is geïnstalleerd." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Er is een nieuwe versie van %s beschikbaar." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "Kon niet bepalen of er nieuwe versie van %s beschikbaar is." + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Ongekende status bij controle op nieuwe versie: \"%s\"" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "Er is geen changelog beschikbaar." diff --git a/vendor/yahnis-elsts/plugin-update-checker/plugin-update-checker.php b/vendor/yahnis-elsts/plugin-update-checker/plugin-update-checker.php index a0fef1908..f521f9d00 100644 --- a/vendor/yahnis-elsts/plugin-update-checker/plugin-update-checker.php +++ b/vendor/yahnis-elsts/plugin-update-checker/plugin-update-checker.php @@ -1,24 +1,24 @@ $2', $_sections[$i]); - $_sections[$i] = $this->filter_text( $_sections[$i], true ); - $title = $this->sanitize_text( $_sections[$i-1] ); - $sections[str_replace(' ', '_', strtolower($title))] = array('title' => $title, 'content' => $_sections[$i]); + for ( $i=0; $i < count($_sections); $i +=2 ) { + $title = $this->sanitize_text( $_sections[$i] ); + if ( isset($_sections[$i+1]) ) { + $content = preg_replace('/(^[\s]*)=[\s]+(.+?)[\s]+=/m', '$1

$2

', $_sections[$i+1]); + $content = $this->filter_text( $content, true ); + } else { + $content = ''; + } + $sections[str_replace(' ', '_', strtolower($title))] = array('title' => $title, 'content' => $content); } @@ -157,8 +161,11 @@ function parse_readme_contents( $file_contents ) { $upgrade_notice = array(); if ( isset($final_sections['upgrade_notice']) ) { $split = preg_split( '#

(.*?)

#', $final_sections['upgrade_notice'], -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY ); - for ( $i = 0; $i < count( $split ); $i += 2 ) - $upgrade_notice[$this->sanitize_text( $split[$i] )] = substr( $this->sanitize_text( $split[$i + 1] ), 0, 300 ); + if ( count($split) >= 2 ) { + for ( $i = 0; $i < count( $split ); $i += 2 ) { + $upgrade_notice[$this->sanitize_text( $split[$i] )] = substr( $this->sanitize_text( $split[$i + 1] ), 0, 300 ); + } + } unset( $final_sections['upgrade_notice'] ); } @@ -331,4 +338,4 @@ function decodeit( $matches ) { } // end class -endif; \ No newline at end of file +endif; From 0c1f4698dd5ce15c81f0ec91c4addd4ed6396a02 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Tue, 5 Mar 2019 12:48:27 -0500 Subject: [PATCH 44/66] Update wpa --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index dbfdad631..3c77252fd 100644 --- a/composer.lock +++ b/composer.lock @@ -88,16 +88,16 @@ }, { "name": "10up/wpacceptance", - "version": "0.12", + "version": "0.12.1", "source": { "type": "git", "url": "https://github.com/10up/wpacceptance.git", - "reference": "c7c178a533ed7ca9a5fc8611201543f25511fe37" + "reference": "0a995e72b23860fb3e1277259fa5536404d905f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/10up/wpacceptance/zipball/c7c178a533ed7ca9a5fc8611201543f25511fe37", - "reference": "c7c178a533ed7ca9a5fc8611201543f25511fe37", + "url": "https://api.github.com/repos/10up/wpacceptance/zipball/0a995e72b23860fb3e1277259fa5536404d905f7", + "reference": "0a995e72b23860fb3e1277259fa5536404d905f7", "shasum": "" }, "require": { @@ -140,7 +140,7 @@ "testing", "wordpress" ], - "time": "2019-03-05T16:32:54+00:00" + "time": "2019-03-05T17:26:37+00:00" }, { "name": "10up/wpsnapshots", From e62fc89955bf7008ff97ef3510df83cd248cbd87 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Tue, 5 Mar 2019 13:36:10 -0500 Subject: [PATCH 45/66] Readd phpunit --- .travis.yml | 1 + composer.json | 4 +- composer.lock | 200 +++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 202 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6329a1e81..4f9f31163 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ script: - if [ -n "$AWS_ACCESS_KEY" ]; then ./vendor/bin/wpsnapshots configure 10up --aws_key=$AWS_ACCESS_KEY --aws_secret=$SECRET_ACCESS_KEY --user_name=Travis --user_email=travis@10up.com; fi - if [ -n "$AWS_ACCESS_KEY" ]; then bash run-wpacceptance.sh; fi - composer run-script lint + - ./vendor/bin/phpunit notifications: email: false sudo: required diff --git a/composer.json b/composer.json index babcdb6be..6319d19b6 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,9 @@ }, "require-dev": { "10up/phpcs-composer": "dev-master", - "10up/wpacceptance": "~0.12.0" + "10up/wpacceptance": "~0.12.0", + "10up/wp_mock": "dev-dev", + "phpunit/phpunit": "~7.5" }, "scripts": { "lint": "phpcs .", diff --git a/composer.lock b/composer.lock index 3c77252fd..d571f8789 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": "3175aad4d6366c50bfd6e7f7b0236b1d", + "content-hash": "982f0fbadd513142568a088c7b32d000", "packages": [ { "name": "yahnis-elsts/plugin-update-checker", @@ -86,6 +86,47 @@ ], "time": "2019-03-04T14:40:41+00:00" }, + { + "name": "10up/wp_mock", + "version": "dev-dev", + "source": { + "type": "git", + "url": "https://github.com/10up/wp_mock.git", + "reference": "0354413d63cbae920ffc0676443c6d9dd330ce40" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/10up/wp_mock/zipball/0354413d63cbae920ffc0676443c6d9dd330ce40", + "reference": "0354413d63cbae920ffc0676443c6d9dd330ce40", + "shasum": "" + }, + "require": { + "antecedent/patchwork": "^2.1", + "mockery/mockery": "^1.0", + "php": ">=7.0", + "phpunit/phpunit": ">=6.0" + }, + "require-dev": { + "behat/behat": "^3.0", + "satooshi/php-coveralls": "^1.0", + "sebastian/comparator": ">=1.2.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "WP_Mock\\": "./php/WP_Mock" + }, + "classmap": [ + "php/WP_Mock.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "description": "A mocking library to take the pain out of unit testing for WordPress", + "time": "2017-12-03T19:27:57+00:00" + }, { "name": "10up/wpacceptance", "version": "0.12.1", @@ -195,6 +236,47 @@ ], "time": "2018-12-10T04:37:49+00:00" }, + { + "name": "antecedent/patchwork", + "version": "2.1.8", + "source": { + "type": "git", + "url": "https://github.com/antecedent/patchwork.git", + "reference": "3bb81ace3914c220aa273d1c0603d5e1b454c0d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/antecedent/patchwork/zipball/3bb81ace3914c220aa273d1c0603d5e1b454c0d7", + "reference": "3bb81ace3914c220aa273d1c0603d5e1b454c0d7", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignas Rudaitis", + "email": "ignas.rudaitis@gmail.com" + } + ], + "description": "Method redefinition (monkey-patching) functionality for PHP.", + "homepage": "http://patchwork2.org/", + "keywords": [ + "aop", + "aspect", + "interception", + "monkeypatching", + "redefinition", + "runkit", + "testing" + ], + "time": "2018-02-19T18:52:50+00:00" + }, { "name": "aws/aws-sdk-php", "version": "3.87.23", @@ -849,6 +931,54 @@ ], "time": "2018-12-04T20:46:45+00:00" }, + { + "name": "hamcrest/hamcrest-php", + "version": "v2.0.0", + "source": { + "type": "git", + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/776503d3a8e85d4f9a1148614f95b7a608b046ad", + "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad", + "shasum": "" + }, + "require": { + "php": "^5.3|^7.0" + }, + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" + }, + "require-dev": { + "phpunit/php-file-iterator": "1.3.3", + "phpunit/phpunit": "~4.0", + "satooshi/php-coveralls": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "hamcrest" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD" + ], + "description": "This is the PHP port of Hamcrest Matchers", + "keywords": [ + "test" + ], + "time": "2016-01-20T08:20:44+00:00" + }, { "name": "jane-php/json-schema-runtime", "version": "v4.0.4", @@ -1414,6 +1544,71 @@ ], "time": "2018-11-26T08:09:30+00:00" }, + { + "name": "mockery/mockery", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/mockery/mockery.git", + "reference": "0eb0b48c3f07b3b89f5169ce005b7d05b18cf1d2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mockery/mockery/zipball/0eb0b48c3f07b3b89f5169ce005b7d05b18cf1d2", + "reference": "0eb0b48c3f07b3b89f5169ce005b7d05b18cf1d2", + "shasum": "" + }, + "require": { + "hamcrest/hamcrest-php": "~2.0", + "lib-pcre": ">=7.0", + "php": ">=5.6.0" + }, + "require-dev": { + "phpunit/phpunit": "~5.7.10|~6.5|~7.0|~8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Mockery": "library/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "http://blog.astrumfutura.com" + }, + { + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "http://davedevelopment.co.uk" + } + ], + "description": "Mockery is a simple yet flexible PHP mock object framework", + "homepage": "https://github.com/mockery/mockery", + "keywords": [ + "BDD", + "TDD", + "library", + "mock", + "mock objects", + "mockery", + "stub", + "test", + "test double", + "testing" + ], + "time": "2019-02-13T09:37:52+00:00" + }, { "name": "mtdowling/jmespath.php", "version": "2.4.0", @@ -4533,7 +4728,8 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { - "10up/phpcs-composer": 20 + "10up/phpcs-composer": 20, + "10up/wp_mock": 20 }, "prefer-stable": true, "prefer-lowest": false, From f1b2b2b8e45badf4db3b4f2f3a0cad7e72d73366 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Tue, 5 Mar 2019 14:51:14 -0500 Subject: [PATCH 46/66] Debug phpcs --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4f9f31163..873c54f0a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,9 +8,9 @@ env: before_script: - composer install script: + - ./vendor/bin/phpcs . -v - if [ -n "$AWS_ACCESS_KEY" ]; then ./vendor/bin/wpsnapshots configure 10up --aws_key=$AWS_ACCESS_KEY --aws_secret=$SECRET_ACCESS_KEY --user_name=Travis --user_email=travis@10up.com; fi - if [ -n "$AWS_ACCESS_KEY" ]; then bash run-wpacceptance.sh; fi - - composer run-script lint - ./vendor/bin/phpunit notifications: email: false From 1d094dd231e7585e7f09a5da68cea3a719a197d6 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Tue, 5 Mar 2019 15:47:44 -0500 Subject: [PATCH 47/66] Fix phpcs --- .travis.yml | 2 +- composer.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 873c54f0a..8ae012f47 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,10 @@ env: before_script: - composer install script: - - ./vendor/bin/phpcs . -v - if [ -n "$AWS_ACCESS_KEY" ]; then ./vendor/bin/wpsnapshots configure 10up --aws_key=$AWS_ACCESS_KEY --aws_secret=$SECRET_ACCESS_KEY --user_name=Travis --user_email=travis@10up.com; fi - if [ -n "$AWS_ACCESS_KEY" ]; then bash run-wpacceptance.sh; fi - ./vendor/bin/phpunit + - composer run-script lint notifications: email: false sudo: required diff --git a/composer.json b/composer.json index 6319d19b6..0a3f435e7 100644 --- a/composer.json +++ b/composer.json @@ -23,8 +23,8 @@ "phpunit/phpunit": "~7.5" }, "scripts": { - "lint": "phpcs .", - "lint-fix": "phpcbf ." + "lint": "phpcs distributor.php includes/*", + "lint-fix": "phpcbf distributor.php includes/*" }, "minimum-stability": "dev", "prefer-stable": true From 190319f6f873c5d98e6cebec041bb7272d19f49e Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Tue, 5 Mar 2019 16:28:49 -0500 Subject: [PATCH 48/66] Add phpcs file --- phpcs.xml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 phpcs.xml diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 000000000..2c6812d26 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,3 @@ + + + From 577186fe586ba579a673a414cc4d43aa36a2852b Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Tue, 5 Mar 2019 19:20:34 -0500 Subject: [PATCH 49/66] Debug phpunit --- composer.json | 4 ++-- composer.lock | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 0a3f435e7..294bba050 100644 --- a/composer.json +++ b/composer.json @@ -17,10 +17,10 @@ } }, "require-dev": { - "10up/phpcs-composer": "dev-master", "10up/wpacceptance": "~0.12.0", "10up/wp_mock": "dev-dev", - "phpunit/phpunit": "~7.5" + "phpunit/phpunit": "~7.5", + "10up/phpcs-composer": "dev-master" }, "scripts": { "lint": "phpcs distributor.php includes/*", diff --git a/composer.lock b/composer.lock index d571f8789..59ae4f261 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": "982f0fbadd513142568a088c7b32d000", + "content-hash": "c5eed68ac2398e2155227410b428b455", "packages": [ { "name": "yahnis-elsts/plugin-update-checker", @@ -4728,8 +4728,8 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { - "10up/phpcs-composer": 20, - "10up/wp_mock": 20 + "10up/wp_mock": 20, + "10up/phpcs-composer": 20 }, "prefer-stable": true, "prefer-lowest": false, From aab9207924cdaa2c9881817f341a50845ae71329 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Tue, 5 Mar 2019 19:22:25 -0500 Subject: [PATCH 50/66] PHPCS --- phpcs.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index 2c6812d26..151e60363 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,3 +1,4 @@ - + + From 1e487b72ce416fef316e75c16fd96bdc3561cb7e Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Tue, 5 Mar 2019 19:39:59 -0500 Subject: [PATCH 51/66] Fix phpcs path --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 294bba050..25c75f809 100644 --- a/composer.json +++ b/composer.json @@ -23,8 +23,8 @@ "10up/phpcs-composer": "dev-master" }, "scripts": { - "lint": "phpcs distributor.php includes/*", - "lint-fix": "phpcbf distributor.php includes/*" + "lint": "phpcs .", + "lint-fix": "phpcbf ." }, "minimum-stability": "dev", "prefer-stable": true From bd4ae423084c4dc54d413f795be1235d3b6a9641 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Wed, 6 Mar 2019 11:26:36 -0500 Subject: [PATCH 52/66] PHPCS fixes --- composer.json | 4 ++-- includes/classes/Authentication.php | 2 +- .../WordPressDotcomOauth2Authentication.php | 2 +- .../WordPressDotcomExternalConnection.php | 8 ++++---- .../WordPressExternalConnection.php | 18 +++++++++--------- .../NetworkSiteConnection.php | 2 +- includes/rest-api.php | 2 +- phpcs.xml | 3 ++- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/composer.json b/composer.json index 25c75f809..554b6b6ee 100644 --- a/composer.json +++ b/composer.json @@ -23,8 +23,8 @@ "10up/phpcs-composer": "dev-master" }, "scripts": { - "lint": "phpcs .", - "lint-fix": "phpcbf ." + "lint": "./vendor/bin/phpcs . --runtime-set testVersion 5.6-", + "lint-fix": "phpcbf . --runtime-set testVersion 5.6-" }, "minimum-stability": "dev", "prefer-stable": true diff --git a/includes/classes/Authentication.php b/includes/classes/Authentication.php index 987e31b1a..846f2951a 100644 --- a/includes/classes/Authentication.php +++ b/includes/classes/Authentication.php @@ -22,7 +22,7 @@ abstract class Authentication { * * @var string */ - static public $error_message; + public static $error_message; /** * Set associative arguments as instance variables diff --git a/includes/classes/Authentications/WordPressDotcomOauth2Authentication.php b/includes/classes/Authentications/WordPressDotcomOauth2Authentication.php index 9d1c877a9..71a397ce7 100644 --- a/includes/classes/Authentications/WordPressDotcomOauth2Authentication.php +++ b/includes/classes/Authentications/WordPressDotcomOauth2Authentication.php @@ -506,7 +506,7 @@ public static function is_valid_token( $count = 1 ) { self::log_authentication_error( 'Failed to validate token giving error ' . $response->get_error_message() ); $count ++; if ( $count <= 3 ) { - $this->is_valid_token( $count ); + self::is_valid_token( $count ); } return false; diff --git a/includes/classes/ExternalConnections/WordPressDotcomExternalConnection.php b/includes/classes/ExternalConnections/WordPressDotcomExternalConnection.php index 52e2d29b5..741952a16 100644 --- a/includes/classes/ExternalConnections/WordPressDotcomExternalConnection.php +++ b/includes/classes/ExternalConnections/WordPressDotcomExternalConnection.php @@ -19,27 +19,27 @@ class WordPressDotcomExternalConnection extends WordPressExternalConnection { * * @var string */ - static public $slug = 'wpdotcom'; + public static $slug = 'wpdotcom'; /** * Connection pretty label * * @var string */ - static public $label = 'WordPress.com REST API'; + public static $label = 'WordPress.com REST API'; /** * Connection auth class * * @var string */ - static public $auth_handler_class = '\Distributor\Authentications\WordPressDotcomOauth2Authentication'; + public static $auth_handler_class = '\Distributor\Authentications\WordPressDotcomOauth2Authentication'; /** * Connection REST API namespace * * @var string */ - static public $namespace = 'wp/v2'; + public static $namespace = 'wp/v2'; } diff --git a/includes/classes/ExternalConnections/WordPressExternalConnection.php b/includes/classes/ExternalConnections/WordPressExternalConnection.php index a5f17caa0..4b357d920 100644 --- a/includes/classes/ExternalConnections/WordPressExternalConnection.php +++ b/includes/classes/ExternalConnections/WordPressExternalConnection.php @@ -20,35 +20,35 @@ class WordPressExternalConnection extends ExternalConnection { * * @var string */ - static public $slug = 'wp'; + public static $slug = 'wp'; /** * Connection pretty label * * @var string */ - static public $label = 'WordPress REST API'; + public static $label = 'WordPress REST API'; /** * Auth handler to use * * @var string */ - static public $auth_handler_class = '\Distributor\Authentications\WordPressBasicAuth'; + public static $auth_handler_class = '\Distributor\Authentications\WordPressBasicAuth'; /** * REST API namespace * * @var string */ - static public $namespace = 'wp/v2'; + public static $namespace = 'wp/v2'; /** * Remote request timeout * * @var integer */ - static public $timeout = 5; + public static $timeout = 5; /** * Default post type to pull. @@ -877,8 +877,8 @@ public function check_connections() { private function to_wp_post( $post ) { $obj = new \stdClass(); - $obj->ID = $post['id']; - $obj->post_title = $post['title']['rendered']; + $obj->ID = $post['id']; + $obj->post_title = $post['title']['rendered']; if ( isset( $post['excerpt']['raw'] ) ) { $obj->post_excerpt = $post['excerpt']['raw']; @@ -888,8 +888,8 @@ private function to_wp_post( $post ) { $obj->post_excerpt = ''; } - $obj->post_status = 'draft'; - $obj->post_author = get_current_user_id(); + $obj->post_status = 'draft'; + $obj->post_author = get_current_user_id(); $obj->post_password = $post['password']; $obj->post_date = $post['date']; diff --git a/includes/classes/InternalConnections/NetworkSiteConnection.php b/includes/classes/InternalConnections/NetworkSiteConnection.php index d308d7b8e..f20512f4b 100644 --- a/includes/classes/InternalConnections/NetworkSiteConnection.php +++ b/includes/classes/InternalConnections/NetworkSiteConnection.php @@ -28,7 +28,7 @@ class NetworkSiteConnection extends Connection { * * @var string */ - static public $slug = 'networkblog'; + public static $slug = 'networkblog'; /** * Default post type to pull. diff --git a/includes/rest-api.php b/includes/rest-api.php index 1b255af52..cdfff886c 100644 --- a/includes/rest-api.php +++ b/includes/rest-api.php @@ -144,7 +144,7 @@ function prepare_distributor_content( $response, $post, $request ) { } // Is the local site is running Gutenberg? if ( \Distributor\Utils\is_using_gutenberg( $post ) ) { - $post_data = $response->get_data(); + $post_data = $response->get_data(); $post_data['is_using_gutenberg'] = true; $response->set_data( $post_data ); } diff --git a/phpcs.xml b/phpcs.xml index 151e60363..a380089c9 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,4 +1,5 @@ - + + From f0d96b6376c7ea0667f5f8158a11185f639229bc Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Wed, 6 Mar 2019 12:23:15 -0600 Subject: [PATCH 53/66] Use `maybe_unserialize()` instead of `unserialize()` More safer more better coding standards fix --- includes/classes/InternalConnections/NetworkSiteConnection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/classes/InternalConnections/NetworkSiteConnection.php b/includes/classes/InternalConnections/NetworkSiteConnection.php index 8b49b621d..5bf5dc0cb 100644 --- a/includes/classes/InternalConnections/NetworkSiteConnection.php +++ b/includes/classes/InternalConnections/NetworkSiteConnection.php @@ -186,7 +186,7 @@ public function pull( $items ) { if ( ! empty( $post_props['meta']['dt_connection_map'] ) ) { foreach ( $post_props['meta']['dt_connection_map'] as $distributed ) { - $distributed = unserialize( $distributed ); // @codingStandardsIgnoreLine valid use of unserialize + $distributed = maybe_unserialize( $distributed ); if ( array_key_exists( $current_blog_id, $distributed['internal'] ) ) { $dt_pull_messages['duplicated'] = 1; From a07ea8b4fce2a498a0fbb5f50402aedb60c218f3 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Wed, 6 Mar 2019 13:32:17 -0500 Subject: [PATCH 54/66] Fix phpunit 7.5 compat --- composer.json | 2 +- composer.lock | 31 +++++++++---------- tests/php/NetworkSiteConnectionsTest.php | 2 +- tests/php/WordPressExternalConnectionTest.php | 2 +- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/composer.json b/composer.json index 554b6b6ee..ebe97cf90 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ }, "require-dev": { "10up/wpacceptance": "~0.12.0", - "10up/wp_mock": "dev-dev", + "10up/wp_mock": "~0.4", "phpunit/phpunit": "~7.5", "10up/phpcs-composer": "dev-master" }, diff --git a/composer.lock b/composer.lock index 59ae4f261..f3fbf2756 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": "c5eed68ac2398e2155227410b428b455", + "content-hash": "961d8938d26bcd03aad63064324c81fa", "packages": [ { "name": "yahnis-elsts/plugin-update-checker", @@ -88,27 +88,27 @@ }, { "name": "10up/wp_mock", - "version": "dev-dev", + "version": "0.4.1", "source": { "type": "git", "url": "https://github.com/10up/wp_mock.git", - "reference": "0354413d63cbae920ffc0676443c6d9dd330ce40" + "reference": "5807261f0d8b89160118e2a1ca6ae134746570ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/10up/wp_mock/zipball/0354413d63cbae920ffc0676443c6d9dd330ce40", - "reference": "0354413d63cbae920ffc0676443c6d9dd330ce40", + "url": "https://api.github.com/repos/10up/wp_mock/zipball/5807261f0d8b89160118e2a1ca6ae134746570ea", + "reference": "5807261f0d8b89160118e2a1ca6ae134746570ea", "shasum": "" }, "require": { "antecedent/patchwork": "^2.1", "mockery/mockery": "^1.0", - "php": ">=7.0", - "phpunit/phpunit": ">=6.0" + "php": ">=7.1", + "phpunit/phpunit": ">=7.0" }, "require-dev": { "behat/behat": "^3.0", - "satooshi/php-coveralls": "^1.0", + "php-coveralls/php-coveralls": "^2.1", "sebastian/comparator": ">=1.2.3" }, "type": "library", @@ -122,10 +122,10 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-2.0+" + "GPL-2.0-or-later" ], "description": "A mocking library to take the pain out of unit testing for WordPress", - "time": "2017-12-03T19:27:57+00:00" + "time": "2019-02-26T20:54:47+00:00" }, { "name": "10up/wpacceptance", @@ -279,16 +279,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.87.23", + "version": "3.88.0", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "4f042410335c06aa7ab81365194782a30c144bc2" + "reference": "ae656560625e3d9f9d9010898b98595918bb00f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/4f042410335c06aa7ab81365194782a30c144bc2", - "reference": "4f042410335c06aa7ab81365194782a30c144bc2", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/ae656560625e3d9f9d9010898b98595918bb00f5", + "reference": "ae656560625e3d9f9d9010898b98595918bb00f5", "shasum": "" }, "require": { @@ -357,7 +357,7 @@ "s3", "sdk" ], - "time": "2019-03-04T19:19:05+00:00" + "time": "2019-03-05T19:14:57+00:00" }, { "name": "clue/socket-raw", @@ -4728,7 +4728,6 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { - "10up/wp_mock": 20, "10up/phpcs-composer": 20 }, "prefer-stable": true, diff --git a/tests/php/NetworkSiteConnectionsTest.php b/tests/php/NetworkSiteConnectionsTest.php index 0bb210a9e..15b72a02c 100644 --- a/tests/php/NetworkSiteConnectionsTest.php +++ b/tests/php/NetworkSiteConnectionsTest.php @@ -6,7 +6,7 @@ class NetworkSiteConnectionsTest extends TestCase { - public function setUp() { + public function setUp(): void { $this->site_obj = \Mockery::mock( '\WP_Site', [ 'args' => 1, diff --git a/tests/php/WordPressExternalConnectionTest.php b/tests/php/WordPressExternalConnectionTest.php index 7a3f5aba2..eafccb765 100644 --- a/tests/php/WordPressExternalConnectionTest.php +++ b/tests/php/WordPressExternalConnectionTest.php @@ -6,7 +6,7 @@ class WordPressExternalConnectionTest extends TestCase { - public function setUp() { + public function setUp(): void { $this->auth = new WordPressBasicAuth( array() ); $this->connection = new WordPressExternalConnection( 'name', 'url', 1, $this->auth ); From b9517544a2999370aef0177b8b938ae935cf566c Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Wed, 6 Mar 2019 14:09:59 -0600 Subject: [PATCH 55/66] Tweak readme language about image loading debugging --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2bd099715..d6e354c87 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ The plugin contains a standard test suite compatible with PHPUnit. If you want t You can define a constant `DISTRIBUTOR_DEBUG` to `true` to increase the ease of debugging in Distributor. This will make all remote requests blocking and expose the subscription post type. -Enabling this will also provide needed debug information in your error log for Image side loading issues. +Enabling this will also provide more debugging information in your error log for image side loading issues. The specific logging method may change in the future. ### Work with us From 072ce2d5d353003b1f3441769fd1d2fbf410c68d Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Thu, 7 Mar 2019 00:29:34 -0500 Subject: [PATCH 56/66] Fix tests --- tests/wpacceptance/OembedTest.php | 21 ++++++++++----------- tests/wpacceptance/includes/TestCase.php | 14 ++++++++------ 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/tests/wpacceptance/OembedTest.php b/tests/wpacceptance/OembedTest.php index e0f9557cb..997f06dfe 100644 --- a/tests/wpacceptance/OembedTest.php +++ b/tests/wpacceptance/OembedTest.php @@ -20,7 +20,6 @@ public function testOembedNetworkPushedContent() { // Push post to connection 2. $post_info = $this->pushPost( $I, 48, 2 ); - $I->moveTo( $post_info['distributed_edit_url'] ); // Switch to the text editor. $I->waitUntilElementVisible( '#content-html' ); @@ -71,13 +70,13 @@ public function testOembedExternalPushedContent() { $I->moveTo( 'wp-admin/post-new.php?post_type=dt_ext_connection' ); - $I->fillField( '#title', 'Test External Connection' ); + $I->typeInField( '#title', 'Test External Connection' ); - $I->fillField( '#dt_username', 'wpsnapshots' ); + $I->typeInField( '#dt_username', 'wpsnapshots' ); - $I->fillField( '#dt_external_connection_url', $this->getWPHomeUrl() . '/two/wp-json' ); + $I->typeInField( '#dt_external_connection_url', $this->getWPHomeUrl() . '/two/wp-json' ); - $I->fillField( '#dt_password', 'password' ); + $I->typeInField( '#dt_password', 'password' ); $I->waitUntilElementContainsText( 'Connection established', '.endpoint-result' ); @@ -94,10 +93,11 @@ public function testOembedExternalPushedContent() { $I->waitUntilElementVisible( '#the-list' ); $I->click( 'a.row-title' ); + $I->waitUntilNavigation(); + // Switch to the text editor. $I->waitUntilElementVisible( '#content-html' ); $I->jsClick( '#content-html' ); - // Grab the post content. $I->waitUntilElementVisible( '.wp-editor-area' ); @@ -118,14 +118,13 @@ public function testOembedExternalPulledContent() { $I->moveTo( 'two/wp-admin/post-new.php?post_type=dt_ext_connection' ); - $I->fillField( '#title', 'Test External Connection' ); - - $I->fillField( '#dt_username', 'wpsnapshots' ); + $I->typeInField( '#title', 'Test External Connection' ); - $I->fillField( '#dt_external_connection_url', $this->getWPHomeUrl() . '/wp-json' ); + $I->typeInField( '#dt_username', 'wpsnapshots' ); + $I->typeInField( '#dt_external_connection_url', $this->getWPHomeUrl() . '/wp-json' ); - $I->fillField( '#dt_password', 'password' ); + $I->typeInField( '#dt_password', 'password' ); $I->waitUntilElementContainsText( 'Connection established', '.endpoint-result' ); diff --git a/tests/wpacceptance/includes/TestCase.php b/tests/wpacceptance/includes/TestCase.php index 7e48314d6..386c6ca61 100644 --- a/tests/wpacceptance/includes/TestCase.php +++ b/tests/wpacceptance/includes/TestCase.php @@ -53,6 +53,8 @@ protected function pushPost( \WPAcceptance\PHPUnit\Actor $I, $post_id, $to_conne $I->click( '#dt-as-draft' ); // Uncheck for publish, draft is checked by default } + $I->waitUntilElementEnabled( '#distributor-push-wrapper .syndicate-button' ); + $I->click( '#distributor-push-wrapper .syndicate-button' ); $I->waitUntilElementVisible( '#distributor-push-wrapper .dt-success' ); @@ -62,13 +64,13 @@ protected function pushPost( \WPAcceptance\PHPUnit\Actor $I, $post_id, $to_conne $I->click( '#distributor-push-wrapper .new-connections-list .add-connection[data-connection-id="' . $to_connection_id . '"] a' ); - $I->waitUntilElementVisible( '#wp-admin-bar-edit' ); + $I->waitUntilNavigation(); $info['distributed_front_url'] = $I->getCurrentUrl(); $I->click( '#wp-admin-bar-edit a' ); - $I->waitUntilElementVisible( '#title' ); + $I->waitUntilNavigation(); $info['distributed_edit_url'] = $I->getCurrentUrl(); @@ -113,21 +115,21 @@ protected function pullPost( \WPAcceptance\PHPUnit\Actor $I, $original_post_id, $I->click( '#doaction' ); - $I->waitUntilElementVisible( '#wpadminbar' ); + $I->waitUntilNavigation(); $I->click( '.pulled > a' ); - $I->waitUntilElementVisible( '#wpadminbar' ); + $I->waitUntilNavigation(); $I->moveMouse( '.wp-list-table tbody tr:nth-child(1) .page-title' ); $I->click( '.wp-list-table tbody tr:nth-child(1) .page-title .view a' ); - $I->waitUntilElementVisible( '#wpadminbar' ); + $I->waitUntilNavigation(); $info['distributed_view_url'] = $I->getCurrentUrl(); $I->click( '#wp-admin-bar-edit a' ); - $I->waitUntilElementVisible( '#wpadminbar' ); + $I->waitUntilNavigation(); $info['distributed_edit_url'] = $I->getCurrentUrl(); From cb00313c58f7e42b5b22b76df804929337e808af Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Thu, 7 Mar 2019 09:40:25 -0500 Subject: [PATCH 57/66] Update wpa --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index f3fbf2756..fb21f47df 100644 --- a/composer.lock +++ b/composer.lock @@ -129,16 +129,16 @@ }, { "name": "10up/wpacceptance", - "version": "0.12.1", + "version": "0.12.2", "source": { "type": "git", "url": "https://github.com/10up/wpacceptance.git", - "reference": "0a995e72b23860fb3e1277259fa5536404d905f7" + "reference": "a8663ac15763151990489d42c6303ef5cca5dab9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/10up/wpacceptance/zipball/0a995e72b23860fb3e1277259fa5536404d905f7", - "reference": "0a995e72b23860fb3e1277259fa5536404d905f7", + "url": "https://api.github.com/repos/10up/wpacceptance/zipball/a8663ac15763151990489d42c6303ef5cca5dab9", + "reference": "a8663ac15763151990489d42c6303ef5cca5dab9", "shasum": "" }, "require": { @@ -181,7 +181,7 @@ "testing", "wordpress" ], - "time": "2019-03-05T17:26:37+00:00" + "time": "2019-03-07T14:34:48+00:00" }, { "name": "10up/wpsnapshots", From 9e33c00150acf9d404090a84e3bd27c138a60030 Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Thu, 7 Mar 2019 12:49:18 -0600 Subject: [PATCH 58/66] More clarifying language for basic auth setup. Includes a link to the Application Passwords plugin page on WordPress.org. This is not an admin link because you need it set up on the remote site, not the current site. --- .../classes/Authentications/WordPressBasicAuth.php | 10 ++++++++-- includes/external-connection-cpt.php | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/includes/classes/Authentications/WordPressBasicAuth.php b/includes/classes/Authentications/WordPressBasicAuth.php index 5b0bc9f3c..78278cbb8 100644 --- a/includes/classes/Authentications/WordPressBasicAuth.php +++ b/includes/classes/Authentications/WordPressBasicAuth.php @@ -66,7 +66,7 @@ public static function credentials_form( $args = array() ) {
- +

@@ -81,7 +81,13 @@ public static function credentials_form( $args = array() ) { - + + Important: We strongly recommend using the Application Passwords plugin on the site you are connecting to in order to create a unique password for this connection. This helps limit the use of your primary password and will allow you to revoke access in the future if needed.', 'distributor' ), esc_url( $plugin_link ) ); + ?>

-

+

From fe3ed9a05f0c8149d8777dc87485d4e74690bf9b Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Thu, 7 Mar 2019 12:58:24 -0600 Subject: [PATCH 59/66] Better visual hierarchy for .com oAuth connection setup --- assets/css/admin-external-connection.css | 10 +++++++++- .../WordPressDotcomOauth2Authentication.php | 12 ++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/assets/css/admin-external-connection.css b/assets/css/admin-external-connection.css index 1513b6b24..26fdb38a1 100644 --- a/assets/css/admin-external-connection.css +++ b/assets/css/admin-external-connection.css @@ -49,7 +49,15 @@ #dt_external_connection_details p, #dt_external_connection_details .connection-field-wrap { - margin-bottom: 3em; + margin-bottom: 2em; +} + +#dt_external_connection_details .card { + margin-bottom: 2em; +} + +#dt_external_connection_details .card p { + margin-bottom: 1em; } .endpoint-errors { diff --git a/includes/classes/Authentications/WordPressDotcomOauth2Authentication.php b/includes/classes/Authentications/WordPressDotcomOauth2Authentication.php index 9d1c877a9..7f4fdd9b4 100644 --- a/includes/classes/Authentications/WordPressDotcomOauth2Authentication.php +++ b/includes/classes/Authentications/WordPressDotcomOauth2Authentication.php @@ -102,12 +102,12 @@ public static function credentials_form( $args = array() ) { ) ) { ?> -

- - .
- - -

+
+

+ .

+


+

+
Date: Thu, 7 Mar 2019 14:26:26 -0600 Subject: [PATCH 60/66] More external connection message set up simplification --- includes/classes/Authentications/WordPressBasicAuth.php | 4 ++-- includes/external-connection-cpt.php | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/includes/classes/Authentications/WordPressBasicAuth.php b/includes/classes/Authentications/WordPressBasicAuth.php index 78278cbb8..f040a544c 100644 --- a/includes/classes/Authentications/WordPressBasicAuth.php +++ b/includes/classes/Authentications/WordPressBasicAuth.php @@ -66,7 +66,7 @@ public static function credentials_form( $args = array() ) {
- +

@@ -86,7 +86,7 @@ public static function credentials_form( $args = array() ) { $plugin_link = 'https://wordpress.org/plugins/application-passwords/'; /* translators: %s: Application Passwords plugin URL */ - printf( __( 'Important: We strongly recommend using the Application Passwords plugin on the site you are connecting to in order to create a unique password for this connection. This helps limit the use of your primary password and will allow you to revoke access in the future if needed.', 'distributor' ), esc_url( $plugin_link ) ); + printf( wp_kses( 'Important: We strongly recommend using the Application Passwords plugin on the site you are connecting to in order to create a unique password for this connection. This helps limit the use of your primary password and will allow you to revoke access in the future if needed.', 'distributor' ), esc_url( $plugin_link ) ); ?>

">

-
+
-

From abc0ccdc9affb163b4c8c90c82ce638a732e7aad Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Thu, 7 Mar 2019 15:23:22 -0600 Subject: [PATCH 61/66] Ensure all messages are passed through localization --- includes/classes/Authentications/WordPressBasicAuth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/classes/Authentications/WordPressBasicAuth.php b/includes/classes/Authentications/WordPressBasicAuth.php index 1d5550f30..3cd333f2a 100644 --- a/includes/classes/Authentications/WordPressBasicAuth.php +++ b/includes/classes/Authentications/WordPressBasicAuth.php @@ -86,7 +86,7 @@ public static function credentials_form( $args = array() ) { $plugin_link = 'https://wordpress.org/plugins/application-passwords/'; /* translators: %s: Application Passwords plugin URL */ - printf( wp_kses( 'Important: We strongly recommend using the Application Passwords plugin on the site you are connecting to in order to create a unique password for this connection. This helps limit the use of your primary password and will allow you to revoke access in the future if needed.', 'distributor' ), esc_url( $plugin_link ) ); + printf( wp_kses( __( 'Important: We strongly recommend using the Application Passwords plugin on the site you are connecting to in order to create a unique password for this connection. This helps limit the use of your primary password and will allow you to revoke access in the future if needed.', 'distributor' ) ), esc_url( $plugin_link ) ); ?>

Date: Thu, 7 Mar 2019 14:59:30 -0600 Subject: [PATCH 62/66] Version bump to 1.4 --- distributor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distributor.php b/distributor.php index 5074d9307..72af073dc 100644 --- a/distributor.php +++ b/distributor.php @@ -2,7 +2,7 @@ /** * Plugin Name: Distributor * Description: Makes it easy to syndicate and reuse content across your websites, whether inside of a multisite or across the web. - * Version: 1.3.10 + * Version: 1.4.0 * Author: 10up Inc. * Author URI: https://distributorplugin.com * License: GPLv2 or later @@ -17,7 +17,7 @@ exit; // Exit if accessed directly. } -define( 'DT_VERSION', '1.3.10-dev' ); +define( 'DT_VERSION', '1.4.0-dev' ); define( 'DT_PLUGIN_FILE', preg_replace( '#^.*plugins/(.*)$#i', '$1', __FILE__ ) ); // Define a constant if we're network activated to allow plugin to respond accordingly. From 2af19112787225ed67390cf9595bd006ead6e637 Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Thu, 7 Mar 2019 15:24:46 -0600 Subject: [PATCH 63/66] POT bump --- lang/distributor.pot | 324 +++++++++++++++++++++++-------------------- 1 file changed, 177 insertions(+), 147 deletions(-) diff --git a/lang/distributor.pot b/lang/distributor.pot index 7542bb3a3..07d9826c4 100644 --- a/lang/distributor.pot +++ b/lang/distributor.pot @@ -2,16 +2,16 @@ # This file is distributed under the GPLv2 or later. msgid "" msgstr "" -"Project-Id-Version: Distributor 1.3.8\n" +"Project-Id-Version: Distributor 1.4.0\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/distributor\n" -"POT-Creation-Date: 2019-02-21 20:44:53+00:00\n" +"POT-Creation-Date: 2019-03-07 21:24:08+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -"X-Generator: node-wp-i18n 1.1.1\n" +"X-Generator: node-wp-i18n 1.2.1\n" #: distributor.php:63 msgid "Distributor requires PHP version 5.6." @@ -96,8 +96,8 @@ msgstr "" #: includes/classes/Authentications/WordPressBasicAuth.php:69 msgid "" -"We need a username (preferrably with an Administrator role) to the " -"WordPress site with the API." +"A username from the external WordPress site to connect with. For full " +"functionality, this needs to be a user with an administrator role." msgstr "" #: includes/classes/Authentications/WordPressBasicAuth.php:73 @@ -108,6 +108,16 @@ msgstr "" msgid "(Change)" msgstr "" +#: includes/classes/Authentications/WordPressBasicAuth.php:89 +#. translators: %s: Application Passwords plugin URL +msgid "" +"Important: We strongly recommend using the Application Passwords plugin on the site you are connecting " +"to in order to create a unique password for this connection. This helps " +"limit the use of your primary password and will allow you to revoke access " +"in the future if needed." +msgstr "" + #: includes/classes/Authentications/WordPressDotcomOauth2Authentication.php:106 msgid "To connect, first " msgstr "" @@ -162,7 +172,7 @@ msgid "Edit \"%s\"" msgstr "" #: includes/classes/ExternalConnectionListTable.php:74 -#: includes/classes/PullListTable.php:299 +#: includes/classes/PullListTable.php:335 msgid "Edit" msgstr "" @@ -189,35 +199,35 @@ msgstr "" msgid "Delete Permanently" msgstr "" -#: includes/classes/ExternalConnections/WordPressExternalConnection.php:188 -#: includes/classes/ExternalConnections/WordPressExternalConnection.php:302 -#: includes/classes/ExternalConnections/WordPressExternalConnection.php:689 +#: includes/classes/ExternalConnections/WordPressExternalConnection.php:194 +#: includes/classes/ExternalConnections/WordPressExternalConnection.php:308 +#: includes/classes/ExternalConnections/WordPressExternalConnection.php:695 msgid "Could not connect to API endpoint." msgstr "" -#: includes/classes/ExternalConnections/WordPressExternalConnection.php:194 -#: includes/classes/ExternalConnections/WordPressExternalConnection.php:316 -#: includes/classes/ExternalConnections/WordPressExternalConnection.php:518 -#: includes/classes/ExternalConnections/WordPressExternalConnection.php:636 -#: includes/classes/ExternalConnections/WordPressExternalConnection.php:695 +#: includes/classes/ExternalConnections/WordPressExternalConnection.php:200 +#: includes/classes/ExternalConnections/WordPressExternalConnection.php:322 +#: includes/classes/ExternalConnections/WordPressExternalConnection.php:524 +#: includes/classes/ExternalConnections/WordPressExternalConnection.php:642 +#: includes/classes/ExternalConnections/WordPressExternalConnection.php:701 msgid "Response body is empty" msgstr "" -#: includes/classes/ExternalConnections/WordPressExternalConnection.php:200 #: includes/classes/ExternalConnections/WordPressExternalConnection.php:206 -#: includes/classes/ExternalConnections/WordPressExternalConnection.php:526 +#: includes/classes/ExternalConnections/WordPressExternalConnection.php:212 +#: includes/classes/ExternalConnections/WordPressExternalConnection.php:532 msgid "Could not determine remote post type endpoint" msgstr "" -#: includes/classes/ExternalConnections/WordPressExternalConnection.php:308 +#: includes/classes/ExternalConnections/WordPressExternalConnection.php:314 msgid "API endpoint error." msgstr "" -#: includes/classes/ExternalConnections/WordPressExternalConnection.php:476 +#: includes/classes/ExternalConnections/WordPressExternalConnection.php:482 msgid "Post id required to push" msgstr "" -#: includes/classes/ExternalConnections/WordPressExternalConnection.php:644 +#: includes/classes/ExternalConnections/WordPressExternalConnection.php:650 msgid "Could not determine remote post id." msgstr "" @@ -230,100 +240,103 @@ msgstr "" msgid "Date" msgstr "" -#: includes/classes/PullListTable.php:93 +#: includes/classes/PullListTable.php:124 msgid "New" msgstr "" -#: includes/classes/PullListTable.php:94 +#: includes/classes/PullListTable.php:125 msgid "Pulled" msgstr "" -#: includes/classes/PullListTable.php:95 +#: includes/classes/PullListTable.php:126 msgid "Skipped" msgstr "" -#: includes/classes/PullListTable.php:137 +#: includes/classes/PullListTable.php:168 msgid "Select bulk action" msgstr "" -#: includes/classes/PullListTable.php:146 +#: includes/classes/PullListTable.php:177 msgid "Apply" msgstr "" -#: includes/classes/PullListTable.php:168 +#: includes/classes/PullListTable.php:199 msgid "Post deleted." msgstr "" -#: includes/classes/PullListTable.php:170 -#: includes/classes/PullListTable.php:189 +#: includes/classes/PullListTable.php:201 +#: includes/classes/PullListTable.php:222 msgid "Y/m/d g:i:s a" msgstr "" -#: includes/classes/PullListTable.php:175 -#: includes/classes/PullListTable.php:196 +#: includes/classes/PullListTable.php:207 +#: includes/classes/PullListTable.php:230 +#. translators: %s: a human readable time msgid "%s ago" msgstr "" -#: includes/classes/PullListTable.php:180 +#: includes/classes/PullListTable.php:213 +#. translators: %s: time of pull msgid "Pulled %s" msgstr "" -#: includes/classes/PullListTable.php:185 -#: includes/classes/PullListTable.php:186 +#: includes/classes/PullListTable.php:218 +#: includes/classes/PullListTable.php:219 msgid "Unpublished" msgstr "" -#: includes/classes/PullListTable.php:198 +#: includes/classes/PullListTable.php:232 msgid "Y/m/d" msgstr "" -#: includes/classes/PullListTable.php:203 +#: includes/classes/PullListTable.php:237 msgid "Published" msgstr "" -#: includes/classes/PullListTable.php:206 +#: includes/classes/PullListTable.php:240 msgid "Missed schedule" msgstr "" -#: includes/classes/PullListTable.php:208 +#: includes/classes/PullListTable.php:242 msgid "Scheduled" msgstr "" -#: includes/classes/PullListTable.php:211 +#: includes/classes/PullListTable.php:245 msgid "Last Modified" msgstr "" -#: includes/classes/PullListTable.php:238 -#: includes/external-connection-cpt.php:213 +#: includes/classes/PullListTable.php:273 +#: includes/external-connection-cpt.php:214 msgid "None" msgstr "" -#: includes/classes/PullListTable.php:284 -#: includes/classes/PullListTable.php:289 -#: includes/classes/PullListTable.php:298 includes/push-ui.php:437 -#: includes/push-ui.php:472 +#: includes/classes/PullListTable.php:320 +#: includes/classes/PullListTable.php:325 +#: includes/classes/PullListTable.php:334 includes/push-ui.php:438 +#: includes/push-ui.php:474 msgid "View" msgstr "" -#: includes/classes/PullListTable.php:285 -#: includes/classes/PullListTable.php:439 +#: includes/classes/PullListTable.php:321 +#: includes/classes/PullListTable.php:476 msgid "Skip" msgstr "" -#: includes/classes/PullListTable.php:307 +#: includes/classes/PullListTable.php:343 msgid "(no title)" msgstr "" -#: includes/classes/PullListTable.php:422 +#: includes/classes/PullListTable.php:459 +#. translators: %s: the post title or draft msgid "Select %s" msgstr "" -#: includes/classes/PullListTable.php:438 -#: includes/classes/PullListTable.php:443 +#: includes/classes/PullListTable.php:475 +#: includes/classes/PullListTable.php:480 msgid "Pull" msgstr "" -#: includes/classes/PullListTable.php:472 +#: includes/classes/PullListTable.php:509 msgid "Filter" msgstr "" @@ -331,14 +344,17 @@ msgstr "" msgid "Distributor" msgstr "" -#: includes/distributed-post-ui.php:55 +#: includes/distributed-post-ui.php:58 +#. translators: %1$s: Post type singular name, %2$s: Post type singular name, +#. %3$s: Pos type name msgid "" "The number of connections this %1$s has been distributed to is shown in the " "publish meta box. If this %2$s is deleted, it could have ramifications " "across all those %3$s." msgstr "" -#: includes/distributed-post-ui.php:86 +#: includes/distributed-post-ui.php:90 +#. translators: %d: number of connections msgid "Distributed to %d connection" msgid_plural "Distributed to %d connections" msgstr[0] "" @@ -348,82 +364,79 @@ msgstr[1] "" msgid "Status" msgstr "" -#: includes/external-connection-cpt.php:85 +#: includes/external-connection-cpt.php:86 +#. translators: %s: human readable time difference msgid "Last Checked on %s" msgstr "" -#: includes/external-connection-cpt.php:88 +#: includes/external-connection-cpt.php:89 msgid "(Verify)" msgstr "" -#: includes/external-connection-cpt.php:193 +#: includes/external-connection-cpt.php:194 msgid "URL" msgstr "" -#: includes/external-connection-cpt.php:276 +#: includes/external-connection-cpt.php:277 msgid "No connection found." msgstr "" -#: includes/external-connection-cpt.php:277 +#: includes/external-connection-cpt.php:278 msgid "Connection established." msgstr "" -#: includes/external-connection-cpt.php:278 +#: includes/external-connection-cpt.php:279 msgid "Limited connection established." msgstr "" -#: includes/external-connection-cpt.php:279 +#: includes/external-connection-cpt.php:280 msgid "Push distribution unavailable." msgstr "" -#: includes/external-connection-cpt.php:280 +#: includes/external-connection-cpt.php:281 msgid "Pull distribution limited to basic content, i.e. title and content body." msgstr "" -#: includes/external-connection-cpt.php:281 +#: includes/external-connection-cpt.php:282 msgid "Did you mean: " msgstr "" -#: includes/external-connection-cpt.php:282 +#: includes/external-connection-cpt.php:283 msgid "Checking endpoint..." msgstr "" -#: includes/external-connection-cpt.php:283 +#: includes/external-connection-cpt.php:284 msgid "Authentication failed." msgstr "" -#: includes/external-connection-cpt.php:284 +#: includes/external-connection-cpt.php:285 msgid "Change" msgstr "" -#: includes/external-connection-cpt.php:285 +#: includes/external-connection-cpt.php:286 msgid "Cancel" msgstr "" -#: includes/external-connection-cpt.php:286 +#: includes/external-connection-cpt.php:287 msgid "Distributor not installed on remote site." msgstr "" -#: includes/external-connection-cpt.php:287 +#: includes/external-connection-cpt.php:288 msgid "" "Be careful assigning less trusted roles push privileges as they will " "inherit the capabilities of the user on the remote site." msgstr "" -#: includes/external-connection-cpt.php:313 -msgid "Enter external connection name" +#: includes/external-connection-cpt.php:314 +msgid "Label this external connection" msgstr "" -#: includes/external-connection-cpt.php:395 +#: includes/external-connection-cpt.php:396 msgid "External Connection Details" msgstr "" -#: includes/external-connection-cpt.php:447 -msgid "External Connection Type" -msgstr "" - -#: includes/external-connection-cpt.php:453 -msgid "We need to know what type of API we are communicating with." +#: includes/external-connection-cpt.php:448 +msgid "Authentication Method" msgstr "" #: includes/external-connection-cpt.php:473 @@ -436,8 +449,9 @@ msgstr "" #: includes/external-connection-cpt.php:496 msgid "" -"Please be warned all these users will inherit the permissions of the user " -"on the remote site" +"Select the roles of users on this site that will be allowed to push content " +"to this connection. Keep in mind that pushing will use the permissions of " +"the user credentials provided for this connection." msgstr "" #: includes/external-connection-cpt.php:505 @@ -455,7 +469,7 @@ msgstr "" #: includes/external-connection-cpt.php:529 #: includes/external-connection-cpt.php:598 #: includes/external-connection-cpt.php:599 -#: includes/external-connection-cpt.php:620 includes/pull-ui.php:372 +#: includes/external-connection-cpt.php:620 includes/pull-ui.php:368 msgid "External Connections" msgstr "" @@ -517,31 +531,33 @@ msgstr "" msgid "Custom field deleted." msgstr "" -#: includes/external-connection-cpt.php:668 +#: includes/external-connection-cpt.php:669 +#. translators: %s: revision title msgid " External connection restored to revision from %s" msgstr "" -#: includes/external-connection-cpt.php:669 +#: includes/external-connection-cpt.php:670 msgid "External connection created." msgstr "" -#: includes/external-connection-cpt.php:670 +#: includes/external-connection-cpt.php:671 msgid "External connection saved." msgstr "" -#: includes/external-connection-cpt.php:671 +#: includes/external-connection-cpt.php:672 msgid "External connection submitted." msgstr "" -#: includes/external-connection-cpt.php:673 +#: includes/external-connection-cpt.php:675 +#. translators: %s: a date and time msgid "External connection scheduled for: %1$s." msgstr "" -#: includes/external-connection-cpt.php:674 +#: includes/external-connection-cpt.php:676 msgid "M j, Y @ G:i" msgstr "" -#: includes/external-connection-cpt.php:676 +#: includes/external-connection-cpt.php:678 msgid "External connection draft updated." msgstr "" @@ -553,95 +569,97 @@ msgstr "" msgid "Posts per page" msgstr "" -#: includes/pull-ui.php:194 includes/pull-ui.php:264 +#: includes/pull-ui.php:194 includes/pull-ui.php:262 msgid "Cheatin’ uh?" msgstr "" -#: includes/pull-ui.php:195 includes/pull-ui.php:265 +#: includes/pull-ui.php:195 includes/pull-ui.php:263 msgid "Sorry, you are not allowed to add this item." msgstr "" -#: includes/pull-ui.php:341 +#: includes/pull-ui.php:337 msgid "No Connections to Pull from," msgstr "" -#: includes/pull-ui.php:343 +#: includes/pull-ui.php:339 msgid "Create One?" msgstr "" -#: includes/pull-ui.php:346 +#: includes/pull-ui.php:342 msgid "Pull Content from" msgstr "" -#: includes/pull-ui.php:350 +#: includes/pull-ui.php:346 msgid "Network Connections" msgstr "" -#: includes/pull-ui.php:419 +#: includes/pull-ui.php:415 msgid "Post(s) have been marked as skipped." msgstr "" -#: includes/pull-ui.php:425 +#: includes/pull-ui.php:421 msgid "Post(s) have been pulled." msgstr "" -#: includes/pull-ui.php:431 +#: includes/pull-ui.php:427 msgid "Post(s) have been already distributed." msgstr "" -#: includes/pull-ui.php:438 +#: includes/pull-ui.php:434 msgid "Could not pull content from connection due to error." msgstr "" -#: includes/pull-ui.php:450 +#: includes/pull-ui.php:446 msgid "Search" msgstr "" -#: includes/push-ui.php:306 +#: includes/push-ui.php:307 +#. translators: %s: post type name msgid "This %s has been distributed from" msgstr "" -#: includes/push-ui.php:309 +#: includes/push-ui.php:310 msgid "You can " msgstr "" -#: includes/push-ui.php:310 +#: includes/push-ui.php:311 msgid "view the original" msgstr "" -#: includes/push-ui.php:446 +#: includes/push-ui.php:448 +#. translators: %s the post title msgid "Distribute "%s" to other connections." msgstr "" -#: includes/push-ui.php:451 +#: includes/push-ui.php:453 msgid "Search available connections" msgstr "" -#: includes/push-ui.php:481 +#: includes/push-ui.php:483 msgid "Selected connections" msgstr "" -#: includes/push-ui.php:482 +#: includes/push-ui.php:484 msgid "No connections selected" msgstr "" -#: includes/push-ui.php:499 +#: includes/push-ui.php:501 msgid "Distribute" msgstr "" -#: includes/push-ui.php:499 +#: includes/push-ui.php:501 msgid "As draft" msgstr "" -#: includes/push-ui.php:505 +#: includes/push-ui.php:507 msgid "Post successfully distributed." msgstr "" -#: includes/push-ui.php:508 +#: includes/push-ui.php:510 msgid "There was an issue distributing the post." msgstr "" -#: includes/push-ui.php:514 +#: includes/push-ui.php:516 msgid "No connections available for distribution." msgstr "" @@ -665,11 +683,13 @@ msgstr "" msgid "Original site url for Distributor." msgstr "" -#: includes/settings.php:111 +#: includes/settings.php:112 +#. translators: %s: distributor notice url msgid "Register for a free Distributor key to receive updates." msgstr "" -#: includes/settings.php:129 +#: includes/settings.php:131 +#. translators: %1$s: npm commands, %2$s: distributor url msgid "" "You appear to be running a development version of Distributor. Certain " "features may not work correctly without regularly running %1$s. If " @@ -678,63 +698,64 @@ msgid "" "instead." msgstr "" -#: includes/settings.php:151 +#: includes/settings.php:154 +#. translators: %s: distributor url msgid "" "Register Distributor to receive important plugin update " "notices and other Distributor news." msgstr "" -#: includes/settings.php:178 +#: includes/settings.php:181 msgid "Override Author Byline" msgstr "" -#: includes/settings.php:180 +#: includes/settings.php:183 msgid "Media Handling" msgstr "" -#: includes/settings.php:183 includes/settings.php:221 -#: includes/settings.php:328 includes/settings.php:331 +#: includes/settings.php:186 includes/settings.php:224 +#: includes/settings.php:331 includes/settings.php:334 msgid "Registration Key" msgstr "" -#: includes/settings.php:203 +#: includes/settings.php:206 msgid "" "For linked distributed posts, replace the author name and link with the " "original site name and link." msgstr "" -#: includes/settings.php:221 includes/settings.php:331 +#: includes/settings.php:224 includes/settings.php:334 msgid "Email" msgstr "" -#: includes/settings.php:225 includes/settings.php:335 +#: includes/settings.php:228 includes/settings.php:338 msgid "" "Registration is 100% free and provides update notifications and upgrades " "inside the dashboard; Register for your key." msgstr "" -#: includes/settings.php:242 +#: includes/settings.php:245 msgid "Process the featured image only (default)." msgstr "" -#: includes/settings.php:247 +#: includes/settings.php:250 msgid "Process the featured image and any attached images." msgstr "" -#: includes/settings.php:270 +#: includes/settings.php:273 msgid "Settings" msgstr "" -#: includes/settings.php:290 +#: includes/settings.php:293 msgid "Distributor Settings" msgstr "" -#: includes/settings.php:317 +#: includes/settings.php:320 msgid "Distributor Network Settings" msgstr "" -#: includes/settings.php:361 +#: includes/settings.php:364 msgid "Security error!" msgstr "" @@ -754,53 +775,62 @@ msgstr "" msgid "Linked" msgstr "" -#: includes/syndicated-post-ui.php:195 +#: includes/syndicated-post-ui.php:197 msgid "Distributed on: " msgstr "" -#: includes/syndicated-post-ui.php:223 +#: includes/syndicated-post-ui.php:225 msgid "Revisions" msgstr "" -#: includes/syndicated-post-ui.php:236 +#: includes/syndicated-post-ui.php:240 +#. translators: %s the post type name msgid "Distributed %s do not support revisions unless unlinked." msgstr "" -#: includes/syndicated-post-ui.php:422 includes/syndicated-post-ui.php:523 +#: includes/syndicated-post-ui.php:429 includes/syndicated-post-ui.php:540 +#. translators: %d: the blog ID +#. translators: %d: the original blog id msgid "Blog #%d" msgstr "" -#: includes/syndicated-post-ui.php:434 +#: includes/syndicated-post-ui.php:443 +#. translators: %1$s: post type name, %2$s: site url, %3$s: site name msgid "" "This %1$s was distributed from %3$s. However, the " "original has been deleted." msgstr "" -#: includes/syndicated-post-ui.php:438 +#: includes/syndicated-post-ui.php:450 +#. translators: %1$s: site url, %2$s: site name msgid "Distributed from %2$s." msgstr "" -#: includes/syndicated-post-ui.php:440 +#: includes/syndicated-post-ui.php:454 +#. translators: %1$s: post type name, %2$s: unlink url msgid "" "The original %1$s will update this version unless you unlink from the original." msgstr "" -#: includes/syndicated-post-ui.php:445 +#: includes/syndicated-post-ui.php:460 +#. translators: %1$s: site url, %2$s: site name msgid "Originally distributed from %1$s." msgstr "" -#: includes/syndicated-post-ui.php:446 +#: includes/syndicated-post-ui.php:462 +#. translators: %1$s: post type name, %2$s: link url msgid "" "This %1$s has been unlinked from the original. However, you can always restore it." msgstr "" -#: includes/template-tags.php:177 +#: includes/template-tags.php:178 +#. translators: %1$s: site url, %2$s; site name msgid "By %2$s" msgstr "" -#: includes/template-tags.php:230 +#: includes/template-tags.php:231 msgid "Distributed from" msgstr "" @@ -813,23 +843,23 @@ msgstr "" msgid "Input" msgstr "" -#: vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Plugin/UpdateChecker.php:395 -msgid "Check for updates" -msgstr "" - -#: vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Plugin/UpdateChecker.php:432 +#: vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Plugin/Ui.php:54 msgid "View details" msgstr "" -#: vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Plugin/UpdateChecker.php:455 +#: vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Plugin/Ui.php:77 msgid "More information about %s" msgstr "" -#: vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Plugin/UpdateChecker.php:558 +#: vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Plugin/Ui.php:128 +msgid "Check for updates" +msgstr "" + +#: vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Plugin/Ui.php:223 msgid "Unknown update checker status \"%s\"" msgstr "" -#: vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Vcs/PluginUpdateChecker.php:98 +#: vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Vcs/PluginUpdateChecker.php:98 msgid "There is no changelog available." msgstr "" @@ -856,17 +886,17 @@ msgctxt "verb" msgid "Trash" msgstr "" -#: vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Plugin/UpdateChecker.php:548 +#: vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Plugin/Ui.php:213 msgctxt "the plugin title" msgid "The %s plugin is up to date." msgstr "" -#: vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Plugin/UpdateChecker.php:550 +#: vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Plugin/Ui.php:215 msgctxt "the plugin title" msgid "A new version of the %s plugin is available." msgstr "" -#: vendor/yahnis-elsts/plugin-update-checker/Puc/v4p4/Plugin/UpdateChecker.php:552 +#: vendor/yahnis-elsts/plugin-update-checker/Puc/v4p5/Plugin/Ui.php:217 msgctxt "the plugin title" msgid "Could not determine if updates are available for %s." msgstr "" \ No newline at end of file From d20bc99bd3242482590ad70eeee1618f6d60fa2a Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Thu, 7 Mar 2019 15:29:39 -0600 Subject: [PATCH 64/66] Changelog for 1.4 --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bad7e61c0..928adcde9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to this project will be documented in this file, per [the Keep a Changelog standard](http://keepachangelog.com/). +## [ 1.4.0 ] - 2019-03-07 +### Added +* Clearer instructions and help text when adding a external connection. +* Log image sideloading failures whe using `DISTRIBUTOR_DEBUG`. + +### Fixed +* Allow attachments to be distributed from local environments. +* Ensure pagination is reset when switching views on the pull content screen. +* Remove extraneous checkboxes from pulled content screen. +* Suppress a PHP warning when no meta is being distributed for attachments. + ## [ 1.3.9 ] - 2019-02-21 ### Fixed * Ensure posts distributed as draft can be published. From 1edbd08a17c8aac8c565ddfb926bd1962fe7117b Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Thu, 7 Mar 2019 15:36:35 -0600 Subject: [PATCH 65/66] Fix changelog typos ::eyes MacBook keyboard suspiciously:: --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 928adcde9..be1ee710e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,8 @@ All notable changes to this project will be documented in this file, per [the Ke ## [ 1.4.0 ] - 2019-03-07 ### Added -* Clearer instructions and help text when adding a external connection. -* Log image sideloading failures whe using `DISTRIBUTOR_DEBUG`. +* Clearer instructions and help text when adding an external connection. +* Log image sideloading failures when using `DISTRIBUTOR_DEBUG`. ### Fixed * Allow attachments to be distributed from local environments. From 2bdd53781896748a29b6413019a1ddbebaaabd55 Mon Sep 17 00:00:00 2001 From: Adam Silverstein Date: Thu, 7 Mar 2019 15:30:02 -0700 Subject: [PATCH 66/66] wp_kses -> wp_kses_post fixes a display issue --- includes/classes/Authentications/WordPressBasicAuth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/classes/Authentications/WordPressBasicAuth.php b/includes/classes/Authentications/WordPressBasicAuth.php index 3cd333f2a..f672d5143 100644 --- a/includes/classes/Authentications/WordPressBasicAuth.php +++ b/includes/classes/Authentications/WordPressBasicAuth.php @@ -86,7 +86,7 @@ public static function credentials_form( $args = array() ) { $plugin_link = 'https://wordpress.org/plugins/application-passwords/'; /* translators: %s: Application Passwords plugin URL */ - printf( wp_kses( __( 'Important: We strongly recommend using the Application Passwords plugin on the site you are connecting to in order to create a unique password for this connection. This helps limit the use of your primary password and will allow you to revoke access in the future if needed.', 'distributor' ) ), esc_url( $plugin_link ) ); + printf( wp_kses_post( __( 'Important: We strongly recommend using the Application Passwords plugin on the site you are connecting to in order to create a unique password for this connection. This helps limit the use of your primary password and will allow you to revoke access in the future if needed.', 'distributor' ) ), esc_url( $plugin_link ) ); ?>