Plugin Directory

Changeset 3048091


Ignore:
Timestamp:
03/09/2024 12:21:28 AM (2 years ago)
Author:
ezoic
Message:

Writio plugin version 1.3.2

Location:
writio
Files:
13 added
5 edited

Legend:

Unmodified
Added
Removed
  • writio/trunk/README.txt

    r3045958 r3048091  
    77Tested up to: 6.2
    88Requires PHP: 7.0
    9 Stable tag: 1.3.1
     9Stable tag: 1.3.2
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3838= 1.3.1 =
    3939* Minor bug fixes
     40
     41= 1.3.2 =
     42* Minor bug fixes
  • writio/trunk/admin/writio-admin.php

    r2988652 r3048091  
    9292    <?php
    9393    if ( isset( $_GET['retry_publishing'] ) ) {
    94       pull_unpublished_articles();
     94      pull_unpublished_articles_admin();
    9595      ?>
    9696      <div id="message" class="updated notice is-dismissible">
  • writio/trunk/includes/data-crons.php

    r2988652 r3048091  
    44
    55function pull_unpublished_articles() {
     6  pull_unpublished(false);
     7
     8}
     9
     10function pull_unpublished_articles_admin() {
     11  pull_unpublished(true);
     12}
     13
     14function pull_unpublished( $isPublisherRequest ) {
    615  $writio_account_email = get_option( 'writio_account_email' );
    716
     
    918    // encode payload
    1019    $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,
    1323    ) );
    1424
     
    2535      if ( ! is_null( $parsed->success ) && $parsed->success ) {
    2636        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;
    2746          // double check to make sure the post doesn't already exist before creating
    2847          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;
    3848            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 );
    3955          }
    4056        }
     
    5773    'post_status'    => 'any',
    5874    'title'          => $title,
     75    'exact'          => true,
    5976  );
    6077
  • writio/trunk/includes/rest-hooks.php

    r3045958 r3048091  
    3939  $author_id = $request->get_param( 'authorId' );
    4040  $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' => false
    54     );
    55     return writio_post_status_callback( $log_id, $article_id, "", false, "Post already published with this title!", $response );
    56   }
    5741
    5842  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  
    1717 * Plugin URI:        https://writio.com/
    1818 * 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.1
     19 * Version:           1.3.2
    2020 * License:           GPL-2.0+
    2121 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
     
    3030
    3131define( 'WRITIO__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    32 define( 'WRITIO_VERSION', '1.3.1' );
     32define( 'WRITIO_VERSION', '1.3.2' );
    3333
    3434require_once WRITIO__PLUGIN_DIR . 'includes/rest-hooks.php';
Note: See TracChangeset for help on using the changeset viewer.