From c5123f95b310efc7fa85aaf99c5a4cbf938e0760 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Thu, 1 Feb 2018 13:06:46 +0200 Subject: [PATCH 1/7] Add WP-CLI Script to create Comments --- bin/create-comments-on-test-post.php | 860 +++++++++++++++++++++++++++ 1 file changed, 860 insertions(+) create mode 100644 bin/create-comments-on-test-post.php diff --git a/bin/create-comments-on-test-post.php b/bin/create-comments-on-test-post.php new file mode 100644 index 00000000000..ac92f858c78 --- /dev/null +++ b/bin/create-comments-on-test-post.php @@ -0,0 +1,860 @@ + 'amp-test-comments' ) ); + if ( $q->have_posts() ) { + $post = $q->next_post(); + $post_id = $post->ID; + } else { + $post_id = wp_insert_post( array( + 'post_name' => 'amp-test-comments', + 'post_title' => 'AMP Test Comments', + 'post_type' => 'post', + 'post_status' => 'publish', + ) ); + + if ( ! $post_id || is_wp_error( $post_id ) ) { + throw new Exception( 'The test post could not be added, please try again.' ); + } + } + + $content = wp_remote_get( 'https://loripsum.net/api/10/short/headers' ); + if ( is_wp_error( $content ) ) { + throw new Exception( 'Could not get test content, please try again.' ); + } + $update = wp_update_post( wp_slash( array( + 'ID' => $post_id, + 'post_content' => wp_remote_retrieve_body( $content ), + ) ) ); + + if ( ! $update ) { + throw new Exception( 'The test post could not be updated, please try again.' ); + } else { + amp_add_comments( $update ); + } + + return $update; +} + +/** + * Add Comments to the post. + * + * @throws Exception If a comment can't be added. + * @param int $post_id The post ID to add comments to. + */ +function amp_add_comments( $post_id ) { + $data = amp_get_test_comment_entries(); + $ids = array(); + // get some paragraphs. + $content = array_filter( file( 'https://loripsum.net/api/' . count( $data ) . '/short' ), function ( $s ) { + return ! empty( trim( $s ) ); + } ); + sort( $content ); + $content = array_filter( $content ); + foreach ( $data as $inx => $comment ) { + $comment['comment_post_ID'] = $post_id; + $yes_no = rand( 0, 1 ); + // 50% chance of this comment being a reply :) + if ( 1 === $yes_no && ! empty( $ids ) ) { + $comment['comment_parent'] = $ids[ rand( 0, count( $ids ) - 1 ) ]; + } + $comment['comment_content'] = $content[ $inx ]; + $comment_id = wp_insert_comment( $comment ); + if ( ! $comment_id || is_wp_error( $comment_id ) ) { + throw new Exception( 'The test comment could not be added, please try again.' ); + } + $ids[] = $comment_id; + } +} + +/** + * Get test comment entries. + * + * @return array Data entries. + */ +function amp_get_test_comment_entries() { + return array( + array( + 'comment_author' => 'Hasad Levy', + 'comment_author_email' => 'nibh@Quisque.edu', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Orci Phasellus Dapibus Associates', + 'comment_date' => '2018-03-08 05:49:46', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Aurelia Simmons', + 'comment_author_email' => 'natoque.penatibus.et@Inscelerisquescelerisque.org', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Cursus Corporation', + 'comment_date' => '2017-06-20 03:39:16', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Eaton Huffman', + 'comment_author_email' => 'lectus.convallis@arcuimperdietullamcorper.net', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Vestibulum PC', + 'comment_date' => '2017-08-31 06:48:05', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Vladimir Tucker', + 'comment_author_email' => 'ultrices.mauris@risusaultricies.edu', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Facilisis Incorporated', + 'comment_date' => '2019-01-19 10:21:50', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Acton Burch', + 'comment_author_email' => 'nec.malesuada.ut@MorbivehiculaPellentesque.co.uk', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Mi Limited', + 'comment_date' => '2017-03-12 07:41:02', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Paloma Sparks', + 'comment_author_email' => 'sodales.purus@euaccumsan.net', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Cursus Nunc PC', + 'comment_date' => '2018-11-29 14:25:31', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Shea Santana', + 'comment_author_email' => 'augue.Sed@Nullamvitaediam.org', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Cursus Non Corporation', + 'comment_date' => '2018-11-26 19:04:14', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Justina Clements', + 'comment_author_email' => 'eget@eu.org', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Elit Company', + 'comment_date' => '2017-03-22 05:55:50', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Erich Warren', + 'comment_author_email' => 'magna.et.ipsum@condimentumDonecat.co.uk', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Mauris Molestie Pharetra Ltd', + 'comment_date' => '2018-11-23 23:21:56', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Juliet Gibbs', + 'comment_author_email' => 'magnis@mitempor.com', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Nec Urna Incorporated', + 'comment_date' => '2018-04-21 01:01:52', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Nicholas Ellison', + 'comment_author_email' => 'ut.nisi.a@auctorullamcorpernisl.org', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Iaculis Quis Pede Limited', + 'comment_date' => '2019-01-14 04:59:03', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Jerome Cotton', + 'comment_author_email' => 'a.auctor.non@ornare.co.uk', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Nisi Magna Sed Institute', + 'comment_date' => '2018-03-19 15:38:28', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Brynn Day', + 'comment_author_email' => 'nulla@Crasvehiculaaliquet.edu', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Donec LLP', + 'comment_date' => '2017-08-18 03:55:45', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Grace Irwin', + 'comment_author_email' => 'tincidunt.tempus.risus@convallis.edu', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Mauris Rhoncus Id Industries', + 'comment_date' => '2018-07-26 22:28:58', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Jenna Wilkinson', + 'comment_author_email' => 'auctor.velit@dictumeu.com', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Eget Dictum Placerat Corporation', + 'comment_date' => '2017-02-06 02:28:57', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Keelie Medina', + 'comment_author_email' => 'elementum.lorem@fames.org', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Diam Lorem Auctor Institute', + 'comment_date' => '2018-07-28 22:02:50', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Gavin Ortega', + 'comment_author_email' => 'feugiat.Sed.nec@commodoauctorvelit.ca', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Quam Curabitur Associates', + 'comment_date' => '2017-12-25 17:57:58', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Price Conrad', + 'comment_author_email' => 'Nunc@Vivamusnibh.net', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Vestibulum Consulting', + 'comment_date' => '2017-10-19 01:47:00', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Talon Ayala', + 'comment_author_email' => 'vitae.posuere@nuncnulla.ca', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Velit Eu Sem Company', + 'comment_date' => '2018-08-04 04:42:13', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Lacy Robles', + 'comment_author_email' => 'dignissim.Maecenas@aliquamerosturpis.ca', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'In LLC', + 'comment_date' => '2017-10-10 21:59:54', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Yoko Ford', + 'comment_author_email' => 'amet.lorem.semper@quamvel.org', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Malesuada Fames Ac Corporation', + 'comment_date' => '2017-11-12 15:29:22', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Zephr Morton', + 'comment_author_email' => 'arcu@enim.edu', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Feugiat Nec Diam Foundation', + 'comment_date' => '2017-06-02 23:49:46', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Joelle Buckley', + 'comment_author_email' => 'fringilla@duiquisaccumsan.com', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Luctus Ut Pellentesque Corp.', + 'comment_date' => '2018-07-13 23:07:37', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Ariel Christensen', + 'comment_author_email' => 'ligula@nisimagna.org', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Et Netus Associates', + 'comment_date' => '2017-07-04 01:59:04', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Rahim Joseph', + 'comment_author_email' => 'sit.amet.faucibus@Cras.org', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Non Dui PC', + 'comment_date' => '2017-08-11 21:58:25', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Jakeem Knight', + 'comment_author_email' => 'ridiculus.mus@vehiculaaliquet.net', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Eget LLP', + 'comment_date' => '2019-01-29 12:29:33', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Portia Silva', + 'comment_author_email' => 'Pellentesque@Morbinonsapien.com', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Nascetur Limited', + 'comment_date' => '2018-02-09 16:19:39', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Leonard Hess', + 'comment_author_email' => 'vel.mauris.Integer@atvelitPellentesque.org', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Non Vestibulum Limited', + 'comment_date' => '2017-08-25 18:13:04', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Hu Hopper', + 'comment_author_email' => 'orci.luctus@perinceptos.co.uk', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Ante Iaculis Nec Ltd', + 'comment_date' => '2017-11-23 00:07:38', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Leah Ross', + 'comment_author_email' => 'aliquet.vel@Namtempor.edu', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Amet Luctus Vulputate Corporation', + 'comment_date' => '2017-09-30 01:56:02', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Kyle Hughes', + 'comment_author_email' => 'sociosqu@lectus.co.uk', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Sagittis Nullam Vitae Industries', + 'comment_date' => '2017-08-19 04:19:09', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Amir Marsh', + 'comment_author_email' => 'orci.lobortis@fringillaDonecfeugiat.co.uk', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Risus LLP', + 'comment_date' => '2018-10-09 08:47:58', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Omar Byers', + 'comment_author_email' => 'penatibus@nuncac.edu', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Duis Volutpat Foundation', + 'comment_date' => '2017-07-26 17:39:15', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Derek Mullen', + 'comment_author_email' => 'morbi.tristique@dui.co.uk', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Eu Institute', + 'comment_date' => '2018-05-03 15:00:02', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Linda Shelton', + 'comment_author_email' => 'magna.a@gravidaPraesent.org', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Et Foundation', + 'comment_date' => '2018-11-06 00:22:58', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Shelby Warren', + 'comment_author_email' => 'Fusce.aliquet.magna@dapibusgravida.ca', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Lorem Ipsum Sodales Foundation', + 'comment_date' => '2018-03-20 19:55:27', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Eugenia Baird', + 'comment_author_email' => 'sapien.gravida@vel.edu', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Et Corporation', + 'comment_date' => '2018-04-11 21:34:38', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Hu Stephenson', + 'comment_author_email' => 'Morbi@est.edu', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Nibh Vulputate Mauris Foundation', + 'comment_date' => '2018-08-15 12:11:35', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Barrett Wise', + 'comment_author_email' => 'Sed@gravidanon.co.uk', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'In Ornare Sagittis Incorporated', + 'comment_date' => '2018-03-20 20:45:25', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Rebekah Kidd', + 'comment_author_email' => 'pede.Suspendisse.dui@Aliquamnecenim.co.uk', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Aenean Egestas Incorporated', + 'comment_date' => '2017-02-18 14:45:31', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Kirestin Stevenson', + 'comment_author_email' => 'Cras@ullamcorperDuisat.co.uk', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'In At Pede LLC', + 'comment_date' => '2018-08-19 05:41:39', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Darius Grimes', + 'comment_author_email' => 'montes.nascetur.ridiculus@acfeugiat.co.uk', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Massa Suspendisse Corporation', + 'comment_date' => '2017-02-06 11:58:11', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Price Butler', + 'comment_author_email' => 'sem.ut.cursus@sapienNunc.ca', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Non Enim Mauris Company', + 'comment_date' => '2017-02-16 01:40:43', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Ross Vang', + 'comment_author_email' => 'euismod@vitaesodales.org', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Nam Nulla Institute', + 'comment_date' => '2018-06-04 06:39:22', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Aidan Mooney', + 'comment_author_email' => 'lacinia.orci.consectetuer@maurissagittisplacerat.org', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Vivamus Euismod Consulting', + 'comment_date' => '2018-07-13 08:58:01', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Lunea Abbott', + 'comment_author_email' => 'adipiscing.lacus@erat.net', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Justo Company', + 'comment_date' => '2017-07-09 19:35:25', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Brent Jenkins', + 'comment_author_email' => 'at@sitamet.net', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Tellus Institute', + 'comment_date' => '2017-03-05 17:10:38', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Sheila Cain', + 'comment_author_email' => 'consectetuer.adipiscing.elit@Proinsed.org', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Cum Ltd', + 'comment_date' => '2017-06-03 20:45:41', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Myles Hoover', + 'comment_author_email' => 'enim.Etiam.gravida@gravidasagittisDuis.co.uk', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Non Consulting', + 'comment_date' => '2019-01-13 18:02:08', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Trevor Downs', + 'comment_author_email' => 'a.malesuada@in.net', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Leo Elementum Sem Associates', + 'comment_date' => '2018-06-11 06:27:12', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Harriet Atkinson', + 'comment_author_email' => 'pede.Cras@turpisegestasFusce.net', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Feugiat Company', + 'comment_date' => '2017-12-31 17:14:38', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Geraldine Kirk', + 'comment_author_email' => 'elit.elit.fermentum@Suspendisse.com', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Nisl Nulla Eu Corp.', + 'comment_date' => '2017-04-22 12:21:42', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Heidi Weeks', + 'comment_author_email' => 'elementum.lorem@orciin.co.uk', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Integer Eu Lacus Ltd', + 'comment_date' => '2017-02-24 04:58:52', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Dara Rowe', + 'comment_author_email' => 'velit.egestas@eget.net', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'At Libero Incorporated', + 'comment_date' => '2017-05-17 06:56:49', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Nevada Noble', + 'comment_author_email' => 'dui.nec@eratin.org', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Arcu Vestibulum Ltd', + 'comment_date' => '2018-12-12 04:12:04', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Chloe Mitchell', + 'comment_author_email' => 'interdum@metusurnaconvallis.edu', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Risus Quisque Libero Incorporated', + 'comment_date' => '2018-12-10 21:57:51', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Keegan Guthrie', + 'comment_author_email' => 'purus.mauris.a@nonleoVivamus.co.uk', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Vulputate Lacus LLP', + 'comment_date' => '2018-04-30 19:31:52', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Amaya Burgess', + 'comment_author_email' => 'consectetuer.adipiscing@lacinia.edu', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Mauris A Corporation', + 'comment_date' => '2019-01-25 19:29:14', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Cairo Kinney', + 'comment_author_email' => 'id.risus.quis@sempertellusid.co.uk', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Pharetra Nam Inc.', + 'comment_date' => '2019-01-16 10:53:30', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Maile Herrera', + 'comment_author_email' => 'Nullam.enim@vehiculaPellentesquetincidunt.co.uk', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Ac Tellus Foundation', + 'comment_date' => '2017-11-04 12:54:21', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Maite Perkins', + 'comment_author_email' => 'mi.lorem@aliquetmolestie.ca', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'A Magna Institute', + 'comment_date' => '2017-06-06 11:01:52', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Kevyn Butler', + 'comment_author_email' => 'auctor.velit.Aliquam@Vivamus.ca', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Ut Aliquam Ltd', + 'comment_date' => '2018-10-13 20:52:56', + 'comment_approved' => '1', + ), + array( + 'comment_author' => 'Honorato Talley', + 'comment_author_email' => 'scelerisque@Quisqueornare.ca', + 'comment_author_url' => 'https://example.com', + 'comment_content' => '', + 'comment_type' => 'comment', + 'comment_parent' => '0', + 'comment_author_IP' => '127.0.0.1', + 'comment_agent' => 'Amet Diam LLC', + 'comment_date' => '2018-08-18 06:18:37', + 'comment_approved' => '1', + ), + ); +} + + +// Bootstrap. +if ( defined( 'WP_CLI' ) ) { + try { + $post_id = amp_create_comments_test_post(); + WP_CLI::success( sprintf( 'Please take a look at: %s', amp_get_permalink( $post_id ) . '#development=1' ) ); + } catch ( Exception $e ) { + WP_CLI::error( $e->getMessage() ); + } +} else { + echo "Must be run in WP-CLI via: wp eval-file bin/create-comments-on-test-post.php\n"; + exit( 1 ); +} From 2a643cad47638491258d4ec52f33e694b0e42e78 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Thu, 1 Feb 2018 13:11:55 +0200 Subject: [PATCH 2/7] clean docs --- bin/create-comments-on-test-post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/create-comments-on-test-post.php b/bin/create-comments-on-test-post.php index ac92f858c78..0ab910a84da 100644 --- a/bin/create-comments-on-test-post.php +++ b/bin/create-comments-on-test-post.php @@ -9,7 +9,7 @@ /** * Create comments test post. * - * @throws Exception But when database doesn't have enough attachments or in case of error. + * @throws Exception But when post can't be created or content can't be pulled or updated. * @return int Post ID. */ function amp_create_comments_test_post() { From 29e540c9db4dbb86dfc5c96067188c879d28d378 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Thu, 1 Feb 2018 13:17:44 +0200 Subject: [PATCH 3/7] real comment_agent --- bin/create-comments-on-test-post.php | 126 +++++++++++++-------------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/bin/create-comments-on-test-post.php b/bin/create-comments-on-test-post.php index 0ab910a84da..101989889f4 100644 --- a/bin/create-comments-on-test-post.php +++ b/bin/create-comments-on-test-post.php @@ -94,7 +94,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Orci Phasellus Dapibus Associates', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-03-08 05:49:46', 'comment_approved' => '1', ), @@ -106,7 +106,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Cursus Corporation', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-06-20 03:39:16', 'comment_approved' => '1', ), @@ -118,7 +118,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Vestibulum PC', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-08-31 06:48:05', 'comment_approved' => '1', ), @@ -130,7 +130,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Facilisis Incorporated', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2019-01-19 10:21:50', 'comment_approved' => '1', ), @@ -142,7 +142,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mi Limited', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-03-12 07:41:02', 'comment_approved' => '1', ), @@ -154,7 +154,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Cursus Nunc PC', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-11-29 14:25:31', 'comment_approved' => '1', ), @@ -166,7 +166,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Cursus Non Corporation', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-11-26 19:04:14', 'comment_approved' => '1', ), @@ -178,7 +178,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Elit Company', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-03-22 05:55:50', 'comment_approved' => '1', ), @@ -190,7 +190,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mauris Molestie Pharetra Ltd', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-11-23 23:21:56', 'comment_approved' => '1', ), @@ -202,7 +202,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Nec Urna Incorporated', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-04-21 01:01:52', 'comment_approved' => '1', ), @@ -214,7 +214,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Iaculis Quis Pede Limited', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2019-01-14 04:59:03', 'comment_approved' => '1', ), @@ -226,7 +226,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Nisi Magna Sed Institute', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-03-19 15:38:28', 'comment_approved' => '1', ), @@ -238,7 +238,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Donec LLP', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-08-18 03:55:45', 'comment_approved' => '1', ), @@ -250,7 +250,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mauris Rhoncus Id Industries', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-07-26 22:28:58', 'comment_approved' => '1', ), @@ -262,7 +262,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Eget Dictum Placerat Corporation', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-02-06 02:28:57', 'comment_approved' => '1', ), @@ -274,7 +274,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Diam Lorem Auctor Institute', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-07-28 22:02:50', 'comment_approved' => '1', ), @@ -286,7 +286,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Quam Curabitur Associates', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-12-25 17:57:58', 'comment_approved' => '1', ), @@ -298,7 +298,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Vestibulum Consulting', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-10-19 01:47:00', 'comment_approved' => '1', ), @@ -310,7 +310,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Velit Eu Sem Company', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-08-04 04:42:13', 'comment_approved' => '1', ), @@ -322,7 +322,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'In LLC', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-10-10 21:59:54', 'comment_approved' => '1', ), @@ -334,7 +334,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Malesuada Fames Ac Corporation', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-11-12 15:29:22', 'comment_approved' => '1', ), @@ -346,7 +346,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Feugiat Nec Diam Foundation', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-06-02 23:49:46', 'comment_approved' => '1', ), @@ -358,7 +358,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Luctus Ut Pellentesque Corp.', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-07-13 23:07:37', 'comment_approved' => '1', ), @@ -370,7 +370,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Et Netus Associates', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-07-04 01:59:04', 'comment_approved' => '1', ), @@ -382,7 +382,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Non Dui PC', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-08-11 21:58:25', 'comment_approved' => '1', ), @@ -394,7 +394,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Eget LLP', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2019-01-29 12:29:33', 'comment_approved' => '1', ), @@ -406,7 +406,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Nascetur Limited', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-02-09 16:19:39', 'comment_approved' => '1', ), @@ -418,7 +418,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Non Vestibulum Limited', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-08-25 18:13:04', 'comment_approved' => '1', ), @@ -430,7 +430,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Ante Iaculis Nec Ltd', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-11-23 00:07:38', 'comment_approved' => '1', ), @@ -442,7 +442,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Amet Luctus Vulputate Corporation', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-09-30 01:56:02', 'comment_approved' => '1', ), @@ -454,7 +454,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Sagittis Nullam Vitae Industries', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-08-19 04:19:09', 'comment_approved' => '1', ), @@ -466,7 +466,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Risus LLP', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-10-09 08:47:58', 'comment_approved' => '1', ), @@ -478,7 +478,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Duis Volutpat Foundation', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-07-26 17:39:15', 'comment_approved' => '1', ), @@ -490,7 +490,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Eu Institute', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-05-03 15:00:02', 'comment_approved' => '1', ), @@ -502,7 +502,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Et Foundation', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-11-06 00:22:58', 'comment_approved' => '1', ), @@ -514,7 +514,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Lorem Ipsum Sodales Foundation', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-03-20 19:55:27', 'comment_approved' => '1', ), @@ -526,7 +526,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Et Corporation', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-04-11 21:34:38', 'comment_approved' => '1', ), @@ -538,7 +538,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Nibh Vulputate Mauris Foundation', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-08-15 12:11:35', 'comment_approved' => '1', ), @@ -550,7 +550,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'In Ornare Sagittis Incorporated', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-03-20 20:45:25', 'comment_approved' => '1', ), @@ -562,7 +562,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Aenean Egestas Incorporated', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-02-18 14:45:31', 'comment_approved' => '1', ), @@ -574,7 +574,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'In At Pede LLC', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-08-19 05:41:39', 'comment_approved' => '1', ), @@ -586,7 +586,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Massa Suspendisse Corporation', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-02-06 11:58:11', 'comment_approved' => '1', ), @@ -598,7 +598,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Non Enim Mauris Company', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-02-16 01:40:43', 'comment_approved' => '1', ), @@ -610,7 +610,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Nam Nulla Institute', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-06-04 06:39:22', 'comment_approved' => '1', ), @@ -622,7 +622,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Vivamus Euismod Consulting', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-07-13 08:58:01', 'comment_approved' => '1', ), @@ -634,7 +634,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Justo Company', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-07-09 19:35:25', 'comment_approved' => '1', ), @@ -646,7 +646,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Tellus Institute', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-03-05 17:10:38', 'comment_approved' => '1', ), @@ -658,7 +658,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Cum Ltd', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-06-03 20:45:41', 'comment_approved' => '1', ), @@ -670,7 +670,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Non Consulting', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2019-01-13 18:02:08', 'comment_approved' => '1', ), @@ -682,7 +682,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Leo Elementum Sem Associates', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-06-11 06:27:12', 'comment_approved' => '1', ), @@ -694,7 +694,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Feugiat Company', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-12-31 17:14:38', 'comment_approved' => '1', ), @@ -706,7 +706,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Nisl Nulla Eu Corp.', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-04-22 12:21:42', 'comment_approved' => '1', ), @@ -718,7 +718,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Integer Eu Lacus Ltd', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-02-24 04:58:52', 'comment_approved' => '1', ), @@ -730,7 +730,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'At Libero Incorporated', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-05-17 06:56:49', 'comment_approved' => '1', ), @@ -742,7 +742,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Arcu Vestibulum Ltd', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-12-12 04:12:04', 'comment_approved' => '1', ), @@ -754,7 +754,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Risus Quisque Libero Incorporated', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-12-10 21:57:51', 'comment_approved' => '1', ), @@ -766,7 +766,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Vulputate Lacus LLP', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-04-30 19:31:52', 'comment_approved' => '1', ), @@ -778,7 +778,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mauris A Corporation', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2019-01-25 19:29:14', 'comment_approved' => '1', ), @@ -790,7 +790,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Pharetra Nam Inc.', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2019-01-16 10:53:30', 'comment_approved' => '1', ), @@ -802,7 +802,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Ac Tellus Foundation', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-11-04 12:54:21', 'comment_approved' => '1', ), @@ -814,7 +814,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'A Magna Institute', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2017-06-06 11:01:52', 'comment_approved' => '1', ), @@ -826,7 +826,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Ut Aliquam Ltd', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-10-13 20:52:56', 'comment_approved' => '1', ), @@ -838,7 +838,7 @@ function amp_get_test_comment_entries() { 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Amet Diam LLC', + 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'comment_date' => '2018-08-18 06:18:37', 'comment_approved' => '1', ), From e36e64beb66309c751354b140ccd873294221927 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Thu, 1 Feb 2018 13:20:05 +0200 Subject: [PATCH 4/7] fix for php5.x --- bin/create-comments-on-test-post.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/create-comments-on-test-post.php b/bin/create-comments-on-test-post.php index 101989889f4..1b2247eb82d 100644 --- a/bin/create-comments-on-test-post.php +++ b/bin/create-comments-on-test-post.php @@ -58,8 +58,9 @@ function amp_add_comments( $post_id ) { $data = amp_get_test_comment_entries(); $ids = array(); // get some paragraphs. - $content = array_filter( file( 'https://loripsum.net/api/' . count( $data ) . '/short' ), function ( $s ) { - return ! empty( trim( $s ) ); + $content = array_filter( file( 'https://loripsum.net/api/' . count( $data ) . '/short' ), function ( $string ) { + $string = trim( $string ); + return ! empty( $string ); } ); sort( $content ); $content = array_filter( $content ); From 9b70f55aedddc6b27523406aef929f2424bb7dd1 Mon Sep 17 00:00:00 2001 From: ThierryA Date: Thu, 1 Feb 2018 14:03:52 +0100 Subject: [PATCH 5/7] Issue 861: remove lorem API call and reduce complexity --- bin/create-comments-on-test-post.php | 832 ++------------------------- 1 file changed, 51 insertions(+), 781 deletions(-) diff --git a/bin/create-comments-on-test-post.php b/bin/create-comments-on-test-post.php index 1b2247eb82d..6ddac20fa4d 100644 --- a/bin/create-comments-on-test-post.php +++ b/bin/create-comments-on-test-post.php @@ -19,10 +19,11 @@ function amp_create_comments_test_post() { $post_id = $post->ID; } else { $post_id = wp_insert_post( array( - 'post_name' => 'amp-test-comments', - 'post_title' => 'AMP Test Comments', - 'post_type' => 'post', - 'post_status' => 'publish', + 'post_name' => 'amp-test-comments', + 'post_title' => 'AMP Test Comments', + 'post_type' => 'post', + 'post_status' => 'publish', + 'post_content' => amp_get_test_random_content( 200 ), ) ); if ( ! $post_id || is_wp_error( $post_id ) ) { @@ -30,22 +31,12 @@ function amp_create_comments_test_post() { } } - $content = wp_remote_get( 'https://loripsum.net/api/10/short/headers' ); - if ( is_wp_error( $content ) ) { - throw new Exception( 'Could not get test content, please try again.' ); + // Add comments. + if ( 0 <= get_comments_number( $post_id ) ) { + amp_add_comments( $post_id ); } - $update = wp_update_post( wp_slash( array( - 'ID' => $post_id, - 'post_content' => wp_remote_retrieve_body( $content ), - ) ) ); - if ( ! $update ) { - throw new Exception( 'The test post could not be updated, please try again.' ); - } else { - amp_add_comments( $update ); - } - - return $update; + return $post_id; } /** @@ -57,22 +48,14 @@ function amp_create_comments_test_post() { function amp_add_comments( $post_id ) { $data = amp_get_test_comment_entries(); $ids = array(); - // get some paragraphs. - $content = array_filter( file( 'https://loripsum.net/api/' . count( $data ) . '/short' ), function ( $string ) { - $string = trim( $string ); - return ! empty( $string ); - } ); - sort( $content ); - $content = array_filter( $content ); - foreach ( $data as $inx => $comment ) { + foreach ( $data as $comment ) { $comment['comment_post_ID'] = $post_id; $yes_no = rand( 0, 1 ); // 50% chance of this comment being a reply :) if ( 1 === $yes_no && ! empty( $ids ) ) { $comment['comment_parent'] = $ids[ rand( 0, count( $ids ) - 1 ) ]; } - $comment['comment_content'] = $content[ $inx ]; - $comment_id = wp_insert_comment( $comment ); + $comment_id = wp_insert_comment( $comment ); if ( ! $comment_id || is_wp_error( $comment_id ) ) { throw new Exception( 'The test comment could not be added, please try again.' ); } @@ -86,766 +69,53 @@ function amp_add_comments( $post_id ) { * @return array Data entries. */ function amp_get_test_comment_entries() { - return array( - array( - 'comment_author' => 'Hasad Levy', - 'comment_author_email' => 'nibh@Quisque.edu', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-03-08 05:49:46', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Aurelia Simmons', - 'comment_author_email' => 'natoque.penatibus.et@Inscelerisquescelerisque.org', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-06-20 03:39:16', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Eaton Huffman', - 'comment_author_email' => 'lectus.convallis@arcuimperdietullamcorper.net', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-08-31 06:48:05', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Vladimir Tucker', - 'comment_author_email' => 'ultrices.mauris@risusaultricies.edu', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2019-01-19 10:21:50', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Acton Burch', - 'comment_author_email' => 'nec.malesuada.ut@MorbivehiculaPellentesque.co.uk', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-03-12 07:41:02', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Paloma Sparks', - 'comment_author_email' => 'sodales.purus@euaccumsan.net', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-11-29 14:25:31', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Shea Santana', - 'comment_author_email' => 'augue.Sed@Nullamvitaediam.org', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-11-26 19:04:14', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Justina Clements', - 'comment_author_email' => 'eget@eu.org', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-03-22 05:55:50', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Erich Warren', - 'comment_author_email' => 'magna.et.ipsum@condimentumDonecat.co.uk', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-11-23 23:21:56', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Juliet Gibbs', - 'comment_author_email' => 'magnis@mitempor.com', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-04-21 01:01:52', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Nicholas Ellison', - 'comment_author_email' => 'ut.nisi.a@auctorullamcorpernisl.org', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2019-01-14 04:59:03', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Jerome Cotton', - 'comment_author_email' => 'a.auctor.non@ornare.co.uk', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-03-19 15:38:28', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Brynn Day', - 'comment_author_email' => 'nulla@Crasvehiculaaliquet.edu', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-08-18 03:55:45', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Grace Irwin', - 'comment_author_email' => 'tincidunt.tempus.risus@convallis.edu', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-07-26 22:28:58', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Jenna Wilkinson', - 'comment_author_email' => 'auctor.velit@dictumeu.com', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-02-06 02:28:57', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Keelie Medina', - 'comment_author_email' => 'elementum.lorem@fames.org', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-07-28 22:02:50', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Gavin Ortega', - 'comment_author_email' => 'feugiat.Sed.nec@commodoauctorvelit.ca', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-12-25 17:57:58', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Price Conrad', - 'comment_author_email' => 'Nunc@Vivamusnibh.net', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-10-19 01:47:00', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Talon Ayala', - 'comment_author_email' => 'vitae.posuere@nuncnulla.ca', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-08-04 04:42:13', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Lacy Robles', - 'comment_author_email' => 'dignissim.Maecenas@aliquamerosturpis.ca', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-10-10 21:59:54', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Yoko Ford', - 'comment_author_email' => 'amet.lorem.semper@quamvel.org', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-11-12 15:29:22', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Zephr Morton', - 'comment_author_email' => 'arcu@enim.edu', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-06-02 23:49:46', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Joelle Buckley', - 'comment_author_email' => 'fringilla@duiquisaccumsan.com', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-07-13 23:07:37', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Ariel Christensen', - 'comment_author_email' => 'ligula@nisimagna.org', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-07-04 01:59:04', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Rahim Joseph', - 'comment_author_email' => 'sit.amet.faucibus@Cras.org', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-08-11 21:58:25', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Jakeem Knight', - 'comment_author_email' => 'ridiculus.mus@vehiculaaliquet.net', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2019-01-29 12:29:33', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Portia Silva', - 'comment_author_email' => 'Pellentesque@Morbinonsapien.com', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-02-09 16:19:39', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Leonard Hess', - 'comment_author_email' => 'vel.mauris.Integer@atvelitPellentesque.org', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-08-25 18:13:04', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Hu Hopper', - 'comment_author_email' => 'orci.luctus@perinceptos.co.uk', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-11-23 00:07:38', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Leah Ross', - 'comment_author_email' => 'aliquet.vel@Namtempor.edu', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-09-30 01:56:02', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Kyle Hughes', - 'comment_author_email' => 'sociosqu@lectus.co.uk', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-08-19 04:19:09', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Amir Marsh', - 'comment_author_email' => 'orci.lobortis@fringillaDonecfeugiat.co.uk', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-10-09 08:47:58', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Omar Byers', - 'comment_author_email' => 'penatibus@nuncac.edu', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-07-26 17:39:15', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Derek Mullen', - 'comment_author_email' => 'morbi.tristique@dui.co.uk', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-05-03 15:00:02', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Linda Shelton', - 'comment_author_email' => 'magna.a@gravidaPraesent.org', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-11-06 00:22:58', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Shelby Warren', - 'comment_author_email' => 'Fusce.aliquet.magna@dapibusgravida.ca', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-03-20 19:55:27', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Eugenia Baird', - 'comment_author_email' => 'sapien.gravida@vel.edu', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-04-11 21:34:38', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Hu Stephenson', - 'comment_author_email' => 'Morbi@est.edu', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-08-15 12:11:35', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Barrett Wise', - 'comment_author_email' => 'Sed@gravidanon.co.uk', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-03-20 20:45:25', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Rebekah Kidd', - 'comment_author_email' => 'pede.Suspendisse.dui@Aliquamnecenim.co.uk', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-02-18 14:45:31', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Kirestin Stevenson', - 'comment_author_email' => 'Cras@ullamcorperDuisat.co.uk', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-08-19 05:41:39', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Darius Grimes', - 'comment_author_email' => 'montes.nascetur.ridiculus@acfeugiat.co.uk', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-02-06 11:58:11', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Price Butler', - 'comment_author_email' => 'sem.ut.cursus@sapienNunc.ca', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-02-16 01:40:43', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Ross Vang', - 'comment_author_email' => 'euismod@vitaesodales.org', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-06-04 06:39:22', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Aidan Mooney', - 'comment_author_email' => 'lacinia.orci.consectetuer@maurissagittisplacerat.org', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-07-13 08:58:01', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Lunea Abbott', - 'comment_author_email' => 'adipiscing.lacus@erat.net', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-07-09 19:35:25', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Brent Jenkins', - 'comment_author_email' => 'at@sitamet.net', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-03-05 17:10:38', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Sheila Cain', - 'comment_author_email' => 'consectetuer.adipiscing.elit@Proinsed.org', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-06-03 20:45:41', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Myles Hoover', - 'comment_author_email' => 'enim.Etiam.gravida@gravidasagittisDuis.co.uk', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2019-01-13 18:02:08', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Trevor Downs', - 'comment_author_email' => 'a.malesuada@in.net', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-06-11 06:27:12', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Harriet Atkinson', - 'comment_author_email' => 'pede.Cras@turpisegestasFusce.net', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-12-31 17:14:38', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Geraldine Kirk', - 'comment_author_email' => 'elit.elit.fermentum@Suspendisse.com', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-04-22 12:21:42', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Heidi Weeks', - 'comment_author_email' => 'elementum.lorem@orciin.co.uk', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-02-24 04:58:52', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Dara Rowe', - 'comment_author_email' => 'velit.egestas@eget.net', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-05-17 06:56:49', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Nevada Noble', - 'comment_author_email' => 'dui.nec@eratin.org', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-12-12 04:12:04', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Chloe Mitchell', - 'comment_author_email' => 'interdum@metusurnaconvallis.edu', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-12-10 21:57:51', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Keegan Guthrie', - 'comment_author_email' => 'purus.mauris.a@nonleoVivamus.co.uk', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-04-30 19:31:52', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Amaya Burgess', - 'comment_author_email' => 'consectetuer.adipiscing@lacinia.edu', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2019-01-25 19:29:14', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Cairo Kinney', - 'comment_author_email' => 'id.risus.quis@sempertellusid.co.uk', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2019-01-16 10:53:30', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Maile Herrera', - 'comment_author_email' => 'Nullam.enim@vehiculaPellentesquetincidunt.co.uk', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-11-04 12:54:21', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Maite Perkins', - 'comment_author_email' => 'mi.lorem@aliquetmolestie.ca', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2017-06-06 11:01:52', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Kevyn Butler', - 'comment_author_email' => 'auctor.velit.Aliquam@Vivamus.ca', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', - 'comment_type' => 'comment', - 'comment_parent' => '0', - 'comment_author_IP' => '127.0.0.1', - 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-10-13 20:52:56', - 'comment_approved' => '1', - ), - array( - 'comment_author' => 'Honorato Talley', - 'comment_author_email' => 'scelerisque@Quisqueornare.ca', - 'comment_author_url' => 'https://example.com', - 'comment_content' => '', + $comments = array(); + $time = strtotime( 'now' ); + for ( $i = 0; $i < 30; $i++ ) { + $author = preg_replace( '/[^\w ]+/', '', amp_get_test_random_content( 2, '' ) ); + $time = strtotime( '+3 minutes', $time ); + + // Add comment. + $comments[] = array( + 'comment_author' => ucwords( $author ), + 'comment_author_email' => strtolower( implode( '@', explode( ' ', $author ) ) ) . '.com', + 'comment_author_url' => strtolower( implode( '.', explode( ' ', $author ) ) ) . '.com', + 'comment_content' => amp_get_test_random_content( rand( 10, 40 ) ), 'comment_type' => 'comment', 'comment_parent' => '0', 'comment_author_IP' => '127.0.0.1', 'comment_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', - 'comment_date' => '2018-08-18 06:18:37', + 'comment_date' => date( 'Y-m-d H:i:s', $time ), 'comment_approved' => '1', - ), - ); + ); + } + + return $comments; } +/** + * Get random text. + * + * @param int $num_words Number of words. Default 55. + * @param string $more Optional. What to append if $text needs to be trimmed. Default '.'. + * + * @return string Random text. + */ +function amp_get_test_random_content( $num_words = 55, $more = '.' ) { + $text = explode( + ' ', + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit Nullam in pharetra nisl Mauris dictum fermentum malesuada Donec tincidunt, lectus nec tempor eleifend, sem enim rhoncus nibh, nec ultricies ante lectus sit amet mi Proin cursus dolor in nisl varius elementum Aliquam blandit lobortis adipiscing Proin euismod est non feugiat. + + Venenatis Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam ac neque consectetur, ullamcorper neque quis, commodo ligula In ornare tempus feugiat Suspendisse ut pretium dui, at egestas velit Etiam ultricies, nisl quis gravida condimentum, dui nisl congue ligula, porta consectetur est sapien viverra est Donec quis ipsum quis metus luctus porttitor sed id justo Proin ultricies adipiscing dolor, luctus interdum urna ullamcorper sit amet Phasellus. + + Mollis erat egestas urna tincidunt viverra Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas Nam est ante, blandit vitae porta sed, consectetur vitae libero Sed sit amet auctor diam, eu ullamcorper nulla Aenean interdum, augue nec ullamcorper aliquam, libero justo pellentesque libero, vitae venenatis velit justo pellentesque enim Nam lobortis tortor non sagittis mollis Integer commodo eget nulla vel tincidunt Cras vitae vestibulum ipsum. + + A sollicitudin erat Cras feugiat vehicula magna, nec vehicula massa lacinia in Nam cursus arcu cursus felis feugiat, vel tincidunt eros aliquet Sed magna est, tincidunt a porta id, aliquam eu orci Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus Donec nec tempus eros Mauris placerat, nisi sit amet varius venenatis, arcu felis cursus risus, ut ultricies tortor lorem nec massa Integer molestie mattis tortor, nec pretium augue accumsan at Mauris nisi risus, hendrerit in libero a, accumsan tincidunt nunc Ut id volutpat massa Duis mattis tellus ut massa ultricies volutpat Curabitur non ante vel odio tempor condimentum Duis eu sollicitudin risus Pellentesque eget metus.' + ); + shuffle( $text ); + + return wp_trim_words( ucfirst( implode( ' ', $text ) ), $num_words, $more ); +} // Bootstrap. if ( defined( 'WP_CLI' ) ) { From 1f6a0e3158c8c980832bc234d8b9b8d1c62b7ae4 Mon Sep 17 00:00:00 2001 From: ThierryA Date: Thu, 1 Feb 2018 14:06:47 +0100 Subject: [PATCH 6/7] Issue 861: added comments script instructions to the contributors guide --- contributing.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contributing.md b/contributing.md index 5d821a7c072..9b7c8c29830 100644 --- a/contributing.md +++ b/contributing.md @@ -33,6 +33,15 @@ To run it: 3. run `wp eval-file bin/add-test-widgets-to-sidebar.php` 4. There will be a message indicating which sidebar has the widgets. Please visit a page with that sidebar. +## Testing Comments Support + +The following script creates a post with comments in order to test support for WordPress comments. +To run it: +1. `ssh` into an environment like [VVV](https://github.com/Varying-Vagrant-Vagrants/VVV) +2. `cd` to the root of this plugin +3. run `wp eval-file bin/create-comments-on-test-post.php` +4. go to the URL that is output in the command line + ## PHPUnit Testing Please run these tests in an environment with WordPress unit tests installed, like [VVV](https://github.com/Varying-Vagrant-Vagrants/VVV). From 9427d93fcb11d297897fe3a7e761bcbcc1bb1a43 Mon Sep 17 00:00:00 2001 From: ThierryA Date: Thu, 1 Feb 2018 14:13:35 +0100 Subject: [PATCH 7/7] Issue 861: reduce random content length --- bin/create-comments-on-test-post.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/bin/create-comments-on-test-post.php b/bin/create-comments-on-test-post.php index 6ddac20fa4d..6c091ed3477 100644 --- a/bin/create-comments-on-test-post.php +++ b/bin/create-comments-on-test-post.php @@ -102,16 +102,7 @@ function amp_get_test_comment_entries() { * @return string Random text. */ function amp_get_test_random_content( $num_words = 55, $more = '.' ) { - $text = explode( - ' ', - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit Nullam in pharetra nisl Mauris dictum fermentum malesuada Donec tincidunt, lectus nec tempor eleifend, sem enim rhoncus nibh, nec ultricies ante lectus sit amet mi Proin cursus dolor in nisl varius elementum Aliquam blandit lobortis adipiscing Proin euismod est non feugiat. - - Venenatis Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam ac neque consectetur, ullamcorper neque quis, commodo ligula In ornare tempus feugiat Suspendisse ut pretium dui, at egestas velit Etiam ultricies, nisl quis gravida condimentum, dui nisl congue ligula, porta consectetur est sapien viverra est Donec quis ipsum quis metus luctus porttitor sed id justo Proin ultricies adipiscing dolor, luctus interdum urna ullamcorper sit amet Phasellus. - - Mollis erat egestas urna tincidunt viverra Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas Nam est ante, blandit vitae porta sed, consectetur vitae libero Sed sit amet auctor diam, eu ullamcorper nulla Aenean interdum, augue nec ullamcorper aliquam, libero justo pellentesque libero, vitae venenatis velit justo pellentesque enim Nam lobortis tortor non sagittis mollis Integer commodo eget nulla vel tincidunt Cras vitae vestibulum ipsum. - - A sollicitudin erat Cras feugiat vehicula magna, nec vehicula massa lacinia in Nam cursus arcu cursus felis feugiat, vel tincidunt eros aliquet Sed magna est, tincidunt a porta id, aliquam eu orci Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus Donec nec tempus eros Mauris placerat, nisi sit amet varius venenatis, arcu felis cursus risus, ut ultricies tortor lorem nec massa Integer molestie mattis tortor, nec pretium augue accumsan at Mauris nisi risus, hendrerit in libero a, accumsan tincidunt nunc Ut id volutpat massa Duis mattis tellus ut massa ultricies volutpat Curabitur non ante vel odio tempor condimentum Duis eu sollicitudin risus Pellentesque eget metus.' - ); + $text = explode( ' ', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit Nullam in pharetra nisl Mauris dictum fermentum malesuada Donec tincidunt, lectus nec tempor eleifend, sem enim rhoncus nibh, nec ultricies ante lectus sit amet mi Proin cursus dolor in nisl varius elementum Aliquam blandit lobortis adipiscing Proin euismod est non feugiat. Venenatis Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam ac neque consectetur, ullamcorper neque quis, commodo ligula In ornare tempus feugiat Suspendisse ut pretium dui, at egestas velit Etiam ultricies, nisl quis gravida condimentum, dui nisl congue ligula, porta consectetur est sapien viverra est Donec quis ipsum quis metus luctus porttitor sed id justo Proin ultricies adipiscing dolor, luctus interdum urna ullamcorper sit amet Phasellus. Mollis erat egestas urna tincidunt viverra Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas Nam est ante, blandit vitae porta sed, consectetur vitae libero Sed sit amet auctor diam, eu ullamcorper nulla Aenean interdum, augue nec ullamcorper aliquam, libero justo pellentesque libero, vitae venenatis velit justo pellentesque enim Nam lobortis tortor non sagittis mollis Integer commodo eget nulla vel tincidunt Cras vitae vestibulum ipsum. A sollicitudin erat Cras feugiat vehicula magna, nec vehicula massa lacinia in Nam cursus arcu cursus felis feugiat, vel tincidunt eros aliquet Sed magna est.' ); shuffle( $text ); return wp_trim_words( ucfirst( implode( ' ', $text ) ), $num_words, $more );