Changeset 3048091
- Timestamp:
- 03/09/2024 12:21:28 AM (2 years ago)
- Location:
- writio
- Files:
-
- 13 added
- 5 edited
-
tags/1.3.2 (added)
-
tags/1.3.2/README.md (added)
-
tags/1.3.2/README.txt (added)
-
tags/1.3.2/admin (added)
-
tags/1.3.2/admin/writio-activate.php (added)
-
tags/1.3.2/admin/writio-admin.php (added)
-
tags/1.3.2/admin/writio-deactivate.php (added)
-
tags/1.3.2/admin/writio-uninstall.php (added)
-
tags/1.3.2/includes (added)
-
tags/1.3.2/includes/data-crons.php (added)
-
tags/1.3.2/includes/data-listeners.php (added)
-
tags/1.3.2/includes/rest-hooks.php (added)
-
tags/1.3.2/writio.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/admin/writio-admin.php (modified) (1 diff)
-
trunk/includes/data-crons.php (modified) (4 diffs)
-
trunk/includes/rest-hooks.php (modified) (1 diff)
-
trunk/writio.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
writio/trunk/README.txt
r3045958 r3048091 7 7 Tested up to: 6.2 8 8 Requires PHP: 7.0 9 Stable tag: 1.3. 19 Stable tag: 1.3.2 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 38 38 = 1.3.1 = 39 39 * Minor bug fixes 40 41 = 1.3.2 = 42 * Minor bug fixes -
writio/trunk/admin/writio-admin.php
r2988652 r3048091 92 92 <?php 93 93 if ( isset( $_GET['retry_publishing'] ) ) { 94 pull_unpublished_articles ();94 pull_unpublished_articles_admin(); 95 95 ?> 96 96 <div id="message" class="updated notice is-dismissible"> -
writio/trunk/includes/data-crons.php
r2988652 r3048091 4 4 5 5 function pull_unpublished_articles() { 6 pull_unpublished(false); 7 8 } 9 10 function pull_unpublished_articles_admin() { 11 pull_unpublished(true); 12 } 13 14 function pull_unpublished( $isPublisherRequest ) { 6 15 $writio_account_email = get_option( 'writio_account_email' ); 7 16 … … 9 18 // encode payload 10 19 $payload = json_encode(array( 11 'siteUrl' => site_url(), 12 'email' => $writio_account_email, 20 'siteUrl' => site_url(), 21 'email' => $writio_account_email, 22 'isPublisherRequest' => $isPublisherRequest, 13 23 ) ); 14 24 … … 25 35 if ( ! is_null( $parsed->success ) && $parsed->success ) { 26 36 foreach ($parsed->data as $article) { 37 $log_id = $article->logId; 38 $article_id = $article->articleId; 39 $post_title = $article->title; 40 $post_content = $article->content; 41 $post_status = $article->status; 42 $images = $article->images; 43 $featured_image = $article->featured_image; 44 $author_id = $article->authorId; 45 $category_id = $article->categoryId; 27 46 // double check to make sure the post doesn't already exist before creating 28 47 if ( ! post_exists_by_title( $article->title ) ) { 29 $log_id = $article->logId;30 $article_id = $article->articleId;31 $post_title = $article->title;32 $post_content = $article->content;33 $post_status = $article->status;34 $images = $article->images;35 $featured_image = $article->featured_image;36 $author_id = $article->authorId;37 $category_id = $article->categoryId;38 48 writio_post_processing( $log_id, $article_id, $post_title, $post_content, $post_status, $images, $featured_image, $author_id, $category_id ); 49 } else { 50 $response = array( 51 'message' => 'Post already published with this title for articleId: ' . $article_id, 52 'success' => false 53 ); 54 writio_post_status_callback( $log_id, $article_id, "", false, "Post already published with this title for articleId: " . $article_id, $response ); 39 55 } 40 56 } … … 57 73 'post_status' => 'any', 58 74 'title' => $title, 75 'exact' => true, 59 76 ); 60 77 -
writio/trunk/includes/rest-hooks.php
r3045958 r3048091 39 39 $author_id = $request->get_param( 'authorId' ); 40 40 $category_id = $request->get_param( 'categoryId' ); 41 42 $args = array(43 'post_type' => 'post',44 'posts_per_page' => 1,45 'post_status' => 'any',46 'title' => $post_title,47 );48 49 $query = new WP_Query( $args );50 if ( $query->have_posts() ) {51 $response = array(52 'message' => 'Post already published with this title!',53 'success' => false54 );55 return writio_post_status_callback( $log_id, $article_id, "", false, "Post already published with this title!", $response );56 }57 41 58 42 return writio_post_processing( $log_id, $article_id, $post_title, $post_content, $post_status, $images, $featured_image, $author_id, $category_id ); -
writio/trunk/writio.php
r3045958 r3048091 17 17 * Plugin URI: https://writio.com/ 18 18 * Description: Writio is a GPT-based writer that creates and manages content. This plugin integrates with your Writio account and allows Writio to publish content to your WordPress site. 19 * Version: 1.3. 119 * Version: 1.3.2 20 20 * License: GPL-2.0+ 21 21 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt … … 30 30 31 31 define( 'WRITIO__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 32 define( 'WRITIO_VERSION', '1.3. 1' );32 define( 'WRITIO_VERSION', '1.3.2' ); 33 33 34 34 require_once WRITIO__PLUGIN_DIR . 'includes/rest-hooks.php';
Note: See TracChangeset
for help on using the changeset viewer.