@@ -81,11 +81,6 @@ class Optml_Rest {
81
81
'clear_offload_errors ' => 'GET ' ,
82
82
'get_offload_conflicts ' => 'GET ' ,
83
83
],
84
- 'watermark_routes ' => [
85
- 'poll_watermarks ' => 'GET ' ,
86
- 'add_watermark ' => 'POST ' ,
87
- 'remove_watermark ' => 'POST ' ,
88
- ],
89
84
'conflict_routes ' => [
90
85
'poll_conflicts ' => 'GET ' ,
91
86
'dismiss_conflict ' => 'POST ' ,
@@ -175,7 +170,6 @@ public function register() {
175
170
$ this ->register_service_routes ();
176
171
177
172
$ this ->register_image_routes ();
178
- $ this ->register_watermark_routes ();
179
173
$ this ->register_conflict_routes ();
180
174
$ this ->register_cache_routes ();
181
175
$ this ->register_media_offload_routes ();
@@ -217,14 +211,6 @@ public function register_media_offload_routes() {
217
211
}
218
212
}
219
213
220
- /**
221
- * Method to register watermark specific routes.
222
- */
223
- public function register_watermark_routes () {
224
- foreach ( self ::$ rest_routes ['watermark_routes ' ] as $ route => $ details ) {
225
- $ this ->reqister_route ( $ route , $ details );
226
- }
227
- }
228
214
229
215
/**
230
216
* Method to register conflicts specific routes.
@@ -650,57 +636,6 @@ public function poll_optimized_images( WP_REST_Request $request ) {
650
636
return $ this ->response ( $ final_images );
651
637
}
652
638
653
- /**
654
- * Get watermarks from API.
655
- *
656
- * @param WP_REST_Request $request rest request.
657
- *
658
- * @return WP_REST_Response
659
- */
660
- public function poll_watermarks ( WP_REST_Request $ request ) {
661
- $ api_key = $ request ->get_param ( 'api_key ' );
662
- $ request = new Optml_Api ();
663
- $ watermarks = $ request ->get_watermarks ( $ api_key );
664
- if ( ! isset ( $ watermarks ['watermarks ' ] ) || empty ( $ watermarks ['watermarks ' ] ) ) {
665
- return $ this ->response ( [] );
666
- }
667
- $ final_images = array_splice ( $ watermarks ['watermarks ' ], 0 , 10 );
668
-
669
- return $ this ->response ( $ final_images );
670
- }
671
-
672
- /**
673
- * Add watermark.
674
- *
675
- * @param WP_REST_Request $request rest request.
676
- *
677
- * @return WP_REST_Response
678
- */
679
- public function add_watermark ( WP_REST_Request $ request ) {
680
- $ file = $ request ->get_file_params ();
681
- $ request = new Optml_Api ();
682
- $ response = $ request ->add_watermark ( $ file );
683
- if ( $ response === false ) {
684
- return $ this ->response ( __ ( 'Error uploading image. Please try again. ' , 'optimole-wp ' ), 'error ' );
685
- }
686
-
687
- return $ this ->response ( __ ( 'Watermark image uploaded succesfully ! ' , 'optimole-wp ' ) );
688
- }
689
-
690
- /**
691
- * Remove watermark.
692
- *
693
- * @param WP_REST_Request $request rest request.
694
- *
695
- * @return WP_REST_Response
696
- */
697
- public function remove_watermark ( WP_REST_Request $ request ) {
698
- $ post_id = $ request ->get_param ( 'postID ' );
699
- $ api_key = $ request ->get_param ( 'api_key ' );
700
- $ request = new Optml_Api ();
701
-
702
- return $ this ->response ( $ request ->remove_watermark ( $ post_id , $ api_key ) );
703
- }
704
639
705
640
/**
706
641
* Get conflicts from API.
0 commit comments