Changeset 2954441
- Timestamp:
- 08/16/2023 01:32:28 PM (3 years ago)
- Location:
- appful-app
- Files:
-
- 6 added
- 3 deleted
- 10 edited
- 75 copied
-
tags/3.1.8 (copied) (copied from appful-app/trunk)
-
tags/3.1.8/appful-app.php (copied) (copied from appful-app/trunk/appful-app.php) (1 diff)
-
tags/3.1.8/appful.log (copied) (copied from appful-app/trunk/appful.log)
-
tags/3.1.8/frontend/scripts/user.js (copied) (copied from appful-app/trunk/frontend/scripts/user.js)
-
tags/3.1.8/frontend/styles/style.css (copied) (copied from appful-app/trunk/frontend/styles/style.css)
-
tags/3.1.8/frontend/templates/appful_menu_page.html.twig (copied) (copied from appful-app/trunk/frontend/templates/appful_menu_page.html.twig)
-
tags/3.1.8/includes/api/Api.php (copied) (copied from appful-app/trunk/includes/api/Api.php) (1 diff)
-
tags/3.1.8/includes/api/Endpoints.php (copied) (copied from appful-app/trunk/includes/api/Endpoints.php)
-
tags/3.1.8/includes/api/ReqHandler.php (copied) (copied from appful-app/trunk/includes/api/ReqHandler.php) (2 diffs)
-
tags/3.1.8/includes/api/Rewrites.php (copied) (copied from appful-app/trunk/includes/api/Rewrites.php)
-
tags/3.1.8/includes/api/client/BackendClient.php (copied) (copied from appful-app/trunk/includes/api/client/BackendClient.php)
-
tags/3.1.8/includes/api/client/SelfClient.php (copied) (copied from appful-app/trunk/includes/api/client/SelfClient.php)
-
tags/3.1.8/includes/api/dtos/BlogHooksDto.php (copied) (copied from appful-app/trunk/includes/api/dtos/BlogHooksDto.php)
-
tags/3.1.8/includes/api/dtos/BlogInfoDto.php (copied) (copied from appful-app/trunk/includes/api/dtos/BlogInfoDto.php)
-
tags/3.1.8/includes/api/handlers/AuthenticateUserRequestHandler.php (copied) (copied from appful-app/trunk/includes/api/handlers/AuthenticateUserRequestHandler.php)
-
tags/3.1.8/includes/api/handlers/ClearLogRequestHandler.php (copied) (copied from appful-app/trunk/includes/api/handlers/ClearLogRequestHandler.php)
-
tags/3.1.8/includes/api/handlers/CreateCommentRequestHandler.php (added)
-
tags/3.1.8/includes/api/handlers/PullLocalPostContentRequestHandler.php (copied) (copied from appful-app/trunk/includes/api/handlers/PullLocalPostContentRequestHandler.php)
-
tags/3.1.8/includes/api/mapper/BlogHooksMapper.php (copied) (copied from appful-app/trunk/includes/api/mapper/BlogHooksMapper.php)
-
tags/3.1.8/includes/api/mapper/BlogInfoMapper.php (copied) (copied from appful-app/trunk/includes/api/mapper/BlogInfoMapper.php)
-
tags/3.1.8/includes/api/reponses/BackendResponse.php (deleted)
-
tags/3.1.8/includes/api/reponses/HttpResponse.php (copied) (copied from appful-app/trunk/includes/api/reponses/HttpResponse.php)
-
tags/3.1.8/includes/api/requests/BackendRequest.php (deleted)
-
tags/3.1.8/includes/api/requests/HttpRequest.php (copied) (copied from appful-app/trunk/includes/api/requests/HttpRequest.php)
-
tags/3.1.8/includes/domain/AuthenticateRequest.php (copied) (copied from appful-app/trunk/includes/domain/AuthenticateRequest.php)
-
tags/3.1.8/includes/domain/BlogHooks.php (copied) (copied from appful-app/trunk/includes/domain/BlogHooks.php)
-
tags/3.1.8/includes/domain/BlogInfo.php (copied) (copied from appful-app/trunk/includes/domain/BlogInfo.php)
-
tags/3.1.8/includes/domain/CreateCommentRequest.php (added)
-
tags/3.1.8/includes/helper/ClientTokenManager.php (copied) (copied from appful-app/trunk/includes/helper/ClientTokenManager.php)
-
tags/3.1.8/includes/helper/Constants.php (copied) (copied from appful-app/trunk/includes/helper/Constants.php)
-
tags/3.1.8/includes/helper/Logger.php (copied) (copied from appful-app/trunk/includes/helper/Logger.php)
-
tags/3.1.8/includes/hooks/AttachmentHook.php (copied) (copied from appful-app/trunk/includes/hooks/AttachmentHook.php)
-
tags/3.1.8/includes/hooks/PostHook.php (copied) (copied from appful-app/trunk/includes/hooks/PostHook.php)
-
tags/3.1.8/includes/hooks/SessionHook.php (copied) (copied from appful-app/trunk/includes/hooks/SessionHook.php)
-
tags/3.1.8/includes/hooks/UserHook.php (copied) (copied from appful-app/trunk/includes/hooks/UserHook.php)
-
tags/3.1.8/includes/main/AppfulPlugin.php (copied) (copied from appful-app/trunk/includes/main/AppfulPlugin.php)
-
tags/3.1.8/includes/menu/Menu.php (copied) (copied from appful-app/trunk/includes/menu/Menu.php)
-
tags/3.1.8/includes/use_cases/AttachmentDeleteUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/AttachmentDeleteUseCase.php)
-
tags/3.1.8/includes/use_cases/AttachmentSaveUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/AttachmentSaveUseCase.php)
-
tags/3.1.8/includes/use_cases/AuthenticateUserUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/AuthenticateUserUseCase.php)
-
tags/3.1.8/includes/use_cases/CategoryDeleteUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/CategoryDeleteUseCase.php)
-
tags/3.1.8/includes/use_cases/CategorySaveUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/CategorySaveUseCase.php)
-
tags/3.1.8/includes/use_cases/ClearLogsUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/ClearLogsUseCase.php)
-
tags/3.1.8/includes/use_cases/CommentDeleteUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/CommentDeleteUseCase.php)
-
tags/3.1.8/includes/use_cases/CommentSaveUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/CommentSaveUseCase.php)
-
tags/3.1.8/includes/use_cases/CreateCommentUseCase.php (added)
-
tags/3.1.8/includes/use_cases/DeleteSessionUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/DeleteSessionUseCase.php)
-
tags/3.1.8/includes/use_cases/GetLocalPostContentByIdUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/GetLocalPostContentByIdUseCase.php)
-
tags/3.1.8/includes/use_cases/GetPostContentsByIdUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/GetPostContentsByIdUseCase.php)
-
tags/3.1.8/includes/use_cases/IsLoggedInUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/IsLoggedInUseCase.php)
-
tags/3.1.8/includes/use_cases/LogoutUserUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/LogoutUserUseCase.php)
-
tags/3.1.8/includes/use_cases/PostDeleteUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/PostDeleteUseCase.php)
-
tags/3.1.8/includes/use_cases/PostSaveUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/PostSaveUseCase.php)
-
tags/3.1.8/includes/use_cases/PullLocalPostContentUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/PullLocalPostContentUseCase.php)
-
tags/3.1.8/includes/use_cases/RegisterBlogUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/RegisterBlogUseCase.php)
-
tags/3.1.8/includes/use_cases/SendAttachmentChunkSyncUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/SendAttachmentChunkSyncUseCase.php)
-
tags/3.1.8/includes/use_cases/SendCategoryChunkSyncUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/SendCategoryChunkSyncUseCase.php)
-
tags/3.1.8/includes/use_cases/SendCommentChunkSyncUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/SendCommentChunkSyncUseCase.php)
-
tags/3.1.8/includes/use_cases/SendPostChunkSyncUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/SendPostChunkSyncUseCase.php)
-
tags/3.1.8/includes/use_cases/SendTagChunkSyncUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/SendTagChunkSyncUseCase.php)
-
tags/3.1.8/includes/use_cases/SendUserChunkSyncUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/SendUserChunkSyncUseCase.php)
-
tags/3.1.8/includes/use_cases/SyncAllUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/SyncAllUseCase.php)
-
tags/3.1.8/includes/use_cases/TagDeleteUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/TagDeleteUseCase.php)
-
tags/3.1.8/includes/use_cases/TagSaveUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/TagSaveUseCase.php)
-
tags/3.1.8/includes/use_cases/UseCaseManager.php (copied) (copied from appful-app/trunk/includes/use_cases/UseCaseManager.php) (3 diffs)
-
tags/3.1.8/includes/use_cases/UserDeleteUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/UserDeleteUseCase.php)
-
tags/3.1.8/includes/use_cases/UserSaveUseCase.php (copied) (copied from appful-app/trunk/includes/use_cases/UserSaveUseCase.php)
-
tags/3.1.8/includes/wp/WPBlogManager.php (copied) (copied from appful-app/trunk/includes/wp/WPBlogManager.php)
-
tags/3.1.8/includes/wp/WPCommentManager.php (modified) (2 diffs)
-
tags/3.1.8/includes/wp/WPOptionsManager.php (copied) (copied from appful-app/trunk/includes/wp/WPOptionsManager.php)
-
tags/3.1.8/includes/wp/WPPostManager.php (copied) (copied from appful-app/trunk/includes/wp/WPPostManager.php)
-
tags/3.1.8/includes/wp/WPUserManager.php (copied) (copied from appful-app/trunk/includes/wp/WPUserManager.php)
-
tags/3.1.8/includes/wp/mapper/UserMapper.php (copied) (copied from appful-app/trunk/includes/wp/mapper/UserMapper.php)
-
tags/3.1.8/lib/.gitignore (deleted)
-
tags/3.1.8/lib/vendor/autoload.php (copied) (copied from appful-app/trunk/lib/vendor/autoload.php)
-
tags/3.1.8/lib/vendor/composer/ClassLoader.php (copied) (copied from appful-app/trunk/lib/vendor/composer/ClassLoader.php)
-
tags/3.1.8/lib/vendor/composer/autoload_classmap.php (copied) (copied from appful-app/trunk/lib/vendor/composer/autoload_classmap.php) (3 diffs)
-
tags/3.1.8/lib/vendor/composer/autoload_psr4.php (copied) (copied from appful-app/trunk/lib/vendor/composer/autoload_psr4.php)
-
tags/3.1.8/lib/vendor/composer/autoload_real.php (copied) (copied from appful-app/trunk/lib/vendor/composer/autoload_real.php)
-
tags/3.1.8/lib/vendor/composer/autoload_static.php (copied) (copied from appful-app/trunk/lib/vendor/composer/autoload_static.php) (3 diffs)
-
tags/3.1.8/lib/vendor/composer/installed.php (copied) (copied from appful-app/trunk/lib/vendor/composer/installed.php) (2 diffs)
-
tags/3.1.8/readme.txt (copied) (copied from appful-app/trunk/readme.txt) (1 diff)
-
trunk/appful-app.php (modified) (1 diff)
-
trunk/includes/api/Api.php (modified) (1 diff)
-
trunk/includes/api/ReqHandler.php (modified) (2 diffs)
-
trunk/includes/api/handlers/CreateCommentRequestHandler.php (added)
-
trunk/includes/domain/CreateCommentRequest.php (added)
-
trunk/includes/use_cases/CreateCommentUseCase.php (added)
-
trunk/includes/use_cases/UseCaseManager.php (modified) (3 diffs)
-
trunk/includes/wp/WPCommentManager.php (modified) (2 diffs)
-
trunk/lib/vendor/composer/autoload_classmap.php (modified) (3 diffs)
-
trunk/lib/vendor/composer/autoload_static.php (modified) (3 diffs)
-
trunk/lib/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
appful-app/tags/3.1.8/appful-app.php
r2936340 r2954441 12 12 * Plugin URI: https://appful.io 13 13 * 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. 714 * Version: 3.1.8 15 15 * Requires at least: 5.8 16 16 * Requires PHP: 7.4 -
appful-app/tags/3.1.8/includes/api/Api.php
r2920030 r2954441 44 44 $token = null; 45 45 46 if ( isset( $_SERVER['HTTP_AUTHORIZATION'] ) && 0 === stripos( $_SERVER['HTTP_AUTHORIZATION'], "Bearer " ) ) { 47 $token = sanitize_text_field( substr( $_SERVER['HTTP_AUTHORIZATION'], strlen( "Bearer " ) ) ); 46 $header = $_SERVER['HTTP_AUTHORIZATION'] ?? $_SERVER['REDIRECT_HTTP_AUTHORIZATION'] ?? null; 47 if ( $header != null && 0 === stripos( $header, "Bearer " ) ) { 48 $token = sanitize_text_field( substr( $header, strlen( "Bearer " ) ) ); 48 49 } 50 49 51 if ( $token == null ) { 50 52 $this->unauthorized(); -
appful-app/tags/3.1.8/includes/api/ReqHandler.php
r2920603 r2954441 10 10 use AppfulPlugin\Api\Handlers\ClearLogRequestHandler; 11 11 use AppfulPlugin\Api\Handlers\CommentSyncRequestHandler; 12 use AppfulPlugin\Api\Handlers\CreateCommentRequestHandler; 12 13 use AppfulPlugin\Api\Handlers\GetAttachmentsRequestHandler; 13 14 use AppfulPlugin\Api\Handlers\GetCategoriesRequestHandler; … … 56 57 new AuthenticateUserRequestHandler( $use_case_manager->get_authenticate_user_use_case() ), 57 58 new PullLocalPostContentRequestHandler( $use_case_manager->get_get_local_post_content_by_id_use_case() ), 59 new CreateCommentRequestHandler( $use_case_manager->create_comment_use_case() ), 58 60 ]; 59 61 } -
appful-app/tags/3.1.8/includes/use_cases/UseCaseManager.php
r2920184 r2954441 57 57 private PullLocalPostContentUseCase $pull_local_post_content_use_case; 58 58 private GetLocalPostContentByIdUseCase $get_local_post_content_by_id_use_case; 59 private CreateCommentUseCase $create_comment_use_case; 59 60 60 61 public function __construct( BackendClient $backend_client, SelfClient $self_client ) { … … 109 110 $this->get_local_post_content_by_id_use_case = new GetLocalPostContentByIdUseCase(); 110 111 $this->get_post_contents_by_id_use_case = new GetPostContentsByIdUseCase( $this->pull_local_post_content_use_case ); 112 $this->create_comment_use_case = new CreateCommentUseCase(); 111 113 } 112 114 … … 310 312 return $this->get_local_post_content_by_id_use_case; 311 313 } 314 315 public function create_comment_use_case(): CreateCommentUseCase { 316 return $this->create_comment_use_case; 317 } 312 318 } -
appful-app/tags/3.1.8/includes/wp/WPCommentManager.php
r2907312 r2954441 4 4 5 5 use AppfulPlugin\Domain\Comment; 6 use AppfulPlugin\Domain\CreateCommentRequest; 7 use AppfulPlugin\Helper\Logger; 6 8 use AppfulPlugin\Wp\Mapper\CommentMapper; 7 9 use AppfulPlugin\Wp\Plugins\LanguageHelper; … … 49 51 ); 50 52 } 53 54 public static function create_comment( CreateCommentRequest $request ): ?Comment { 55 $commentData = [ 56 'comment_author' => $request->get_username(), // The name of the author of the comment. 57 'comment_author_email' => $request->get_email(), // The email address of the $comment_author. 58 'comment_content' => $request->get_content(), // The content of the comment. 59 'comment_post_ID' => $request->get_post_id(), // ID of the post that relates to the comment. 60 'comment_parent' => $request->get_parent_id(), // ID of this comment's parent, if any. 61 ]; 62 63 $commentId = wp_insert_comment($commentData); 64 65 if ($commentId === false) { 66 Logger::log( "Insert comment failed" ); 67 return null; 68 } 69 Logger::log( "Inserted comment!" ); 70 71 $comment = get_comment($commentId); 72 73 if (!$comment instanceof WP_Comment) { 74 Logger::log( "Getting comment failed!" ); 75 return null; 76 } 77 78 return CommentMapper::to_domain($comment); 79 } 51 80 } -
appful-app/tags/3.1.8/lib/vendor/composer/autoload_classmap.php
r2920184 r2954441 30 30 'AppfulPlugin\\Api\\Handlers\\ClearLogRequestHandler' => $baseDir . '/../includes/api/handlers/ClearLogRequestHandler.php', 31 31 'AppfulPlugin\\Api\\Handlers\\CommentSyncRequestHandler' => $baseDir . '/../includes/api/handlers/CommentSyncRequestHandler.php', 32 'AppfulPlugin\\Api\\Handlers\\CreateCommentRequestHandler' => $baseDir . '/../includes/api/handlers/CreateCommentRequestHandler.php', 32 33 'AppfulPlugin\\Api\\Handlers\\GetAttachmentsRequestHandler' => $baseDir . '/../includes/api/handlers/GetAttachmentsRequestHandler.php', 33 34 'AppfulPlugin\\Api\\Handlers\\GetCategoriesRequestHandler' => $baseDir . '/../includes/api/handlers/GetCategoriesRequestHandler.php', … … 70 71 'AppfulPlugin\\Domain\\Category' => $baseDir . '/../includes/domain/Category.php', 71 72 'AppfulPlugin\\Domain\\Comment' => $baseDir . '/../includes/domain/Comment.php', 73 'AppfulPlugin\\Domain\\CreateCommentRequest' => $baseDir . '/../includes/domain/CreateCommentRequest.php', 72 74 'AppfulPlugin\\Domain\\Post' => $baseDir . '/../includes/domain/Post.php', 73 75 'AppfulPlugin\\Domain\\PostContent' => $baseDir . '/../includes/domain/PostContent.php', … … 103 105 'AppfulPlugin\\UseCases\\CommentDeleteUseCase' => $baseDir . '/../includes/use_cases/CommentDeleteUseCase.php', 104 106 'AppfulPlugin\\UseCases\\CommentSaveUseCase' => $baseDir . '/../includes/use_cases/CommentSaveUseCase.php', 107 'AppfulPlugin\\UseCases\\CreateCommentUseCase' => $baseDir . '/../includes/use_cases/CreateCommentUseCase.php', 105 108 'AppfulPlugin\\UseCases\\DeleteSessionUseCase' => $baseDir . '/../includes/use_cases/DeleteSessionUseCase.php', 106 109 'AppfulPlugin\\UseCases\\GetAndroidAssetLinkUseCase' => $baseDir . '/../includes/use_cases/GetAndroidAssetLinkUseCase.php', -
appful-app/tags/3.1.8/lib/vendor/composer/autoload_static.php
r2920184 r2954441 197 197 'AppfulPlugin\\Api\\Handlers\\ClearLogRequestHandler' => __DIR__ . '/../..' . '/../includes/api/handlers/ClearLogRequestHandler.php', 198 198 'AppfulPlugin\\Api\\Handlers\\CommentSyncRequestHandler' => __DIR__ . '/../..' . '/../includes/api/handlers/CommentSyncRequestHandler.php', 199 'AppfulPlugin\\Api\\Handlers\\CreateCommentRequestHandler' => __DIR__ . '/../..' . '/../includes/api/handlers/CreateCommentRequestHandler.php', 199 200 'AppfulPlugin\\Api\\Handlers\\GetAttachmentsRequestHandler' => __DIR__ . '/../..' . '/../includes/api/handlers/GetAttachmentsRequestHandler.php', 200 201 'AppfulPlugin\\Api\\Handlers\\GetCategoriesRequestHandler' => __DIR__ . '/../..' . '/../includes/api/handlers/GetCategoriesRequestHandler.php', … … 237 238 'AppfulPlugin\\Domain\\Category' => __DIR__ . '/../..' . '/../includes/domain/Category.php', 238 239 'AppfulPlugin\\Domain\\Comment' => __DIR__ . '/../..' . '/../includes/domain/Comment.php', 240 'AppfulPlugin\\Domain\\CreateCommentRequest' => __DIR__ . '/../..' . '/../includes/domain/CreateCommentRequest.php', 239 241 'AppfulPlugin\\Domain\\Post' => __DIR__ . '/../..' . '/../includes/domain/Post.php', 240 242 'AppfulPlugin\\Domain\\PostContent' => __DIR__ . '/../..' . '/../includes/domain/PostContent.php', … … 270 272 'AppfulPlugin\\UseCases\\CommentDeleteUseCase' => __DIR__ . '/../..' . '/../includes/use_cases/CommentDeleteUseCase.php', 271 273 'AppfulPlugin\\UseCases\\CommentSaveUseCase' => __DIR__ . '/../..' . '/../includes/use_cases/CommentSaveUseCase.php', 274 'AppfulPlugin\\UseCases\\CreateCommentUseCase' => __DIR__ . '/../..' . '/../includes/use_cases/CreateCommentUseCase.php', 272 275 'AppfulPlugin\\UseCases\\DeleteSessionUseCase' => __DIR__ . '/../..' . '/../includes/use_cases/DeleteSessionUseCase.php', 273 276 'AppfulPlugin\\UseCases\\GetAndroidAssetLinkUseCase' => __DIR__ . '/../..' . '/../includes/use_cases/GetAndroidAssetLinkUseCase.php', -
appful-app/tags/3.1.8/lib/vendor/composer/installed.php
r2936340 r2954441 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' 2142f2e59a034cea9d7682d4dd48a5fdedf39de7',6 'reference' => '4d8e7b6e341ee0d4e0bee5c8146a5f473c37c66b', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => ' 2142f2e59a034cea9d7682d4dd48a5fdedf39de7',16 'reference' => '4d8e7b6e341ee0d4e0bee5c8146a5f473c37c66b', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../', -
appful-app/tags/3.1.8/readme.txt
r2936340 r2954441 6 6 Tested up to: 6.2 7 7 Requires PHP: 7.4 8 Stable tag: 3.1. 78 Stable tag: 3.1.8 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
appful-app/trunk/appful-app.php
r2936340 r2954441 12 12 * Plugin URI: https://appful.io 13 13 * 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. 714 * Version: 3.1.8 15 15 * Requires at least: 5.8 16 16 * Requires PHP: 7.4 -
appful-app/trunk/includes/api/Api.php
r2920030 r2954441 44 44 $token = null; 45 45 46 if ( isset( $_SERVER['HTTP_AUTHORIZATION'] ) && 0 === stripos( $_SERVER['HTTP_AUTHORIZATION'], "Bearer " ) ) { 47 $token = sanitize_text_field( substr( $_SERVER['HTTP_AUTHORIZATION'], strlen( "Bearer " ) ) ); 46 $header = $_SERVER['HTTP_AUTHORIZATION'] ?? $_SERVER['REDIRECT_HTTP_AUTHORIZATION'] ?? null; 47 if ( $header != null && 0 === stripos( $header, "Bearer " ) ) { 48 $token = sanitize_text_field( substr( $header, strlen( "Bearer " ) ) ); 48 49 } 50 49 51 if ( $token == null ) { 50 52 $this->unauthorized(); -
appful-app/trunk/includes/api/ReqHandler.php
r2920603 r2954441 10 10 use AppfulPlugin\Api\Handlers\ClearLogRequestHandler; 11 11 use AppfulPlugin\Api\Handlers\CommentSyncRequestHandler; 12 use AppfulPlugin\Api\Handlers\CreateCommentRequestHandler; 12 13 use AppfulPlugin\Api\Handlers\GetAttachmentsRequestHandler; 13 14 use AppfulPlugin\Api\Handlers\GetCategoriesRequestHandler; … … 56 57 new AuthenticateUserRequestHandler( $use_case_manager->get_authenticate_user_use_case() ), 57 58 new PullLocalPostContentRequestHandler( $use_case_manager->get_get_local_post_content_by_id_use_case() ), 59 new CreateCommentRequestHandler( $use_case_manager->create_comment_use_case() ), 58 60 ]; 59 61 } -
appful-app/trunk/includes/use_cases/UseCaseManager.php
r2920184 r2954441 57 57 private PullLocalPostContentUseCase $pull_local_post_content_use_case; 58 58 private GetLocalPostContentByIdUseCase $get_local_post_content_by_id_use_case; 59 private CreateCommentUseCase $create_comment_use_case; 59 60 60 61 public function __construct( BackendClient $backend_client, SelfClient $self_client ) { … … 109 110 $this->get_local_post_content_by_id_use_case = new GetLocalPostContentByIdUseCase(); 110 111 $this->get_post_contents_by_id_use_case = new GetPostContentsByIdUseCase( $this->pull_local_post_content_use_case ); 112 $this->create_comment_use_case = new CreateCommentUseCase(); 111 113 } 112 114 … … 310 312 return $this->get_local_post_content_by_id_use_case; 311 313 } 314 315 public function create_comment_use_case(): CreateCommentUseCase { 316 return $this->create_comment_use_case; 317 } 312 318 } -
appful-app/trunk/includes/wp/WPCommentManager.php
r2907312 r2954441 4 4 5 5 use AppfulPlugin\Domain\Comment; 6 use AppfulPlugin\Domain\CreateCommentRequest; 7 use AppfulPlugin\Helper\Logger; 6 8 use AppfulPlugin\Wp\Mapper\CommentMapper; 7 9 use AppfulPlugin\Wp\Plugins\LanguageHelper; … … 49 51 ); 50 52 } 53 54 public static function create_comment( CreateCommentRequest $request ): ?Comment { 55 $commentData = [ 56 'comment_author' => $request->get_username(), // The name of the author of the comment. 57 'comment_author_email' => $request->get_email(), // The email address of the $comment_author. 58 'comment_content' => $request->get_content(), // The content of the comment. 59 'comment_post_ID' => $request->get_post_id(), // ID of the post that relates to the comment. 60 'comment_parent' => $request->get_parent_id(), // ID of this comment's parent, if any. 61 ]; 62 63 $commentId = wp_insert_comment($commentData); 64 65 if ($commentId === false) { 66 Logger::log( "Insert comment failed" ); 67 return null; 68 } 69 Logger::log( "Inserted comment!" ); 70 71 $comment = get_comment($commentId); 72 73 if (!$comment instanceof WP_Comment) { 74 Logger::log( "Getting comment failed!" ); 75 return null; 76 } 77 78 return CommentMapper::to_domain($comment); 79 } 51 80 } -
appful-app/trunk/lib/vendor/composer/autoload_classmap.php
r2920184 r2954441 30 30 'AppfulPlugin\\Api\\Handlers\\ClearLogRequestHandler' => $baseDir . '/../includes/api/handlers/ClearLogRequestHandler.php', 31 31 'AppfulPlugin\\Api\\Handlers\\CommentSyncRequestHandler' => $baseDir . '/../includes/api/handlers/CommentSyncRequestHandler.php', 32 'AppfulPlugin\\Api\\Handlers\\CreateCommentRequestHandler' => $baseDir . '/../includes/api/handlers/CreateCommentRequestHandler.php', 32 33 'AppfulPlugin\\Api\\Handlers\\GetAttachmentsRequestHandler' => $baseDir . '/../includes/api/handlers/GetAttachmentsRequestHandler.php', 33 34 'AppfulPlugin\\Api\\Handlers\\GetCategoriesRequestHandler' => $baseDir . '/../includes/api/handlers/GetCategoriesRequestHandler.php', … … 70 71 'AppfulPlugin\\Domain\\Category' => $baseDir . '/../includes/domain/Category.php', 71 72 'AppfulPlugin\\Domain\\Comment' => $baseDir . '/../includes/domain/Comment.php', 73 'AppfulPlugin\\Domain\\CreateCommentRequest' => $baseDir . '/../includes/domain/CreateCommentRequest.php', 72 74 'AppfulPlugin\\Domain\\Post' => $baseDir . '/../includes/domain/Post.php', 73 75 'AppfulPlugin\\Domain\\PostContent' => $baseDir . '/../includes/domain/PostContent.php', … … 103 105 'AppfulPlugin\\UseCases\\CommentDeleteUseCase' => $baseDir . '/../includes/use_cases/CommentDeleteUseCase.php', 104 106 'AppfulPlugin\\UseCases\\CommentSaveUseCase' => $baseDir . '/../includes/use_cases/CommentSaveUseCase.php', 107 'AppfulPlugin\\UseCases\\CreateCommentUseCase' => $baseDir . '/../includes/use_cases/CreateCommentUseCase.php', 105 108 'AppfulPlugin\\UseCases\\DeleteSessionUseCase' => $baseDir . '/../includes/use_cases/DeleteSessionUseCase.php', 106 109 'AppfulPlugin\\UseCases\\GetAndroidAssetLinkUseCase' => $baseDir . '/../includes/use_cases/GetAndroidAssetLinkUseCase.php', -
appful-app/trunk/lib/vendor/composer/autoload_static.php
r2920184 r2954441 197 197 'AppfulPlugin\\Api\\Handlers\\ClearLogRequestHandler' => __DIR__ . '/../..' . '/../includes/api/handlers/ClearLogRequestHandler.php', 198 198 'AppfulPlugin\\Api\\Handlers\\CommentSyncRequestHandler' => __DIR__ . '/../..' . '/../includes/api/handlers/CommentSyncRequestHandler.php', 199 'AppfulPlugin\\Api\\Handlers\\CreateCommentRequestHandler' => __DIR__ . '/../..' . '/../includes/api/handlers/CreateCommentRequestHandler.php', 199 200 'AppfulPlugin\\Api\\Handlers\\GetAttachmentsRequestHandler' => __DIR__ . '/../..' . '/../includes/api/handlers/GetAttachmentsRequestHandler.php', 200 201 'AppfulPlugin\\Api\\Handlers\\GetCategoriesRequestHandler' => __DIR__ . '/../..' . '/../includes/api/handlers/GetCategoriesRequestHandler.php', … … 237 238 'AppfulPlugin\\Domain\\Category' => __DIR__ . '/../..' . '/../includes/domain/Category.php', 238 239 'AppfulPlugin\\Domain\\Comment' => __DIR__ . '/../..' . '/../includes/domain/Comment.php', 240 'AppfulPlugin\\Domain\\CreateCommentRequest' => __DIR__ . '/../..' . '/../includes/domain/CreateCommentRequest.php', 239 241 'AppfulPlugin\\Domain\\Post' => __DIR__ . '/../..' . '/../includes/domain/Post.php', 240 242 'AppfulPlugin\\Domain\\PostContent' => __DIR__ . '/../..' . '/../includes/domain/PostContent.php', … … 270 272 'AppfulPlugin\\UseCases\\CommentDeleteUseCase' => __DIR__ . '/../..' . '/../includes/use_cases/CommentDeleteUseCase.php', 271 273 'AppfulPlugin\\UseCases\\CommentSaveUseCase' => __DIR__ . '/../..' . '/../includes/use_cases/CommentSaveUseCase.php', 274 'AppfulPlugin\\UseCases\\CreateCommentUseCase' => __DIR__ . '/../..' . '/../includes/use_cases/CreateCommentUseCase.php', 272 275 'AppfulPlugin\\UseCases\\DeleteSessionUseCase' => __DIR__ . '/../..' . '/../includes/use_cases/DeleteSessionUseCase.php', 273 276 'AppfulPlugin\\UseCases\\GetAndroidAssetLinkUseCase' => __DIR__ . '/../..' . '/../includes/use_cases/GetAndroidAssetLinkUseCase.php', -
appful-app/trunk/lib/vendor/composer/installed.php
r2936340 r2954441 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' 2142f2e59a034cea9d7682d4dd48a5fdedf39de7',6 'reference' => '4d8e7b6e341ee0d4e0bee5c8146a5f473c37c66b', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => ' 2142f2e59a034cea9d7682d4dd48a5fdedf39de7',16 'reference' => '4d8e7b6e341ee0d4e0bee5c8146a5f473c37c66b', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../', -
appful-app/trunk/readme.txt
r2936340 r2954441 6 6 Tested up to: 6.2 7 7 Requires PHP: 7.4 8 Stable tag: 3.1. 78 Stable tag: 3.1.8 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.