Plugin Directory

Changeset 3018629


Ignore:
Timestamp:
01/08/2024 08:41:08 AM (2 years ago)
Author:
appfulapp
Message:

Added possibility to force resource updates

Location:
appful-app
Files:
2 added
3 deleted
106 edited
249 copied

Legend:

Unmodified
Added
Removed
  • appful-app/tags/3.1.16/appful-app.php

    r2982658 r3018629  
    1212 * Plugin URI:        https://appful.io
    1313 * Description:       Appful® is the number 1 plugin for turning your WordPress Content into a native, beautiful app on iOS & Android in under 5 minutes.
    14  * Version:           3.1.15
     14 * Version:           3.1.16
    1515 * Requires at least: 5.8
    1616 * Requires PHP:      7.4
  • appful-app/tags/3.1.16/includes/api/Api.php

    r2954441 r3018629  
    2828        if ( get_query_var( "appful", 0 ) != 0 ) {
    2929            $action = get_query_var( "appful_action" );
    30             Logger::log( "Handling WP Plugin request from Appful, action: " . $action );
     30            Logger::debug( "Handling WP Plugin request from Appful, action: " . $action );
    3131
    3232            $request = PluginRequest::plugin_request()->action( $action );
  • appful-app/tags/3.1.16/includes/api/ReqHandler.php

    r2978062 r3018629  
    8484        }
    8585
    86         Logger::log( "Did not find handler for action: " . $request->get_action() );
     86        Logger::error( "Did not find handler for action: " . $request->get_action() );
    8787
    8888        return PluginResponse::plugin_response()->status( 404 );
  • appful-app/tags/3.1.16/includes/api/Rewrites.php

    r2920603 r3018629  
    2929
    3030    public function enable_rewrite() {
    31         Logger::log( "Add filter for enabling rewrite rules" );
     31        Logger::debug( "Add filter for enabling rewrite rules" );
    3232        add_filter(
    3333            "rewrite_rules_array",
     
    4242
    4343    private function enabled_rewrite_rules( $rules ): array {
    44         Logger::log( "Enabling rewrite rules" );
     44        Logger::debug( "Enabling rewrite rules" );
    4545
    4646        if ( $rules == null ) {
     
    6565
    6666    public function disable_rewrite() {
    67         Logger::log( "Remove filter for enabling rewrite rules" );
     67        Logger::info( "Remove filter for enabling rewrite rules" );
    6868        add_filter(
    6969            "rewrite_rules_array",
     
    7878
    7979    private function disabled_rewrite_rules( $rules ): array {
    80         Logger::log( "Disabling rewrite rules" );
     80        Logger::info( "Disabling rewrite rules" );
    8181
    8282        if ( $rules == null ) {
  • appful-app/tags/3.1.16/includes/api/client/BackendClient.php

    r2971184 r3018629  
    4040
    4141            if ( $response->getStatusCode() != 200 ) {
    42                 Logger::log( "Received non 200 status code (" . $response->getStatusCode() . ") for request path: " . $request_path . " with request body: " . $backend_request->get_body() );
     42                Logger::error( "Received non 200 status code (" . $response->getStatusCode() . ") for request path: " . $request_path . " with request body: " . $backend_request->get_body() );
    4343                $response_body = [ "error" => $response->getBody() ];
    4444            } else {
     
    5353            return HttpResponse::backend_response()->body( $response_body )->status( $response->getStatusCode() );
    5454        } catch ( GuzzleException $e ) {
    55             Logger::log( "Error happened when trying to execute backend request: " . $e->getMessage() );
     55            Logger::error( "Error happened when trying to execute backend request: " . $e->getMessage() );
    5656
    5757            return HttpResponse::backend_response()->status( 500 );
  • appful-app/tags/3.1.16/includes/api/client/SelfClient.php

    r2971184 r3018629  
    3636
    3737            if ( $response->getStatusCode() != 200 ) {
    38                 Logger::log( "Received non 200 status code (" . $response->getStatusCode() . ") for local request path: " . $request_url . " with request body: " . json_decode( $backend_request->get_body() ) );
     38                Logger::error( "Received non 200 status code (" . $response->getStatusCode() . ") for local request path: " . $request_url . " with request body: " . json_decode( $backend_request->get_body() ) );
    3939            }
    4040
    4141            return HttpResponse::backend_response()->body( json_decode( $response->getBody(), true ) )->status( $response->getStatusCode() );
    4242        } catch ( GuzzleException $e ) {
    43             Logger::log( "Error happened when trying to execute backend request: " . $e->getMessage() );
     43            Logger::error( "Error happened when trying to execute backend request: " . $e->getMessage() );
    4444
    4545            return HttpResponse::backend_response()->status( 500 );
  • appful-app/tags/3.1.16/includes/api/dtos/SyncItemDto.php

    r2907312 r3018629  
    66    public int $id = - 1;
    77    public string $modified = "";
     8    public bool $force_update = false;
    89
    9     public function __construct( int $id, string $modified ) {
    10         $this->id       = $id;
    11         $this->modified = $modified;
     10    public function __construct( int $id, string $modified, bool $force_update ) {
     11        $this->id           = $id;
     12        $this->modified     = $modified;
     13        $this->force_update = $force_update;
    1214    }
    1315}
  • appful-app/tags/3.1.16/includes/api/handlers/AndroidAssetLinkRequestHandler.php

    r2912562 r3018629  
    2121
    2222    public function handle_request( PluginRequest $request ): PluginResponse {
    23         Logger::log( "Found handler for Appful request" );
     23        Logger::debug( "Found handler for Appful request" );
    2424        $value = $this->get_android_asset_link_use_case->invoke();
    2525        if ( $value == null ) {
  • appful-app/tags/3.1.16/includes/api/handlers/AppleAppSiteAssociationRequestHandler.php

    r2912562 r3018629  
    2121
    2222    public function handle_request( PluginRequest $request ): PluginResponse {
    23         Logger::log( "Found handler for Appful request" );
     23        Logger::debug( "Found handler for Appful request" );
    2424        $value = $this->get_apple_app_site_association_use_case->invoke();
    2525        if ( $value == null ) {
  • appful-app/tags/3.1.16/includes/api/handlers/AttachmentSyncRequestHandler.php

    r2907312 r3018629  
    2323
    2424    public function handle_request( PluginRequest $request ): PluginResponse {
    25         Logger::log( "Found handler for Appful request" );
     25        Logger::debug( "Found handler for Appful request" );
    2626
    2727        // Because there could be a huge amount of posts, increase the timeout to 10min
  • appful-app/tags/3.1.16/includes/api/handlers/AuthenticateUserRequestHandler.php

    r2978062 r3018629  
    2424
    2525    public function handle_request( PluginRequest $request ): PluginResponse {
    26         Logger::log( "Found handler for Appful request" );
     26        Logger::debug( "Found handler for Appful request" );
    2727
    2828        $body_input = sanitize_text_field( file_get_contents( 'php://input' ) );
  • appful-app/tags/3.1.16/includes/api/handlers/CategorySyncRequestHandler.php

    r2907312 r3018629  
    2323
    2424    public function handle_request( PluginRequest $request ): PluginResponse {
    25         Logger::log( "Found handler for Appful request" );
     25        Logger::debug( "Found handler for Appful request" );
    2626
    2727        // Because there could be a huge amount of posts, increase the timeout to 10min
  • appful-app/tags/3.1.16/includes/api/handlers/ClearLogRequestHandler.php

    r2920040 r3018629  
    2121
    2222    public function handle_request( PluginRequest $request ): PluginResponse {
    23         Logger::log( "Found handler for Appful request" );
     23        Logger::debug( "Found handler for Appful request" );
    2424
    2525        $this->clear_logs_use_case->invoke();
  • appful-app/tags/3.1.16/includes/api/handlers/CommentSyncRequestHandler.php

    r2907312 r3018629  
    2323
    2424    public function handle_request( PluginRequest $request ): PluginResponse {
    25         Logger::log( "Found handler for Appful request" );
     25        Logger::debug( "Found handler for Appful request" );
    2626
    2727        // Because there could be a huge amount of posts, increase the timeout to 10min
  • appful-app/tags/3.1.16/includes/api/handlers/CreateCommentRequestHandler.php

    r2978062 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        $body_input = sanitize_text_field( file_get_contents( 'php://input' ) );
     
    3232        // required fields
    3333        if (!isset($data["username"], $data["email"], $data["content"], $data["post_id"])) {
    34             Logger::log( "Some parameters are missing" );
     34            Logger::error( "Some parameters for create comment are missing" );
    3535            return PluginResponse::plugin_response()->status( 400 );  // Bad Request
    3636        }
     
    4949        $comment = $this->create_comment_use_case->invoke( $request );
    5050        if ( $comment == null ) {
    51             Logger::log( "Creating comment failed" );
     51            Logger::error( "Creating comment failed" );
    5252            return PluginResponse::plugin_response()->status( 503 );
    5353        }
  • appful-app/tags/3.1.16/includes/api/handlers/GetAttachmentsRequestHandler.php

    r2907312 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        // Because there could be a huge amount of posts, increase the timeout to 10min
     
    4242        );
    4343
    44         Logger::log( "Sending attachments for ids " . json_encode( $ids ) );
     44        Logger::debug( "Sending attachments for ids " . json_encode( $ids ) );
    4545
    4646        $attachments = $this->get_attachments_by_id_use_case->invoke( $ids );
  • appful-app/tags/3.1.16/includes/api/handlers/GetCategoriesRequestHandler.php

    r2907312 r3018629  
    2323
    2424    public function handle_request( PluginRequest $request ): PluginResponse {
    25         Logger::log( "Found handler for Appful request" );
     25        Logger::debug( "Found handler for Appful request" );
    2626
    2727        // Because there could be a huge amount of posts, increase the timeout to 10min
     
    4040        );
    4141
    42         Logger::log( "Sending categories for ids " . json_encode( $ids ) );
     42        Logger::debug( "Sending categories for ids " . json_encode( $ids ) );
    4343
    4444        $categories = $this->get_categories_by_id_use_case->invoke( $ids );
  • appful-app/tags/3.1.16/includes/api/handlers/GetCommentsRequestHandler.php

    r2907312 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        // Because there could be a huge amount of posts, increase the timeout to 10min
     
    4242        );
    4343
    44         Logger::log( "Sending comments for ids " . json_encode( $ids ) );
     44        Logger::debug( "Sending comments for ids " . json_encode( $ids ) );
    4545
    4646        $comments = $this->get_comments_by_id_use_case->invoke( $ids );
  • appful-app/tags/3.1.16/includes/api/handlers/GetPageContentsRequestHandler.php

    r2971184 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        // Because there could be a huge amount of pages, increase the timeout to 10min
     
    4848        }
    4949
    50         Logger::log( "Sending page contents for ids " . json_encode( $ids ) . " for user " . $user_id );
     50        Logger::debug( "Sending page contents for ids " . json_encode( $ids ) . " for user " . $user_id );
    5151
    5252        $page_contents = $this->get_page_contents_by_id_use_case->invoke( $ids, $cleaned_user_id );
  • appful-app/tags/3.1.16/includes/api/handlers/GetPagesRequestHandler.php

    r2971184 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        // Because there could be a huge amount of pages, increase the timeout to 10min
     
    4242        );
    4343
    44         Logger::log( "Sending pages for ids " . json_encode( $ids ) );
     44        Logger::debug( "Sending pages for ids " . json_encode( $ids ) );
    4545
    4646        $pages = $this->get_pages_by_id_use_case->invoke( $ids );
  • appful-app/tags/3.1.16/includes/api/handlers/GetPostContentsRequestHandler.php

    r2907312 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        // Because there could be a huge amount of posts, increase the timeout to 10min
     
    4242        );
    4343
    44         Logger::log( "Sending post contents for ids " . json_encode( $ids ) );
     44        Logger::debug( "Sending post contents for ids " . json_encode( $ids ) );
    4545
    4646        $postContents = $this->get_post_contents_by_id_use_case->invoke( $ids );
  • appful-app/tags/3.1.16/includes/api/handlers/GetPostsRequestHandler.php

    r2907312 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        // Because there could be a huge amount of posts, increase the timeout to 10min
     
    4242        );
    4343
    44         Logger::log( "Sending posts for ids " . json_encode( $ids ) );
     44        Logger::debug( "Sending posts for ids " . json_encode( $ids ) );
    4545
    4646        $posts = $this->get_posts_by_id_use_case->invoke( $ids );
  • appful-app/tags/3.1.16/includes/api/handlers/GetRolesRequestHandler.php

    r2962811 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        // Because there could be a huge amount of roles, increase the timeout to 10min
     
    4242        );
    4343
    44         Logger::log( "Sending roles for ids " . json_encode( $ids ) );
     44        Logger::debug( "Sending roles for ids " . json_encode( $ids ) );
    4545
    4646        $roles = $this->get_roles_by_id_use_case->invoke( $ids );
  • appful-app/tags/3.1.16/includes/api/handlers/GetTagsRequestHandler.php

    r2907312 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        // Because there could be a huge amount of posts, increase the timeout to 10min
     
    4242        );
    4343
    44         Logger::log( "Sending tags for ids " . json_encode( $ids ) );
     44        Logger::debug( "Sending tags for ids " . json_encode( $ids ) );
    4545
    4646        $tags = $this->get_tags_by_id_use_case->invoke( $ids );
  • appful-app/tags/3.1.16/includes/api/handlers/GetUsersRequestHandler.php

    r2907312 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        // Because there could be a huge amount of users, increase the timeout to 10min
     
    4242        );
    4343
    44         Logger::log( "Sending users for ids " . json_encode( $ids ) );
     44        Logger::debug( "Sending users for ids " . json_encode( $ids ) );
    4545
    4646        $users = $this->get_users_by_id_use_case->invoke( $ids );
  • appful-app/tags/3.1.16/includes/api/handlers/InfoRequestHandler.php

    r2978062 r3018629  
    2222
    2323    public function handle_request( PluginRequest $request ): PluginResponse {
    24         Logger::log( "Found handler for Appful request" );
     24        Logger::debug( "Found handler for Appful request" );
    2525
    2626        $blog_info     = $this->get_blog_info_use_case->invoke();
  • appful-app/tags/3.1.16/includes/api/handlers/LogRequestHandler.php

    r2907312 r3018629  
    2121
    2222    public function handle_request( PluginRequest $request ): PluginResponse {
    23         Logger::log( "Found handler for Appful request" );
     23        Logger::debug( "Found handler for Appful request" );
    2424
    2525        $logs = $this->get_logs_use_case->invoke();
  • appful-app/tags/3.1.16/includes/api/handlers/PageSyncRequestHandler.php

    r2971184 r3018629  
    2323
    2424    public function handle_request( PluginRequest $request ): PluginResponse {
    25         Logger::log( "Found handler for Appful request" );
     25        Logger::debug( "Found handler for Appful request" );
    2626
    2727        // Because there could be a huge amount of posts, increase the timeout to 10min
  • appful-app/tags/3.1.16/includes/api/handlers/PostSyncRequestHandler.php

    r2907312 r3018629  
    2323
    2424    public function handle_request( PluginRequest $request ): PluginResponse {
    25         Logger::log( "Found handler for Appful request" );
     25        Logger::debug( "Found handler for Appful request" );
    2626
    2727        // Because there could be a huge amount of posts, increase the timeout to 10min
  • appful-app/tags/3.1.16/includes/api/handlers/PullLocalPageContentRequestHandler.php

    r2971184 r3018629  
    2424
    2525    public function handle_request( PluginRequest $request ): PluginResponse {
    26         Logger::log( "Found handler for Appful request" );
     26        Logger::debug( "Found handler for Appful request" );
    2727
    2828        // Because there could be a huge amount of pages, increase the timeout to 10min
     
    4040        }
    4141
    42         Logger::log( "Sending local page content for id " . $cleaned_id . " for user " . $cleaned_user_id );
     42        Logger::debug( "Sending local page content for id " . $cleaned_id . " for user " . $cleaned_user_id );
    4343
    4444        $page_content = $this->get_local_page_content_by_id_use_case->invoke( $cleaned_id, $cleaned_user_id );
  • appful-app/tags/3.1.16/includes/api/handlers/PullLocalPostContentRequestHandler.php

    r2920184 r3018629  
    2424
    2525    public function handle_request( PluginRequest $request ): PluginResponse {
    26         Logger::log( "Found handler for Appful request" );
     26        Logger::debug( "Found handler for Appful request" );
    2727
    2828        // Because there could be a huge amount of posts, increase the timeout to 10min
     
    3535        $cleanedId = absint( sanitize_text_field( $_GET['id'] ) );
    3636
    37         Logger::log( "Sending local post content for id " . $cleanedId );
     37        Logger::debug( "Sending local post content for id " . $cleanedId );
    3838
    3939        $post_content = $this->get_local_post_content_by_id_use_case->invoke( $cleanedId );
  • appful-app/tags/3.1.16/includes/api/handlers/RoleSyncRequestHandler.php

    r2962811 r3018629  
    2323
    2424    public function handle_request( PluginRequest $request ): PluginResponse {
    25         Logger::log( "Found handler for Appful request" );
     25        Logger::debug( "Found handler for Appful request" );
    2626
    2727        // Because there could be a huge amount of roles, increase the timeout to 10min
  • appful-app/tags/3.1.16/includes/api/handlers/SyncRequestHandler.php

    r2907312 r3018629  
    2323
    2424    public function handle_request( PluginRequest $request ): PluginResponse {
    25         Logger::log( "Found handler for Appful request" );
     25        Logger::debug( "Found handler for Appful request" );
    2626
    2727        $this->sync_all_use_case->invoke();
  • appful-app/tags/3.1.16/includes/api/handlers/TagSyncRequestHandler.php

    r2907312 r3018629  
    2323
    2424    public function handle_request( PluginRequest $request ): PluginResponse {
    25         Logger::log( "Found handler for Appful request" );
     25        Logger::debug( "Found handler for Appful request" );
    2626
    2727        // Because there could be a huge amount of posts, increase the timeout to 10min
  • appful-app/tags/3.1.16/includes/api/handlers/UserSyncRequestHandler.php

    r2907312 r3018629  
    2323
    2424    public function handle_request( PluginRequest $request ): PluginResponse {
    25         Logger::log( "Found handler for Appful request" );
     25        Logger::debug( "Found handler for Appful request" );
    2626
    2727        // Because there could be a huge amount of users, increase the timeout to 10min
  • appful-app/tags/3.1.16/includes/api/handlers/page/GetPageContentRequestHandler.php

    r2978062 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        if ( ! isset( $_GET['id'] ) ) {
     
    3939        }
    4040
    41         Logger::log( "Sending page content for id " . json_encode( $cleaned_id ) . " for user " . $request_user_id );
     41        Logger::debug( "Sending page content for id " . json_encode( $cleaned_id ) . " for user " . $request_user_id );
    4242
    4343        $page_contents = $this->get_page_contents_by_id_use_case->invoke( [ $cleaned_id ], $cleaned_user_id );
  • appful-app/tags/3.1.16/includes/api/mapper/SyncItemMapper.php

    r2907312 r3018629  
    1010        return new SyncItemDto(
    1111            $sync_item->get_id(),
    12             $sync_item->get_modified()
     12            $sync_item->get_modified(),
     13            $sync_item->get_force_update(),
    1314        );
    1415    }
  • appful-app/tags/3.1.16/includes/custom_taxonomies/AppfulTaxonomies.php

    r2982658 r3018629  
    6363
    6464        if ( ! $push_term ) {
    65             Logger::log( "Adding initial appful push term" );
     65            Logger::debug( "Adding initial appful push term" );
    6666
    6767            $args = [
     
    8282
    8383        if ( $push_term ) {
    84             Logger::log( "Removing initial appful push term" );
     84            Logger::info( "Removing initial appful push term" );
    8585
    8686            wp_delete_term(
  • appful-app/tags/3.1.16/includes/domain/SyncItem.php

    r2907312 r3018629  
    66    private int $id = - 1;
    77    private string $modified = "";
     8    private bool $force_update = false;
    89
    910    public static function syncItem(
    1011        int $id = - 1,
    11         string $modified = ""
     12        string $modified = "",
     13        bool $force_update = false,
    1214    ): SyncItem {
    1315        return ( new SyncItem() )
     
    2830    }
    2931
     32    public function force_update( bool $force_update ): SyncItem {
     33        $this->force_update = $force_update;
     34
     35        return $this;
     36    }
     37
    3038    public function get_id(): int {
    3139        return $this->id;
     
    3543        return $this->modified;
    3644    }
     45
     46    public function get_force_update(): bool {
     47        return $this->force_update;
     48    }
    3749}
  • appful-app/tags/3.1.16/includes/helper/Logger.php

    r2920030 r3018629  
    44
    55class Logger {
    6     public static function log( $msg, $name = '' ) {
    7         if ( Constants::$APPFUL_DEBUG || ( isset( $_REQUEST["debug"] ) && $_REQUEST["debug"] == "1" ) ) {
     6    private static function log( string $msg, ?string $level = null, string $name = '' ) {
     7        $log_level = $level ?? LoggerLevel::$DEBUG;
     8
     9        if ( $log_level !== LoggerLevel::$DEBUG || ( Constants::$APPFUL_DEBUG || ( isset( $_REQUEST["debug"] ) && $_REQUEST["debug"] == "1" ) ) ) {
    810            $trace = debug_backtrace();
    911            $name  = ( '' == $name ) ? ( ( isset( $trace[1]['class'] ) ) ? $trace[1]['class'] : "Unknown" ) . "(" . $trace[1]['function'] . "):" . $trace[1]['line'] : $name;
    1012            $name  = str_pad( substr( $name, 0, 79 ), 80 );
    1113
     14            $log_level = str_pad( $log_level, 8 );
     15
    1216            $error_dir = self::getLogFile();
    1317            $msg       = print_r( $msg, true );
    1418            $date      = date( 'd-m-y h:i:s' );
    15             $log       = $date . " - " . $name . "  |  " . $msg . "\n";
     19            $log       = "[" . $log_level . "]" . "[" . $date . "]" . " - " . $name . "  |  " . $msg . "\n";
    1620            error_log( $log, 3, $error_dir );
    1721        }
     22    }
     23
     24    public static function debug( string $msg, string $name = '' ) {
     25        self::log( $msg, LoggerLevel::$DEBUG, $name );
     26    }
     27
     28    public static function info( string $msg, string $name = '' ) {
     29        self::log( $msg, LoggerLevel::$INFO, $name );
     30    }
     31
     32    public static function error( string $msg, string $name = '' ) {
     33        self::log( $msg, LoggerLevel::$ERROR, $name );
    1834    }
    1935
  • appful-app/tags/3.1.16/includes/hooks/ActivationHook.php

    r2907312 r3018629  
    4040
    4141    private function on_activate() {
    42         Logger::log( "Plugin activated" );
     42        Logger::info( "Plugin activated" );
    4343
    4444        $this->taxonomy_manager->load_direct();
     
    4747
    4848    private function on_deactivate() {
    49         Logger::log( "Plugin deactivated" );
     49        Logger::info( "Plugin deactivated" );
    5050
    5151        $this->taxonomy_manager->load_direct();
  • appful-app/tags/3.1.16/includes/hooks/AttachmentHook.php

    r2920030 r3018629  
    4444
    4545    private function on_save_attachment( int $attachment_id ) {
    46         Logger::log( "Attachment with id " . $attachment_id . " saved!" );
     46        Logger::debug( "Attachment with id " . $attachment_id . " saved!" );
    4747
    4848        $attachment_post = get_post( $attachment_id );
     
    5454
    5555    private function on_delete_attachment( int $attachment_id ) {
    56         Logger::log( "Attachment with id " . $attachment_id . " deleted!" );
     56        Logger::debug( "Attachment with id " . $attachment_id . " deleted!" );
    5757
    5858        $this->use_case_manager->attachment_delete_use_case()->invoke( $attachment_id );
  • appful-app/tags/3.1.16/includes/hooks/CommentHook.php

    r2907312 r3018629  
    5454
    5555    private function on_comment_transition( string $new_status, ?string $old_status, WP_Comment $comment ) {
    56         Logger::log( "Comment transitioned from " . ( $old_status == null ? "null" : $old_status ) . " to " . $new_status . ": " . json_encode( $comment ) );
     56        Logger::debug( "Comment transitioned from " . ( $old_status == null ? "null" : $old_status ) . " to " . $new_status . ": " . json_encode( $comment ) );
    5757        $domain_comment = CommentMapper::to_domain( $comment );
    5858        $this->use_case_manager->comment_save_use_case()->invoke( $domain_comment );
     
    7272
    7373    private function on_delete_comment( string $comment_id ) {
    74         Logger::log( "Comment with id " . $comment_id . " deleted!" );
     74        Logger::debug( "Comment with id " . $comment_id . " deleted!" );
    7575
    7676        $this->use_case_manager->comment_delete_use_case()->invoke( $comment_id );
  • appful-app/tags/3.1.16/includes/hooks/PageHook.php

    r2971184 r3018629  
    4040        }
    4141
    42         Logger::log( "Page with id " . $page->ID . " deleted!" );
     42        Logger::debug( "Page with id " . $page->ID . " deleted!" );
    4343
    4444        $this->use_case_manager->page_delete_use_case()->invoke( $page_id );
     
    5858        }
    5959
    60         Logger::log( "Page with id " . $page->ID . " inserted with status " . $page->post_status . "!" );
     60        Logger::debug( "Page with id " . $page->ID . " inserted with status " . $page->post_status . "!" );
    6161
    6262        $domain_page = PageMapper::to_domain( $page );
  • appful-app/tags/3.1.16/includes/hooks/PostHook.php

    r2932187 r3018629  
    1818        add_action(
    1919            "wp_after_insert_post",
    20             function ( int $post_id, WP_Post $post ) {
    21                 $this->after_save_post( $post );
     20            function ( int $post_id, WP_Post $post, bool $update, ?WP_Post $post_before ) {
     21                $this->after_save_post( $post, $post_before );
    2222            },
    2323            99,
    24             2,
     24            4,
    2525        );
    2626
     
    4040        }
    4141
    42         Logger::log( "Post with id " . $post->ID . " deleted!" );
     42        Logger::debug( "Post with id " . $post->ID . " deleted!" );
    4343
    4444        $this->use_case_manager->post_delete_use_case()->invoke( $post_id );
    4545    }
    4646
    47     private function after_save_post( WP_Post $post ) {
     47    private function after_save_post( WP_Post $post, ?WP_Post $post_before ) {
    4848        if ( defined( "DOING_AUTOSAVE" ) && DOING_AUTOSAVE ) {
    4949            return;
     
    5858        }
    5959
    60         Logger::log( "Post with id " . $post->ID . " inserted with status " . $post->post_status . "!" );
     60        Logger::debug( "Post with id " . $post->ID . " inserted with status " . $post->post_status . "!" );
    6161
    62         $domain_post = PostMapper::to_domain( $post );
     62        $domain_post = PostMapper::to_sync_item( $post, $post->post_status != $post_before->post_status );
    6363        $this->use_case_manager->post_save_use_case()->invoke( $domain_post );
    6464    }
  • appful-app/tags/3.1.16/includes/hooks/SessionHook.php

    r2936340 r3018629  
    3535
    3636    private function on_appful_login() {
    37         Logger::log( "Logging in user!" );
     37        Logger::info( "Logging in user!" );
    3838
    3939        WPOptionsManager::delete_last_sync_error();
     
    4242            $this->use_case_manager->sync_all_use_case()->invoke();
    4343        } else {
    44             Logger::log( "Error occurred when registering blog!" );
     44            Logger::error( "Error occurred when registering blog!" );
    4545            $this->clean_on_error();
    4646        }
     
    5656
    5757    private function on_appful_logout() {
    58         Logger::log( "Logging out user!" );
     58        Logger::info( "Logging out user!" );
    5959        if ( $this->use_case_manager->is_logged_in_use_case()->invoke() ) {
    6060            $this->use_case_manager->delete_session_use_case()->invoke();
  • appful-app/tags/3.1.16/includes/hooks/TaxonomyHook.php

    r2907312 r3018629  
    5555    private function on_saved_category( int $term_id, int $taxonomy_id ) {
    5656        $category = get_term( $term_id );
    57         Logger::log( "Category with id " . $term_id . " saved!" );
     57        Logger::debug( "Category with id " . $term_id . " saved!" );
    5858
    5959        $domain_category = CategoryMapper::to_domain( $category );
     
    6262
    6363    private function on_delete_category( int $term_id, int $taxonomy_id ) {
    64         Logger::log( "Category with id " . $term_id . " deleted!" );
     64        Logger::debug( "Category with id " . $term_id . " deleted!" );
    6565
    6666        $this->use_case_manager->category_delete_use_case()->invoke( $term_id );
     
    6969    private function on_saved_tag( int $term_id, int $taxonomy_id ) {
    7070        $tag = get_term( $term_id );
    71         Logger::log( "Tag with id " . $term_id . " saved!" );
     71        Logger::debug( "Tag with id " . $term_id . " saved!" );
    7272
    7373        $domain_tag = TagMapper::to_domain( $tag );
     
    7676
    7777    private function on_delete_tag( int $term_id, int $taxonomy_id ) {
    78         Logger::log( "Tag with id " . $term_id . " deleted!" );
     78        Logger::debug( "Tag with id " . $term_id . " deleted!" );
    7979
    8080        $this->use_case_manager->tag_delete_use_case()->invoke( $term_id );
  • appful-app/tags/3.1.16/includes/hooks/UserHook.php

    r2982658 r3018629  
    5353
    5454    private function on_save_user( int $user_id ) {
    55         Logger::log( "User with id " . $user_id . " saved!" );
     55        Logger::debug( "User with id " . $user_id . " saved!" );
    5656
    5757        $wp_user = WPUserManager::get_user_by_id( $user_id );
     
    6262
    6363    private function on_delete_user( int $user_id ) {
    64         Logger::log( "User with id " . $user_id . " deleted!" );
     64        Logger::debug( "User with id " . $user_id . " deleted!" );
    6565
    6666        $this->use_case_manager->user_delete_use_case()->invoke( $user_id );
  • appful-app/tags/3.1.16/includes/use_cases/AttachmentDeleteUseCase.php

    r2920184 r3018629  
    1616
    1717    public function invoke( string $attachment_id ) {
    18         Logger::log( "Sending attachment delete request for: " . $attachment_id );
     18        Logger::debug( "Sending attachment delete request for: " . $attachment_id );
    1919        $request = HttpRequest::backend_request()->method( "DELETE" )->path( Constants::$ATTACHMENT_PATH . "/" . $attachment_id );
    2020        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/AttachmentSaveUseCase.php

    r2920184 r3018629  
    1919    public function invoke( Attachment $attachment ) {
    2020        $attachment_dto = AttachmentMapper::to_dto( $attachment );
    21         Logger::log( "Sending attachment save request with data: " . json_encode( $attachment_dto ) );
     21        Logger::debug( "Sending attachment save request with data: " . json_encode( $attachment_dto ) );
    2222        $request = HttpRequest::backend_request()->method( "POST" )->body( $attachment_dto )->path( Constants::$ATTACHMENT_PATH );
    2323        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/CategoryDeleteUseCase.php

    r2920184 r3018629  
    1616
    1717    public function invoke( int $term_id ) {
    18         Logger::log( "Sending category delete request for: " . $term_id );
     18        Logger::debug( "Sending category delete request for: " . $term_id );
    1919        $request = HttpRequest::backend_request()->method( "DELETE" )->path( Constants::$TAXONOMY_PATH . "/categories/" . $term_id );
    2020        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/CategorySaveUseCase.php

    r2920184 r3018629  
    1919    public function invoke( Category $category ) {
    2020        $category_dto = CategoryMapper::to_dto( $category );
    21         Logger::log( "Sending category save request with data: " . json_encode( $category_dto ) );
     21        Logger::debug( "Sending category save request with data: " . json_encode( $category_dto ) );
    2222        $request = HttpRequest::backend_request()->method( "POST" )->body( $category_dto )->path( Constants::$TAXONOMY_PATH . "/categories" );
    2323        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/CommentDeleteUseCase.php

    r2920184 r3018629  
    1616
    1717    public function invoke( string $comment_id ) {
    18         Logger::log( "Sending comment delete request for: " . $comment_id );
     18        Logger::debug( "Sending comment delete request for: " . $comment_id );
    1919        $request = HttpRequest::backend_request()->method( "DELETE" )->path( Constants::$COMMENT_PATH . "/" . $comment_id );
    2020        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/CommentSaveUseCase.php

    r2920184 r3018629  
    1919    public function invoke( Comment $comment ) {
    2020        $comment_dto = CommentMapper::to_dto( $comment );
    21         Logger::log( "Sending comment save request with data: " . json_encode( $comment_dto ) );
     21        Logger::debug( "Sending comment save request with data: " . json_encode( $comment_dto ) );
    2222        $request = HttpRequest::backend_request()->method( "POST" )->body( $comment_dto )->path( Constants::$COMMENT_PATH );
    2323        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/DeleteSessionUseCase.php

    r2936340 r3018629  
    1616
    1717    public function invoke() {
    18         Logger::log( "Unregistering blog!" );
     18        Logger::info( "Unregistering blog!" );
    1919        $request = HttpRequest::backend_request()->method( "DELETE" )->path( Constants::$BLOG_PATH );
    2020        $this->backend_client->send_request( $request, false );
  • appful-app/tags/3.1.16/includes/use_cases/LogoutUserUseCase.php

    r2936340 r3018629  
    1616
    1717    public function invoke() {
    18         Logger::log( "Logout user!" );
     18        Logger::info( "Logout user!" );
    1919        $request = HttpRequest::backend_request()->method( "DELETE" )->path( Constants::$APPFUL_USER_PATH . "/logout" );
    2020        $this->backend_client->send_request( $request, false );
  • appful-app/tags/3.1.16/includes/use_cases/PageDeleteUseCase.php

    r2971184 r3018629  
    1616
    1717    public function invoke( int $page_id ) {
    18         Logger::log( "Sending page delete request for: " . $page_id );
     18        Logger::debug( "Sending page delete request for: " . $page_id );
    1919        $request = HttpRequest::backend_request()->method( "DELETE" )->path( Constants::$PAGE_PATH . "/" . $page_id );
    2020        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/PageSaveUseCase.php

    r2971184 r3018629  
    1919    public function invoke( Page $page ) {
    2020        $page_dto = PageMapper::to_dto( $page );
    21         Logger::log( "Sending page save request with data: " . json_encode( $page_dto ) );
     21        Logger::debug( "Sending page save request with data: " . json_encode( $page_dto ) );
    2222        $request = HttpRequest::backend_request()->method( "POST" )->body( $page_dto )->path( Constants::$PAGE_PATH );
    2323        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/PostDeleteUseCase.php

    r2920184 r3018629  
    1616
    1717    public function invoke( int $post_id ) {
    18         Logger::log( "Sending post delete request for: " . $post_id );
     18        Logger::debug( "Sending post delete request for: " . $post_id );
    1919        $request = HttpRequest::backend_request()->method( "DELETE" )->path( Constants::$POST_PATH . "/" . $post_id );
    2020        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/PostSaveUseCase.php

    r2920184 r3018629  
    44
    55use AppfulPlugin\Api\Client\BackendClient;
    6 use AppfulPlugin\Api\Mapper\PostMapper;
     6use AppfulPlugin\Api\Mapper\SyncItemMapper;
    77use AppfulPlugin\Api\Requests\HttpRequest;
    8 use AppfulPlugin\Domain\Post;
     8use AppfulPlugin\Domain\SyncItem;
    99use AppfulPlugin\Helper\Constants;
    1010use AppfulPlugin\Helper\Logger;
     
    1717    }
    1818
    19     public function invoke( Post $post ) {
    20         $post_dto = PostMapper::to_dto( $post );
    21         Logger::log( "Sending post save request with data: " . json_encode( $post_dto ) );
     19    public function invoke( SyncItem $post ) {
     20        $post_dto = SyncItemMapper::to_dto( $post );
     21        Logger::debug( "Sending post save request with data: " . json_encode( $post_dto ) );
    2222        $request = HttpRequest::backend_request()->method( "POST" )->body( $post_dto )->path( Constants::$POST_PATH );
    2323        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/PullLocalPostContentUseCase.php

    r2971184 r3018629  
    1717
    1818    public function invoke( int $id ): ?PostContent {
    19         Logger::log( "Pulling local post content for id: " . $id );
     19        Logger::debug( "Pulling local post content for id: " . $id );
    2020
    2121        $request_params = [];
  • appful-app/tags/3.1.16/includes/use_cases/RegisterBlogUseCase.php

    r2936340 r3018629  
    2222        $blog_info_dto = BlogInfoMapper::to_dto( $blog_info );
    2323
    24         Logger::log( "Registering blog with data: " . json_encode( $blog_info_dto ) );
     24        Logger::info( "Registering blog with data: " . json_encode( $blog_info_dto ) );
    2525
    2626        $request  = HttpRequest::backend_request()->method( "POST" )->body( $blog_info_dto )->path( Constants::$BLOG_PATH );
  • appful-app/tags/3.1.16/includes/use_cases/SendAttachmentChunkSyncUseCase.php

    r2920184 r3018629  
    2020        $sync_item_dtos = SyncChunkMapper::to_dto( $sync_items );
    2121
    22         Logger::log( "Sending attachment chunk to sync: " . json_encode( $sync_item_dtos ) );
     22        Logger::debug( "Sending attachment chunk to sync: " . json_encode( $sync_item_dtos ) );
    2323        $request = HttpRequest::backend_request()->method( "PATCH" )->body( $sync_item_dtos )->path( Constants::$ATTACHMENT_PATH . "/sync" );
    2424        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/SendCategoryChunkSyncUseCase.php

    r2920184 r3018629  
    2020        $sync_item_dtos = SyncChunkMapper::to_dto( $sync_items );
    2121
    22         Logger::log( "Sending category chunk to sync: " . json_encode( $sync_item_dtos ) );
     22        Logger::debug( "Sending category chunk to sync: " . json_encode( $sync_item_dtos ) );
    2323        $request = HttpRequest::backend_request()->method( "PATCH" )->body( $sync_item_dtos )->path( Constants::$TAXONOMY_PATH . "/categories/sync" );
    2424        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/SendCommentChunkSyncUseCase.php

    r2920184 r3018629  
    2020        $sync_item_dtos = SyncChunkMapper::to_dto( $sync_items );
    2121
    22         Logger::log( "Sending comment chunk to sync: " . json_encode( $sync_item_dtos ) );
     22        Logger::debug( "Sending comment chunk to sync: " . json_encode( $sync_item_dtos ) );
    2323        $request = HttpRequest::backend_request()->method( "PATCH" )->body( $sync_item_dtos )->path( Constants::$COMMENT_PATH . "/sync" );
    2424        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/SendPageChunkSyncUseCase.php

    r2971184 r3018629  
    2020        $sync_item_dtos = SyncChunkMapper::to_dto( $sync_items );
    2121
    22         Logger::log( "Sending page chunk to sync: " . json_encode( $sync_item_dtos ) );
     22        Logger::debug( "Sending page chunk to sync: " . json_encode( $sync_item_dtos ) );
    2323        $request = HttpRequest::backend_request()->method( "PATCH" )->body( $sync_item_dtos )->path( Constants::$PAGE_PATH . "/sync" );
    2424        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/SendPostChunkSyncUseCase.php

    r2920184 r3018629  
    2222        $sync_item_dtos = SyncChunkMapper::to_dto($sync_items);
    2323
    24         Logger::log( "Sending post chunk to sync: " . json_encode( $sync_item_dtos ) );
     24        Logger::debug( "Sending post chunk to sync: " . json_encode( $sync_item_dtos ) );
    2525        $request = HttpRequest::backend_request()->method( "PATCH" )->body( $sync_item_dtos )->path( Constants::$POST_PATH . "/sync" );
    2626        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/SendRoleChunkSyncUseCase.php

    r2962811 r3018629  
    2020        $sync_item_dtos = SyncChunkMapper::to_dto( $sync_items );
    2121
    22         Logger::log( "Sending role chunk to sync: " . json_encode( $sync_item_dtos ) );
     22        Logger::debug( "Sending role chunk to sync: " . json_encode( $sync_item_dtos ) );
    2323        $request = HttpRequest::backend_request()->method( "PATCH" )->body( $sync_item_dtos )->path( Constants::$ROLE_PATH . "/sync" );
    2424        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/SendTagChunkSyncUseCase.php

    r2920184 r3018629  
    2020        $sync_item_dtos = SyncChunkMapper::to_dto( $sync_items );
    2121
    22         Logger::log( "Sending tag chunk to sync: " . json_encode( $sync_item_dtos ) );
     22        Logger::debug( "Sending tag chunk to sync: " . json_encode( $sync_item_dtos ) );
    2323        $request = HttpRequest::backend_request()->method( "PATCH" )->body( $sync_item_dtos )->path( Constants::$TAXONOMY_PATH . "/tags/sync" );
    2424        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/SendUserChunkSyncUseCase.php

    r2920184 r3018629  
    2020        $sync_item_dtos = SyncChunkMapper::to_dto( $sync_items );
    2121
    22         Logger::log( "Sending user chunk to sync: " . json_encode( $sync_item_dtos ) );
     22        Logger::debug( "Sending user chunk to sync: " . json_encode( $sync_item_dtos ) );
    2323        $request = HttpRequest::backend_request()->method( "PATCH" )->body( $sync_item_dtos )->path( Constants::$USER_PATH . "/sync" );
    2424        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/TagDeleteUseCase.php

    r2920184 r3018629  
    1616
    1717    public function invoke( int $term_id ) {
    18         Logger::log( "Sending tag delete request for: " . $term_id );
     18        Logger::debug( "Sending tag delete request for: " . $term_id );
    1919        $request = HttpRequest::backend_request()->method( "DELETE" )->path( Constants::$TAXONOMY_PATH . "/tags/" . $term_id );
    2020        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/TagSaveUseCase.php

    r2920184 r3018629  
    1919    public function invoke( Tag $tag ) {
    2020        $tag_dto = TagMapper::to_dto( $tag );
    21         Logger::log( "Sending tag save request with data: " . json_encode( $tag_dto ) );
     21        Logger::debug( "Sending tag save request with data: " . json_encode( $tag_dto ) );
    2222        $request = HttpRequest::backend_request()->method( "POST" )->body( $tag_dto )->path( Constants::$TAXONOMY_PATH . "/tags" );
    2323        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/UserDeleteUseCase.php

    r2920184 r3018629  
    1616
    1717    public function invoke( string $user_id ) {
    18         Logger::log( "Sending user delete request for: " . $user_id );
     18        Logger::debug( "Sending user delete request for: " . $user_id );
    1919        $request = HttpRequest::backend_request()->method( "DELETE" )->path( Constants::$USER_PATH . "/" . $user_id );
    2020        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/UserSaveUseCase.php

    r2920184 r3018629  
    1919    public function invoke( User $user ) {
    2020        $user_dto = UserMapper::to_dto( $user );
    21         Logger::log( "Sending user save request with data: " . json_encode( $user_dto ) );
     21        Logger::debug( "Sending user save request with data: " . json_encode( $user_dto ) );
    2222        $request = HttpRequest::backend_request()->method( "POST" )->body( $user_dto )->path( Constants::$USER_PATH );
    2323        $this->backend_client->send_request( $request );
  • appful-app/tags/3.1.16/includes/use_cases/page/PullLocalPageContentUseCase.php

    r2971184 r3018629  
    1717
    1818    public function invoke( int $id, ?int $user_id = null ): ?PageContent {
    19         Logger::log( "Pulling local page content for id " . $id . " for user " . $user_id );
     19        Logger::debug( "Pulling local page content for id " . $id . " for user " . $user_id );
    2020
    2121        $request_params = [];
  • appful-app/tags/3.1.16/includes/wp/WPCommentManager.php

    r2954441 r3018629  
    6464
    6565        if ($commentId === false) {
    66             Logger::log( "Insert comment failed" );
     66            Logger::error( "Insert comment failed" );
    6767            return null;
    6868        }
    69         Logger::log( "Inserted comment!" );
    7069
    7170        $comment = get_comment($commentId);
    7271
    7372        if (!$comment instanceof WP_Comment) {
    74             Logger::log( "Getting comment failed!" );
     73            Logger::error( "Getting comment failed!" );
    7574            return null;
    7675        }
  • appful-app/tags/3.1.16/includes/wp/mapper/PostMapper.php

    r2962811 r3018629  
    44
    55use AppfulPlugin\Domain\Post;
     6use AppfulPlugin\Domain\SyncItem;
    67use AppfulPlugin\Helper\DateParser;
    78use AppfulPlugin\Wp\WPAttachmentManager;
     
    3536                   ->roles( WPRoleManager::get_roles_for_post_id( $post->ID ) );
    3637    }
     38
     39    public static function to_sync_item( WP_Post $post, bool $force_update ): SyncItem {
     40        return SyncItem::syncItem()
     41                       ->id( $post->ID )
     42                       ->modified( DateParser::fromGmtDate( $post->post_modified_gmt ) )
     43                       ->force_update( $force_update );
     44    }
    3745}
  • appful-app/tags/3.1.16/lib/vendor/composer/autoload_classmap.php

    r2978062 r3018629  
    101101    'AppfulPlugin\\Helper\\DateParser' => $baseDir . '/../includes/helper/DateParser.php',
    102102    'AppfulPlugin\\Helper\\Logger' => $baseDir . '/../includes/helper/Logger.php',
     103    'AppfulPlugin\\Helper\\LoggerLevel' => $baseDir . '/../includes/helper/LoggerLevel.php',
    103104    'AppfulPlugin\\Helper\\TemplateLoader' => $baseDir . '/../includes/helper/TemplateLoader.php',
    104105    'AppfulPlugin\\Hooks\\ActivationHook' => $baseDir . '/../includes/hooks/ActivationHook.php',
  • appful-app/tags/3.1.16/lib/vendor/composer/autoload_static.php

    r2978062 r3018629  
    278278        'AppfulPlugin\\Helper\\DateParser' => __DIR__ . '/../..' . '/../includes/helper/DateParser.php',
    279279        'AppfulPlugin\\Helper\\Logger' => __DIR__ . '/../..' . '/../includes/helper/Logger.php',
     280        'AppfulPlugin\\Helper\\LoggerLevel' => __DIR__ . '/../..' . '/../includes/helper/LoggerLevel.php',
    280281        'AppfulPlugin\\Helper\\TemplateLoader' => __DIR__ . '/../..' . '/../includes/helper/TemplateLoader.php',
    281282        'AppfulPlugin\\Hooks\\ActivationHook' => __DIR__ . '/../..' . '/../includes/hooks/ActivationHook.php',
  • appful-app/tags/3.1.16/lib/vendor/composer/installed.php

    r2978062 r3018629  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => '2ba6b06d04004a7d391027374cc785e0853d4186',
     6        'reference' => 'd550503fb49e89e7e02f5f243b50014e609439b5',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-main',
    1515            'version' => 'dev-main',
    16             'reference' => '2ba6b06d04004a7d391027374cc785e0853d4186',
     16            'reference' => 'd550503fb49e89e7e02f5f243b50014e609439b5',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
  • appful-app/tags/3.1.16/readme.txt

    r2982658 r3018629  
    44Donate link: https://appful.io
    55Requires at least: 5.8
    6 Tested up to: 6.3
     6Tested up to: 6.4
    77Requires PHP: 7.4
    8 Stable tag: 3.1.15
     8Stable tag: 3.1.16
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • appful-app/trunk/appful-app.php

    r2982658 r3018629  
    1212 * Plugin URI:        https://appful.io
    1313 * Description:       Appful® is the number 1 plugin for turning your WordPress Content into a native, beautiful app on iOS & Android in under 5 minutes.
    14  * Version:           3.1.15
     14 * Version:           3.1.16
    1515 * Requires at least: 5.8
    1616 * Requires PHP:      7.4
  • appful-app/trunk/includes/api/Api.php

    r2954441 r3018629  
    2828        if ( get_query_var( "appful", 0 ) != 0 ) {
    2929            $action = get_query_var( "appful_action" );
    30             Logger::log( "Handling WP Plugin request from Appful, action: " . $action );
     30            Logger::debug( "Handling WP Plugin request from Appful, action: " . $action );
    3131
    3232            $request = PluginRequest::plugin_request()->action( $action );
  • appful-app/trunk/includes/api/ReqHandler.php

    r2978062 r3018629  
    8484        }
    8585
    86         Logger::log( "Did not find handler for action: " . $request->get_action() );
     86        Logger::error( "Did not find handler for action: " . $request->get_action() );
    8787
    8888        return PluginResponse::plugin_response()->status( 404 );
  • appful-app/trunk/includes/api/Rewrites.php

    r2920603 r3018629  
    2929
    3030    public function enable_rewrite() {
    31         Logger::log( "Add filter for enabling rewrite rules" );
     31        Logger::debug( "Add filter for enabling rewrite rules" );
    3232        add_filter(
    3333            "rewrite_rules_array",
     
    4242
    4343    private function enabled_rewrite_rules( $rules ): array {
    44         Logger::log( "Enabling rewrite rules" );
     44        Logger::debug( "Enabling rewrite rules" );
    4545
    4646        if ( $rules == null ) {
     
    6565
    6666    public function disable_rewrite() {
    67         Logger::log( "Remove filter for enabling rewrite rules" );
     67        Logger::info( "Remove filter for enabling rewrite rules" );
    6868        add_filter(
    6969            "rewrite_rules_array",
     
    7878
    7979    private function disabled_rewrite_rules( $rules ): array {
    80         Logger::log( "Disabling rewrite rules" );
     80        Logger::info( "Disabling rewrite rules" );
    8181
    8282        if ( $rules == null ) {
  • appful-app/trunk/includes/api/client/BackendClient.php

    r2971184 r3018629  
    4040
    4141            if ( $response->getStatusCode() != 200 ) {
    42                 Logger::log( "Received non 200 status code (" . $response->getStatusCode() . ") for request path: " . $request_path . " with request body: " . $backend_request->get_body() );
     42                Logger::error( "Received non 200 status code (" . $response->getStatusCode() . ") for request path: " . $request_path . " with request body: " . $backend_request->get_body() );
    4343                $response_body = [ "error" => $response->getBody() ];
    4444            } else {
     
    5353            return HttpResponse::backend_response()->body( $response_body )->status( $response->getStatusCode() );
    5454        } catch ( GuzzleException $e ) {
    55             Logger::log( "Error happened when trying to execute backend request: " . $e->getMessage() );
     55            Logger::error( "Error happened when trying to execute backend request: " . $e->getMessage() );
    5656
    5757            return HttpResponse::backend_response()->status( 500 );
  • appful-app/trunk/includes/api/client/SelfClient.php

    r2971184 r3018629  
    3636
    3737            if ( $response->getStatusCode() != 200 ) {
    38                 Logger::log( "Received non 200 status code (" . $response->getStatusCode() . ") for local request path: " . $request_url . " with request body: " . json_decode( $backend_request->get_body() ) );
     38                Logger::error( "Received non 200 status code (" . $response->getStatusCode() . ") for local request path: " . $request_url . " with request body: " . json_decode( $backend_request->get_body() ) );
    3939            }
    4040
    4141            return HttpResponse::backend_response()->body( json_decode( $response->getBody(), true ) )->status( $response->getStatusCode() );
    4242        } catch ( GuzzleException $e ) {
    43             Logger::log( "Error happened when trying to execute backend request: " . $e->getMessage() );
     43            Logger::error( "Error happened when trying to execute backend request: " . $e->getMessage() );
    4444
    4545            return HttpResponse::backend_response()->status( 500 );
  • appful-app/trunk/includes/api/dtos/SyncItemDto.php

    r2907312 r3018629  
    66    public int $id = - 1;
    77    public string $modified = "";
     8    public bool $force_update = false;
    89
    9     public function __construct( int $id, string $modified ) {
    10         $this->id       = $id;
    11         $this->modified = $modified;
     10    public function __construct( int $id, string $modified, bool $force_update ) {
     11        $this->id           = $id;
     12        $this->modified     = $modified;
     13        $this->force_update = $force_update;
    1214    }
    1315}
  • appful-app/trunk/includes/api/handlers/AndroidAssetLinkRequestHandler.php

    r2912562 r3018629  
    2121
    2222    public function handle_request( PluginRequest $request ): PluginResponse {
    23         Logger::log( "Found handler for Appful request" );
     23        Logger::debug( "Found handler for Appful request" );
    2424        $value = $this->get_android_asset_link_use_case->invoke();
    2525        if ( $value == null ) {
  • appful-app/trunk/includes/api/handlers/AppleAppSiteAssociationRequestHandler.php

    r2912562 r3018629  
    2121
    2222    public function handle_request( PluginRequest $request ): PluginResponse {
    23         Logger::log( "Found handler for Appful request" );
     23        Logger::debug( "Found handler for Appful request" );
    2424        $value = $this->get_apple_app_site_association_use_case->invoke();
    2525        if ( $value == null ) {
  • appful-app/trunk/includes/api/handlers/AttachmentSyncRequestHandler.php

    r2907312 r3018629  
    2323
    2424    public function handle_request( PluginRequest $request ): PluginResponse {
    25         Logger::log( "Found handler for Appful request" );
     25        Logger::debug( "Found handler for Appful request" );
    2626
    2727        // Because there could be a huge amount of posts, increase the timeout to 10min
  • appful-app/trunk/includes/api/handlers/AuthenticateUserRequestHandler.php

    r2978062 r3018629  
    2424
    2525    public function handle_request( PluginRequest $request ): PluginResponse {
    26         Logger::log( "Found handler for Appful request" );
     26        Logger::debug( "Found handler for Appful request" );
    2727
    2828        $body_input = sanitize_text_field( file_get_contents( 'php://input' ) );
  • appful-app/trunk/includes/api/handlers/CategorySyncRequestHandler.php

    r2907312 r3018629  
    2323
    2424    public function handle_request( PluginRequest $request ): PluginResponse {
    25         Logger::log( "Found handler for Appful request" );
     25        Logger::debug( "Found handler for Appful request" );
    2626
    2727        // Because there could be a huge amount of posts, increase the timeout to 10min
  • appful-app/trunk/includes/api/handlers/ClearLogRequestHandler.php

    r2920040 r3018629  
    2121
    2222    public function handle_request( PluginRequest $request ): PluginResponse {
    23         Logger::log( "Found handler for Appful request" );
     23        Logger::debug( "Found handler for Appful request" );
    2424
    2525        $this->clear_logs_use_case->invoke();
  • appful-app/trunk/includes/api/handlers/CommentSyncRequestHandler.php

    r2907312 r3018629  
    2323
    2424    public function handle_request( PluginRequest $request ): PluginResponse {
    25         Logger::log( "Found handler for Appful request" );
     25        Logger::debug( "Found handler for Appful request" );
    2626
    2727        // Because there could be a huge amount of posts, increase the timeout to 10min
  • appful-app/trunk/includes/api/handlers/CreateCommentRequestHandler.php

    r2978062 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        $body_input = sanitize_text_field( file_get_contents( 'php://input' ) );
     
    3232        // required fields
    3333        if (!isset($data["username"], $data["email"], $data["content"], $data["post_id"])) {
    34             Logger::log( "Some parameters are missing" );
     34            Logger::error( "Some parameters for create comment are missing" );
    3535            return PluginResponse::plugin_response()->status( 400 );  // Bad Request
    3636        }
     
    4949        $comment = $this->create_comment_use_case->invoke( $request );
    5050        if ( $comment == null ) {
    51             Logger::log( "Creating comment failed" );
     51            Logger::error( "Creating comment failed" );
    5252            return PluginResponse::plugin_response()->status( 503 );
    5353        }
  • appful-app/trunk/includes/api/handlers/GetAttachmentsRequestHandler.php

    r2907312 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        // Because there could be a huge amount of posts, increase the timeout to 10min
     
    4242        );
    4343
    44         Logger::log( "Sending attachments for ids " . json_encode( $ids ) );
     44        Logger::debug( "Sending attachments for ids " . json_encode( $ids ) );
    4545
    4646        $attachments = $this->get_attachments_by_id_use_case->invoke( $ids );
  • appful-app/trunk/includes/api/handlers/GetCategoriesRequestHandler.php

    r2907312 r3018629  
    2323
    2424    public function handle_request( PluginRequest $request ): PluginResponse {
    25         Logger::log( "Found handler for Appful request" );
     25        Logger::debug( "Found handler for Appful request" );
    2626
    2727        // Because there could be a huge amount of posts, increase the timeout to 10min
     
    4040        );
    4141
    42         Logger::log( "Sending categories for ids " . json_encode( $ids ) );
     42        Logger::debug( "Sending categories for ids " . json_encode( $ids ) );
    4343
    4444        $categories = $this->get_categories_by_id_use_case->invoke( $ids );
  • appful-app/trunk/includes/api/handlers/GetCommentsRequestHandler.php

    r2907312 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        // Because there could be a huge amount of posts, increase the timeout to 10min
     
    4242        );
    4343
    44         Logger::log( "Sending comments for ids " . json_encode( $ids ) );
     44        Logger::debug( "Sending comments for ids " . json_encode( $ids ) );
    4545
    4646        $comments = $this->get_comments_by_id_use_case->invoke( $ids );
  • appful-app/trunk/includes/api/handlers/GetPageContentsRequestHandler.php

    r2971184 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        // Because there could be a huge amount of pages, increase the timeout to 10min
     
    4848        }
    4949
    50         Logger::log( "Sending page contents for ids " . json_encode( $ids ) . " for user " . $user_id );
     50        Logger::debug( "Sending page contents for ids " . json_encode( $ids ) . " for user " . $user_id );
    5151
    5252        $page_contents = $this->get_page_contents_by_id_use_case->invoke( $ids, $cleaned_user_id );
  • appful-app/trunk/includes/api/handlers/GetPagesRequestHandler.php

    r2971184 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        // Because there could be a huge amount of pages, increase the timeout to 10min
     
    4242        );
    4343
    44         Logger::log( "Sending pages for ids " . json_encode( $ids ) );
     44        Logger::debug( "Sending pages for ids " . json_encode( $ids ) );
    4545
    4646        $pages = $this->get_pages_by_id_use_case->invoke( $ids );
  • appful-app/trunk/includes/api/handlers/GetPostContentsRequestHandler.php

    r2907312 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        // Because there could be a huge amount of posts, increase the timeout to 10min
     
    4242        );
    4343
    44         Logger::log( "Sending post contents for ids " . json_encode( $ids ) );
     44        Logger::debug( "Sending post contents for ids " . json_encode( $ids ) );
    4545
    4646        $postContents = $this->get_post_contents_by_id_use_case->invoke( $ids );
  • appful-app/trunk/includes/api/handlers/GetPostsRequestHandler.php

    r2907312 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        // Because there could be a huge amount of posts, increase the timeout to 10min
     
    4242        );
    4343
    44         Logger::log( "Sending posts for ids " . json_encode( $ids ) );
     44        Logger::debug( "Sending posts for ids " . json_encode( $ids ) );
    4545
    4646        $posts = $this->get_posts_by_id_use_case->invoke( $ids );
  • appful-app/trunk/includes/api/handlers/GetRolesRequestHandler.php

    r2962811 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        // Because there could be a huge amount of roles, increase the timeout to 10min
     
    4242        );
    4343
    44         Logger::log( "Sending roles for ids " . json_encode( $ids ) );
     44        Logger::debug( "Sending roles for ids " . json_encode( $ids ) );
    4545
    4646        $roles = $this->get_roles_by_id_use_case->invoke( $ids );
  • appful-app/trunk/includes/api/handlers/GetTagsRequestHandler.php

    r2907312 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        // Because there could be a huge amount of posts, increase the timeout to 10min
     
    4242        );
    4343
    44         Logger::log( "Sending tags for ids " . json_encode( $ids ) );
     44        Logger::debug( "Sending tags for ids " . json_encode( $ids ) );
    4545
    4646        $tags = $this->get_tags_by_id_use_case->invoke( $ids );
  • appful-app/trunk/includes/api/handlers/GetUsersRequestHandler.php

    r2907312 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        // Because there could be a huge amount of users, increase the timeout to 10min
     
    4242        );
    4343
    44         Logger::log( "Sending users for ids " . json_encode( $ids ) );
     44        Logger::debug( "Sending users for ids " . json_encode( $ids ) );
    4545
    4646        $users = $this->get_users_by_id_use_case->invoke( $ids );
  • appful-app/trunk/includes/api/handlers/InfoRequestHandler.php

    r2978062 r3018629  
    2222
    2323    public function handle_request( PluginRequest $request ): PluginResponse {
    24         Logger::log( "Found handler for Appful request" );
     24        Logger::debug( "Found handler for Appful request" );
    2525
    2626        $blog_info     = $this->get_blog_info_use_case->invoke();
  • appful-app/trunk/includes/api/handlers/LogRequestHandler.php

    r2907312 r3018629  
    2121
    2222    public function handle_request( PluginRequest $request ): PluginResponse {
    23         Logger::log( "Found handler for Appful request" );
     23        Logger::debug( "Found handler for Appful request" );
    2424
    2525        $logs = $this->get_logs_use_case->invoke();
  • appful-app/trunk/includes/api/handlers/PageSyncRequestHandler.php

    r2971184 r3018629  
    2323
    2424    public function handle_request( PluginRequest $request ): PluginResponse {
    25         Logger::log( "Found handler for Appful request" );
     25        Logger::debug( "Found handler for Appful request" );
    2626
    2727        // Because there could be a huge amount of posts, increase the timeout to 10min
  • appful-app/trunk/includes/api/handlers/PostSyncRequestHandler.php

    r2907312 r3018629  
    2323
    2424    public function handle_request( PluginRequest $request ): PluginResponse {
    25         Logger::log( "Found handler for Appful request" );
     25        Logger::debug( "Found handler for Appful request" );
    2626
    2727        // Because there could be a huge amount of posts, increase the timeout to 10min
  • appful-app/trunk/includes/api/handlers/PullLocalPageContentRequestHandler.php

    r2971184 r3018629  
    2424
    2525    public function handle_request( PluginRequest $request ): PluginResponse {
    26         Logger::log( "Found handler for Appful request" );
     26        Logger::debug( "Found handler for Appful request" );
    2727
    2828        // Because there could be a huge amount of pages, increase the timeout to 10min
     
    4040        }
    4141
    42         Logger::log( "Sending local page content for id " . $cleaned_id . " for user " . $cleaned_user_id );
     42        Logger::debug( "Sending local page content for id " . $cleaned_id . " for user " . $cleaned_user_id );
    4343
    4444        $page_content = $this->get_local_page_content_by_id_use_case->invoke( $cleaned_id, $cleaned_user_id );
  • appful-app/trunk/includes/api/handlers/PullLocalPostContentRequestHandler.php

    r2920184 r3018629  
    2424
    2525    public function handle_request( PluginRequest $request ): PluginResponse {
    26         Logger::log( "Found handler for Appful request" );
     26        Logger::debug( "Found handler for Appful request" );
    2727
    2828        // Because there could be a huge amount of posts, increase the timeout to 10min
     
    3535        $cleanedId = absint( sanitize_text_field( $_GET['id'] ) );
    3636
    37         Logger::log( "Sending local post content for id " . $cleanedId );
     37        Logger::debug( "Sending local post content for id " . $cleanedId );
    3838
    3939        $post_content = $this->get_local_post_content_by_id_use_case->invoke( $cleanedId );
  • appful-app/trunk/includes/api/handlers/RoleSyncRequestHandler.php

    r2962811 r3018629  
    2323
    2424    public function handle_request( PluginRequest $request ): PluginResponse {
    25         Logger::log( "Found handler for Appful request" );
     25        Logger::debug( "Found handler for Appful request" );
    2626
    2727        // Because there could be a huge amount of roles, increase the timeout to 10min
  • appful-app/trunk/includes/api/handlers/SyncRequestHandler.php

    r2907312 r3018629  
    2323
    2424    public function handle_request( PluginRequest $request ): PluginResponse {
    25         Logger::log( "Found handler for Appful request" );
     25        Logger::debug( "Found handler for Appful request" );
    2626
    2727        $this->sync_all_use_case->invoke();
  • appful-app/trunk/includes/api/handlers/TagSyncRequestHandler.php

    r2907312 r3018629  
    2323
    2424    public function handle_request( PluginRequest $request ): PluginResponse {
    25         Logger::log( "Found handler for Appful request" );
     25        Logger::debug( "Found handler for Appful request" );
    2626
    2727        // Because there could be a huge amount of posts, increase the timeout to 10min
  • appful-app/trunk/includes/api/handlers/UserSyncRequestHandler.php

    r2907312 r3018629  
    2323
    2424    public function handle_request( PluginRequest $request ): PluginResponse {
    25         Logger::log( "Found handler for Appful request" );
     25        Logger::debug( "Found handler for Appful request" );
    2626
    2727        // Because there could be a huge amount of users, increase the timeout to 10min
  • appful-app/trunk/includes/api/handlers/page/GetPageContentRequestHandler.php

    r2978062 r3018629  
    2525
    2626    public function handle_request( PluginRequest $request ): PluginResponse {
    27         Logger::log( "Found handler for Appful request" );
     27        Logger::debug( "Found handler for Appful request" );
    2828
    2929        if ( ! isset( $_GET['id'] ) ) {
     
    3939        }
    4040
    41         Logger::log( "Sending page content for id " . json_encode( $cleaned_id ) . " for user " . $request_user_id );
     41        Logger::debug( "Sending page content for id " . json_encode( $cleaned_id ) . " for user " . $request_user_id );
    4242
    4343        $page_contents = $this->get_page_contents_by_id_use_case->invoke( [ $cleaned_id ], $cleaned_user_id );
  • appful-app/trunk/includes/api/mapper/SyncItemMapper.php

    r2907312 r3018629  
    1010        return new SyncItemDto(
    1111            $sync_item->get_id(),
    12             $sync_item->get_modified()
     12            $sync_item->get_modified(),
     13            $sync_item->get_force_update(),
    1314        );
    1415    }
  • appful-app/trunk/includes/custom_taxonomies/AppfulTaxonomies.php

    r2982658 r3018629  
    6363
    6464        if ( ! $push_term ) {
    65             Logger::log( "Adding initial appful push term" );
     65            Logger::debug( "Adding initial appful push term" );
    6666
    6767            $args = [
     
    8282
    8383        if ( $push_term ) {
    84             Logger::log( "Removing initial appful push term" );
     84            Logger::info( "Removing initial appful push term" );
    8585
    8686            wp_delete_term(
  • appful-app/trunk/includes/domain/SyncItem.php

    r2907312 r3018629  
    66    private int $id = - 1;
    77    private string $modified = "";
     8    private bool $force_update = false;
    89
    910    public static function syncItem(
    1011        int $id = - 1,
    11         string $modified = ""
     12        string $modified = "",
     13        bool $force_update = false,
    1214    ): SyncItem {
    1315        return ( new SyncItem() )
     
    2830    }
    2931
     32    public function force_update( bool $force_update ): SyncItem {
     33        $this->force_update = $force_update;
     34
     35        return $this;
     36    }
     37
    3038    public function get_id(): int {
    3139        return $this->id;
     
    3543        return $this->modified;
    3644    }
     45
     46    public function get_force_update(): bool {
     47        return $this->force_update;
     48    }
    3749}
  • appful-app/trunk/includes/helper/Logger.php

    r2920030 r3018629  
    44
    55class Logger {
    6     public static function log( $msg, $name = '' ) {
    7         if ( Constants::$APPFUL_DEBUG || ( isset( $_REQUEST["debug"] ) && $_REQUEST["debug"] == "1" ) ) {
     6    private static function log( string $msg, ?string $level = null, string $name = '' ) {
     7        $log_level = $level ?? LoggerLevel::$DEBUG;
     8
     9        if ( $log_level !== LoggerLevel::$DEBUG || ( Constants::$APPFUL_DEBUG || ( isset( $_REQUEST["debug"] ) && $_REQUEST["debug"] == "1" ) ) ) {
    810            $trace = debug_backtrace();
    911            $name  = ( '' == $name ) ? ( ( isset( $trace[1]['class'] ) ) ? $trace[1]['class'] : "Unknown" ) . "(" . $trace[1]['function'] . "):" . $trace[1]['line'] : $name;
    1012            $name  = str_pad( substr( $name, 0, 79 ), 80 );
    1113
     14            $log_level = str_pad( $log_level, 8 );
     15
    1216            $error_dir = self::getLogFile();
    1317            $msg       = print_r( $msg, true );
    1418            $date      = date( 'd-m-y h:i:s' );
    15             $log       = $date . " - " . $name . "  |  " . $msg . "\n";
     19            $log       = "[" . $log_level . "]" . "[" . $date . "]" . " - " . $name . "  |  " . $msg . "\n";
    1620            error_log( $log, 3, $error_dir );
    1721        }
     22    }
     23
     24    public static function debug( string $msg, string $name = '' ) {
     25        self::log( $msg, LoggerLevel::$DEBUG, $name );
     26    }
     27
     28    public static function info( string $msg, string $name = '' ) {
     29        self::log( $msg, LoggerLevel::$INFO, $name );
     30    }
     31
     32    public static function error( string $msg, string $name = '' ) {
     33        self::log( $msg, LoggerLevel::$ERROR, $name );
    1834    }
    1935
  • appful-app/trunk/includes/hooks/ActivationHook.php

    r2907312 r3018629  
    4040
    4141    private function on_activate() {
    42         Logger::log( "Plugin activated" );
     42        Logger::info( "Plugin activated" );
    4343
    4444        $this->taxonomy_manager->load_direct();
     
    4747
    4848    private function on_deactivate() {
    49         Logger::log( "Plugin deactivated" );
     49        Logger::info( "Plugin deactivated" );
    5050
    5151        $this->taxonomy_manager->load_direct();
  • appful-app/trunk/includes/hooks/AttachmentHook.php

    r2920030 r3018629  
    4444
    4545    private function on_save_attachment( int $attachment_id ) {
    46         Logger::log( "Attachment with id " . $attachment_id . " saved!" );
     46        Logger::debug( "Attachment with id " . $attachment_id . " saved!" );
    4747
    4848        $attachment_post = get_post( $attachment_id );
     
    5454
    5555    private function on_delete_attachment( int $attachment_id ) {
    56         Logger::log( "Attachment with id " . $attachment_id . " deleted!" );
     56        Logger::debug( "Attachment with id " . $attachment_id . " deleted!" );
    5757
    5858        $this->use_case_manager->attachment_delete_use_case()->invoke( $attachment_id );
  • appful-app/trunk/includes/hooks/CommentHook.php

    r2907312 r3018629  
    5454
    5555    private function on_comment_transition( string $new_status, ?string $old_status, WP_Comment $comment ) {
    56         Logger::log( "Comment transitioned from " . ( $old_status == null ? "null" : $old_status ) . " to " . $new_status . ": " . json_encode( $comment ) );
     56        Logger::debug( "Comment transitioned from " . ( $old_status == null ? "null" : $old_status ) . " to " . $new_status . ": " . json_encode( $comment ) );
    5757        $domain_comment = CommentMapper::to_domain( $comment );
    5858        $this->use_case_manager->comment_save_use_case()->invoke( $domain_comment );
     
    7272
    7373    private function on_delete_comment( string $comment_id ) {
    74         Logger::log( "Comment with id " . $comment_id . " deleted!" );
     74        Logger::debug( "Comment with id " . $comment_id . " deleted!" );
    7575
    7676        $this->use_case_manager->comment_delete_use_case()->invoke( $comment_id );
  • appful-app/trunk/includes/hooks/PageHook.php

    r2971184 r3018629  
    4040        }
    4141
    42         Logger::log( "Page with id " . $page->ID . " deleted!" );
     42        Logger::debug( "Page with id " . $page->ID . " deleted!" );
    4343
    4444        $this->use_case_manager->page_delete_use_case()->invoke( $page_id );
     
    5858        }
    5959
    60         Logger::log( "Page with id " . $page->ID . " inserted with status " . $page->post_status . "!" );
     60        Logger::debug( "Page with id " . $page->ID . " inserted with status " . $page->post_status . "!" );
    6161
    6262        $domain_page = PageMapper::to_domain( $page );
  • appful-app/trunk/includes/hooks/PostHook.php

    r2932187 r3018629  
    1818        add_action(
    1919            "wp_after_insert_post",
    20             function ( int $post_id, WP_Post $post ) {
    21                 $this->after_save_post( $post );
     20            function ( int $post_id, WP_Post $post, bool $update, ?WP_Post $post_before ) {
     21                $this->after_save_post( $post, $post_before );
    2222            },
    2323            99,
    24             2,
     24            4,
    2525        );
    2626
     
    4040        }
    4141
    42         Logger::log( "Post with id " . $post->ID . " deleted!" );
     42        Logger::debug( "Post with id " . $post->ID . " deleted!" );
    4343
    4444        $this->use_case_manager->post_delete_use_case()->invoke( $post_id );
    4545    }
    4646
    47     private function after_save_post( WP_Post $post ) {
     47    private function after_save_post( WP_Post $post, ?WP_Post $post_before ) {
    4848        if ( defined( "DOING_AUTOSAVE" ) && DOING_AUTOSAVE ) {
    4949            return;
     
    5858        }
    5959
    60         Logger::log( "Post with id " . $post->ID . " inserted with status " . $post->post_status . "!" );
     60        Logger::debug( "Post with id " . $post->ID . " inserted with status " . $post->post_status . "!" );
    6161
    62         $domain_post = PostMapper::to_domain( $post );
     62        $domain_post = PostMapper::to_sync_item( $post, $post->post_status != $post_before->post_status );
    6363        $this->use_case_manager->post_save_use_case()->invoke( $domain_post );
    6464    }
  • appful-app/trunk/includes/hooks/SessionHook.php

    r2936340 r3018629  
    3535
    3636    private function on_appful_login() {
    37         Logger::log( "Logging in user!" );
     37        Logger::info( "Logging in user!" );
    3838
    3939        WPOptionsManager::delete_last_sync_error();
     
    4242            $this->use_case_manager->sync_all_use_case()->invoke();
    4343        } else {
    44             Logger::log( "Error occurred when registering blog!" );
     44            Logger::error( "Error occurred when registering blog!" );
    4545            $this->clean_on_error();
    4646        }
     
    5656
    5757    private function on_appful_logout() {
    58         Logger::log( "Logging out user!" );
     58        Logger::info( "Logging out user!" );
    5959        if ( $this->use_case_manager->is_logged_in_use_case()->invoke() ) {
    6060            $this->use_case_manager->delete_session_use_case()->invoke();
  • appful-app/trunk/includes/hooks/TaxonomyHook.php

    r2907312 r3018629  
    5555    private function on_saved_category( int $term_id, int $taxonomy_id ) {
    5656        $category = get_term( $term_id );
    57         Logger::log( "Category with id " . $term_id . " saved!" );
     57        Logger::debug( "Category with id " . $term_id . " saved!" );
    5858
    5959        $domain_category = CategoryMapper::to_domain( $category );
     
    6262
    6363    private function on_delete_category( int $term_id, int $taxonomy_id ) {
    64         Logger::log( "Category with id " . $term_id . " deleted!" );
     64        Logger::debug( "Category with id " . $term_id . " deleted!" );
    6565
    6666        $this->use_case_manager->category_delete_use_case()->invoke( $term_id );
     
    6969    private function on_saved_tag( int $term_id, int $taxonomy_id ) {
    7070        $tag = get_term( $term_id );
    71         Logger::log( "Tag with id " . $term_id . " saved!" );
     71        Logger::debug( "Tag with id " . $term_id . " saved!" );
    7272
    7373        $domain_tag = TagMapper::to_domain( $tag );
     
    7676
    7777    private function on_delete_tag( int $term_id, int $taxonomy_id ) {
    78         Logger::log( "Tag with id " . $term_id . " deleted!" );
     78        Logger::debug( "Tag with id " . $term_id . " deleted!" );
    7979
    8080        $this->use_case_manager->tag_delete_use_case()->invoke( $term_id );
  • appful-app/trunk/includes/hooks/UserHook.php

    r2982658 r3018629  
    5353
    5454    private function on_save_user( int $user_id ) {
    55         Logger::log( "User with id " . $user_id . " saved!" );
     55        Logger::debug( "User with id " . $user_id . " saved!" );
    5656
    5757        $wp_user = WPUserManager::get_user_by_id( $user_id );
     
    6262
    6363    private function on_delete_user( int $user_id ) {
    64         Logger::log( "User with id " . $user_id . " deleted!" );
     64        Logger::debug( "User with id " . $user_id . " deleted!" );
    6565
    6666        $this->use_case_manager->user_delete_use_case()->invoke( $user_id );
  • appful-app/trunk/includes/use_cases/AttachmentDeleteUseCase.php

    r2920184 r3018629  
    1616
    1717    public function invoke( string $attachment_id ) {
    18         Logger::log( "Sending attachment delete request for: " . $attachment_id );
     18        Logger::debug( "Sending attachment delete request for: " . $attachment_id );
    1919        $request = HttpRequest::backend_request()->method( "DELETE" )->path( Constants::$ATTACHMENT_PATH . "/" . $attachment_id );
    2020        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/AttachmentSaveUseCase.php

    r2920184 r3018629  
    1919    public function invoke( Attachment $attachment ) {
    2020        $attachment_dto = AttachmentMapper::to_dto( $attachment );
    21         Logger::log( "Sending attachment save request with data: " . json_encode( $attachment_dto ) );
     21        Logger::debug( "Sending attachment save request with data: " . json_encode( $attachment_dto ) );
    2222        $request = HttpRequest::backend_request()->method( "POST" )->body( $attachment_dto )->path( Constants::$ATTACHMENT_PATH );
    2323        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/CategoryDeleteUseCase.php

    r2920184 r3018629  
    1616
    1717    public function invoke( int $term_id ) {
    18         Logger::log( "Sending category delete request for: " . $term_id );
     18        Logger::debug( "Sending category delete request for: " . $term_id );
    1919        $request = HttpRequest::backend_request()->method( "DELETE" )->path( Constants::$TAXONOMY_PATH . "/categories/" . $term_id );
    2020        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/CategorySaveUseCase.php

    r2920184 r3018629  
    1919    public function invoke( Category $category ) {
    2020        $category_dto = CategoryMapper::to_dto( $category );
    21         Logger::log( "Sending category save request with data: " . json_encode( $category_dto ) );
     21        Logger::debug( "Sending category save request with data: " . json_encode( $category_dto ) );
    2222        $request = HttpRequest::backend_request()->method( "POST" )->body( $category_dto )->path( Constants::$TAXONOMY_PATH . "/categories" );
    2323        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/CommentDeleteUseCase.php

    r2920184 r3018629  
    1616
    1717    public function invoke( string $comment_id ) {
    18         Logger::log( "Sending comment delete request for: " . $comment_id );
     18        Logger::debug( "Sending comment delete request for: " . $comment_id );
    1919        $request = HttpRequest::backend_request()->method( "DELETE" )->path( Constants::$COMMENT_PATH . "/" . $comment_id );
    2020        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/CommentSaveUseCase.php

    r2920184 r3018629  
    1919    public function invoke( Comment $comment ) {
    2020        $comment_dto = CommentMapper::to_dto( $comment );
    21         Logger::log( "Sending comment save request with data: " . json_encode( $comment_dto ) );
     21        Logger::debug( "Sending comment save request with data: " . json_encode( $comment_dto ) );
    2222        $request = HttpRequest::backend_request()->method( "POST" )->body( $comment_dto )->path( Constants::$COMMENT_PATH );
    2323        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/DeleteSessionUseCase.php

    r2936340 r3018629  
    1616
    1717    public function invoke() {
    18         Logger::log( "Unregistering blog!" );
     18        Logger::info( "Unregistering blog!" );
    1919        $request = HttpRequest::backend_request()->method( "DELETE" )->path( Constants::$BLOG_PATH );
    2020        $this->backend_client->send_request( $request, false );
  • appful-app/trunk/includes/use_cases/LogoutUserUseCase.php

    r2936340 r3018629  
    1616
    1717    public function invoke() {
    18         Logger::log( "Logout user!" );
     18        Logger::info( "Logout user!" );
    1919        $request = HttpRequest::backend_request()->method( "DELETE" )->path( Constants::$APPFUL_USER_PATH . "/logout" );
    2020        $this->backend_client->send_request( $request, false );
  • appful-app/trunk/includes/use_cases/PageDeleteUseCase.php

    r2971184 r3018629  
    1616
    1717    public function invoke( int $page_id ) {
    18         Logger::log( "Sending page delete request for: " . $page_id );
     18        Logger::debug( "Sending page delete request for: " . $page_id );
    1919        $request = HttpRequest::backend_request()->method( "DELETE" )->path( Constants::$PAGE_PATH . "/" . $page_id );
    2020        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/PageSaveUseCase.php

    r2971184 r3018629  
    1919    public function invoke( Page $page ) {
    2020        $page_dto = PageMapper::to_dto( $page );
    21         Logger::log( "Sending page save request with data: " . json_encode( $page_dto ) );
     21        Logger::debug( "Sending page save request with data: " . json_encode( $page_dto ) );
    2222        $request = HttpRequest::backend_request()->method( "POST" )->body( $page_dto )->path( Constants::$PAGE_PATH );
    2323        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/PostDeleteUseCase.php

    r2920184 r3018629  
    1616
    1717    public function invoke( int $post_id ) {
    18         Logger::log( "Sending post delete request for: " . $post_id );
     18        Logger::debug( "Sending post delete request for: " . $post_id );
    1919        $request = HttpRequest::backend_request()->method( "DELETE" )->path( Constants::$POST_PATH . "/" . $post_id );
    2020        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/PostSaveUseCase.php

    r2920184 r3018629  
    44
    55use AppfulPlugin\Api\Client\BackendClient;
    6 use AppfulPlugin\Api\Mapper\PostMapper;
     6use AppfulPlugin\Api\Mapper\SyncItemMapper;
    77use AppfulPlugin\Api\Requests\HttpRequest;
    8 use AppfulPlugin\Domain\Post;
     8use AppfulPlugin\Domain\SyncItem;
    99use AppfulPlugin\Helper\Constants;
    1010use AppfulPlugin\Helper\Logger;
     
    1717    }
    1818
    19     public function invoke( Post $post ) {
    20         $post_dto = PostMapper::to_dto( $post );
    21         Logger::log( "Sending post save request with data: " . json_encode( $post_dto ) );
     19    public function invoke( SyncItem $post ) {
     20        $post_dto = SyncItemMapper::to_dto( $post );
     21        Logger::debug( "Sending post save request with data: " . json_encode( $post_dto ) );
    2222        $request = HttpRequest::backend_request()->method( "POST" )->body( $post_dto )->path( Constants::$POST_PATH );
    2323        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/PullLocalPostContentUseCase.php

    r2971184 r3018629  
    1717
    1818    public function invoke( int $id ): ?PostContent {
    19         Logger::log( "Pulling local post content for id: " . $id );
     19        Logger::debug( "Pulling local post content for id: " . $id );
    2020
    2121        $request_params = [];
  • appful-app/trunk/includes/use_cases/RegisterBlogUseCase.php

    r2936340 r3018629  
    2222        $blog_info_dto = BlogInfoMapper::to_dto( $blog_info );
    2323
    24         Logger::log( "Registering blog with data: " . json_encode( $blog_info_dto ) );
     24        Logger::info( "Registering blog with data: " . json_encode( $blog_info_dto ) );
    2525
    2626        $request  = HttpRequest::backend_request()->method( "POST" )->body( $blog_info_dto )->path( Constants::$BLOG_PATH );
  • appful-app/trunk/includes/use_cases/SendAttachmentChunkSyncUseCase.php

    r2920184 r3018629  
    2020        $sync_item_dtos = SyncChunkMapper::to_dto( $sync_items );
    2121
    22         Logger::log( "Sending attachment chunk to sync: " . json_encode( $sync_item_dtos ) );
     22        Logger::debug( "Sending attachment chunk to sync: " . json_encode( $sync_item_dtos ) );
    2323        $request = HttpRequest::backend_request()->method( "PATCH" )->body( $sync_item_dtos )->path( Constants::$ATTACHMENT_PATH . "/sync" );
    2424        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/SendCategoryChunkSyncUseCase.php

    r2920184 r3018629  
    2020        $sync_item_dtos = SyncChunkMapper::to_dto( $sync_items );
    2121
    22         Logger::log( "Sending category chunk to sync: " . json_encode( $sync_item_dtos ) );
     22        Logger::debug( "Sending category chunk to sync: " . json_encode( $sync_item_dtos ) );
    2323        $request = HttpRequest::backend_request()->method( "PATCH" )->body( $sync_item_dtos )->path( Constants::$TAXONOMY_PATH . "/categories/sync" );
    2424        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/SendCommentChunkSyncUseCase.php

    r2920184 r3018629  
    2020        $sync_item_dtos = SyncChunkMapper::to_dto( $sync_items );
    2121
    22         Logger::log( "Sending comment chunk to sync: " . json_encode( $sync_item_dtos ) );
     22        Logger::debug( "Sending comment chunk to sync: " . json_encode( $sync_item_dtos ) );
    2323        $request = HttpRequest::backend_request()->method( "PATCH" )->body( $sync_item_dtos )->path( Constants::$COMMENT_PATH . "/sync" );
    2424        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/SendPageChunkSyncUseCase.php

    r2971184 r3018629  
    2020        $sync_item_dtos = SyncChunkMapper::to_dto( $sync_items );
    2121
    22         Logger::log( "Sending page chunk to sync: " . json_encode( $sync_item_dtos ) );
     22        Logger::debug( "Sending page chunk to sync: " . json_encode( $sync_item_dtos ) );
    2323        $request = HttpRequest::backend_request()->method( "PATCH" )->body( $sync_item_dtos )->path( Constants::$PAGE_PATH . "/sync" );
    2424        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/SendPostChunkSyncUseCase.php

    r2920184 r3018629  
    2222        $sync_item_dtos = SyncChunkMapper::to_dto($sync_items);
    2323
    24         Logger::log( "Sending post chunk to sync: " . json_encode( $sync_item_dtos ) );
     24        Logger::debug( "Sending post chunk to sync: " . json_encode( $sync_item_dtos ) );
    2525        $request = HttpRequest::backend_request()->method( "PATCH" )->body( $sync_item_dtos )->path( Constants::$POST_PATH . "/sync" );
    2626        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/SendRoleChunkSyncUseCase.php

    r2962811 r3018629  
    2020        $sync_item_dtos = SyncChunkMapper::to_dto( $sync_items );
    2121
    22         Logger::log( "Sending role chunk to sync: " . json_encode( $sync_item_dtos ) );
     22        Logger::debug( "Sending role chunk to sync: " . json_encode( $sync_item_dtos ) );
    2323        $request = HttpRequest::backend_request()->method( "PATCH" )->body( $sync_item_dtos )->path( Constants::$ROLE_PATH . "/sync" );
    2424        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/SendTagChunkSyncUseCase.php

    r2920184 r3018629  
    2020        $sync_item_dtos = SyncChunkMapper::to_dto( $sync_items );
    2121
    22         Logger::log( "Sending tag chunk to sync: " . json_encode( $sync_item_dtos ) );
     22        Logger::debug( "Sending tag chunk to sync: " . json_encode( $sync_item_dtos ) );
    2323        $request = HttpRequest::backend_request()->method( "PATCH" )->body( $sync_item_dtos )->path( Constants::$TAXONOMY_PATH . "/tags/sync" );
    2424        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/SendUserChunkSyncUseCase.php

    r2920184 r3018629  
    2020        $sync_item_dtos = SyncChunkMapper::to_dto( $sync_items );
    2121
    22         Logger::log( "Sending user chunk to sync: " . json_encode( $sync_item_dtos ) );
     22        Logger::debug( "Sending user chunk to sync: " . json_encode( $sync_item_dtos ) );
    2323        $request = HttpRequest::backend_request()->method( "PATCH" )->body( $sync_item_dtos )->path( Constants::$USER_PATH . "/sync" );
    2424        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/TagDeleteUseCase.php

    r2920184 r3018629  
    1616
    1717    public function invoke( int $term_id ) {
    18         Logger::log( "Sending tag delete request for: " . $term_id );
     18        Logger::debug( "Sending tag delete request for: " . $term_id );
    1919        $request = HttpRequest::backend_request()->method( "DELETE" )->path( Constants::$TAXONOMY_PATH . "/tags/" . $term_id );
    2020        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/TagSaveUseCase.php

    r2920184 r3018629  
    1919    public function invoke( Tag $tag ) {
    2020        $tag_dto = TagMapper::to_dto( $tag );
    21         Logger::log( "Sending tag save request with data: " . json_encode( $tag_dto ) );
     21        Logger::debug( "Sending tag save request with data: " . json_encode( $tag_dto ) );
    2222        $request = HttpRequest::backend_request()->method( "POST" )->body( $tag_dto )->path( Constants::$TAXONOMY_PATH . "/tags" );
    2323        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/UserDeleteUseCase.php

    r2920184 r3018629  
    1616
    1717    public function invoke( string $user_id ) {
    18         Logger::log( "Sending user delete request for: " . $user_id );
     18        Logger::debug( "Sending user delete request for: " . $user_id );
    1919        $request = HttpRequest::backend_request()->method( "DELETE" )->path( Constants::$USER_PATH . "/" . $user_id );
    2020        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/UserSaveUseCase.php

    r2920184 r3018629  
    1919    public function invoke( User $user ) {
    2020        $user_dto = UserMapper::to_dto( $user );
    21         Logger::log( "Sending user save request with data: " . json_encode( $user_dto ) );
     21        Logger::debug( "Sending user save request with data: " . json_encode( $user_dto ) );
    2222        $request = HttpRequest::backend_request()->method( "POST" )->body( $user_dto )->path( Constants::$USER_PATH );
    2323        $this->backend_client->send_request( $request );
  • appful-app/trunk/includes/use_cases/page/PullLocalPageContentUseCase.php

    r2971184 r3018629  
    1717
    1818    public function invoke( int $id, ?int $user_id = null ): ?PageContent {
    19         Logger::log( "Pulling local page content for id " . $id . " for user " . $user_id );
     19        Logger::debug( "Pulling local page content for id " . $id . " for user " . $user_id );
    2020
    2121        $request_params = [];
  • appful-app/trunk/includes/wp/WPCommentManager.php

    r2954441 r3018629  
    6464
    6565        if ($commentId === false) {
    66             Logger::log( "Insert comment failed" );
     66            Logger::error( "Insert comment failed" );
    6767            return null;
    6868        }
    69         Logger::log( "Inserted comment!" );
    7069
    7170        $comment = get_comment($commentId);
    7271
    7372        if (!$comment instanceof WP_Comment) {
    74             Logger::log( "Getting comment failed!" );
     73            Logger::error( "Getting comment failed!" );
    7574            return null;
    7675        }
  • appful-app/trunk/includes/wp/mapper/PostMapper.php

    r2962811 r3018629  
    44
    55use AppfulPlugin\Domain\Post;
     6use AppfulPlugin\Domain\SyncItem;
    67use AppfulPlugin\Helper\DateParser;
    78use AppfulPlugin\Wp\WPAttachmentManager;
     
    3536                   ->roles( WPRoleManager::get_roles_for_post_id( $post->ID ) );
    3637    }
     38
     39    public static function to_sync_item( WP_Post $post, bool $force_update ): SyncItem {
     40        return SyncItem::syncItem()
     41                       ->id( $post->ID )
     42                       ->modified( DateParser::fromGmtDate( $post->post_modified_gmt ) )
     43                       ->force_update( $force_update );
     44    }
    3745}
  • appful-app/trunk/lib/vendor/composer/autoload_classmap.php

    r2978062 r3018629  
    101101    'AppfulPlugin\\Helper\\DateParser' => $baseDir . '/../includes/helper/DateParser.php',
    102102    'AppfulPlugin\\Helper\\Logger' => $baseDir . '/../includes/helper/Logger.php',
     103    'AppfulPlugin\\Helper\\LoggerLevel' => $baseDir . '/../includes/helper/LoggerLevel.php',
    103104    'AppfulPlugin\\Helper\\TemplateLoader' => $baseDir . '/../includes/helper/TemplateLoader.php',
    104105    'AppfulPlugin\\Hooks\\ActivationHook' => $baseDir . '/../includes/hooks/ActivationHook.php',
  • appful-app/trunk/lib/vendor/composer/autoload_static.php

    r2978062 r3018629  
    278278        'AppfulPlugin\\Helper\\DateParser' => __DIR__ . '/../..' . '/../includes/helper/DateParser.php',
    279279        'AppfulPlugin\\Helper\\Logger' => __DIR__ . '/../..' . '/../includes/helper/Logger.php',
     280        'AppfulPlugin\\Helper\\LoggerLevel' => __DIR__ . '/../..' . '/../includes/helper/LoggerLevel.php',
    280281        'AppfulPlugin\\Helper\\TemplateLoader' => __DIR__ . '/../..' . '/../includes/helper/TemplateLoader.php',
    281282        'AppfulPlugin\\Hooks\\ActivationHook' => __DIR__ . '/../..' . '/../includes/hooks/ActivationHook.php',
  • appful-app/trunk/lib/vendor/composer/installed.php

    r2978062 r3018629  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => '2ba6b06d04004a7d391027374cc785e0853d4186',
     6        'reference' => 'd550503fb49e89e7e02f5f243b50014e609439b5',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-main',
    1515            'version' => 'dev-main',
    16             'reference' => '2ba6b06d04004a7d391027374cc785e0853d4186',
     16            'reference' => 'd550503fb49e89e7e02f5f243b50014e609439b5',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
  • appful-app/trunk/readme.txt

    r2982658 r3018629  
    44Donate link: https://appful.io
    55Requires at least: 5.8
    6 Tested up to: 6.3
     6Tested up to: 6.4
    77Requires PHP: 7.4
    8 Stable tag: 3.1.15
     8Stable tag: 3.1.16
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.