@@ -122,7 +122,6 @@ public function add_admin_menu() {
122122 'rt-retranscoder ' ,
123123 array ( $ this , 'retranscode_interface ' )
124124 );
125-
126125 }
127126
128127 /**
@@ -230,7 +229,7 @@ public function add_bulk_actions_via_javascript() {
230229 ?>
231230 <script type="text/javascript">
232231 jQuery(document).ready(function($){
233- $('select[name^="action"] option:last-child').before('<option value="bulk_retranscode_media"><?php echo esc_attr ( __ ( 'Retranscode Media ' , 'transcoder ' ) ); ?> </option>');
232+ $('select[name^="action"] option:last-child').before('<option value="bulk_retranscode_media"><?php esc_html_e ( 'Retranscode Media ' , 'transcoder ' ); ?> </option>');
234233 });
235234 </script>
236235 <?php
@@ -372,7 +371,7 @@ public function retranscode_interface() {
372371 <table border=0>
373372 ?>
374373 <tr>
375- <td><input type="submit" class="button button-primary button-small" value="<?php echo esc_html__ ( 'Proceed with retranscoding ' , 'transcoder ' ); ?> "></td>
374+ <td><input type="submit" class="button button-primary button-small" value="<?php esc_attr_e ( 'Proceed with retranscoding ' , 'transcoder ' ); ?> "></td>
376375 <td></td>
377376 </tr>
378377 <?php
@@ -386,7 +385,7 @@ public function retranscode_interface() {
386385 }
387386 ?>
388387 <tr>
389- <td><input type="submit" class="button button-primary button-small" value="<?php esc_html_e ( 'Proceed with retranscoding ' , 'transcoder ' ); ?> " ></td>
388+ <td><input type="submit" class="button button-primary button-small" value="<?php esc_attr_e ( 'Proceed with retranscoding ' , 'transcoder ' ); ?> " ></td>
390389 <td></td>
391390 </tr>
392391 </table>
@@ -422,7 +421,7 @@ public function retranscode_interface() {
422421 <div id="retranscodemedia-bar-percent" style="position:absolute;left:50%;top:50%;width:300px;margin-left:-150px;height:25px;margin-top:-9px;font-weight:bold;text-align:center;"></div>
423422 </div>
424423
425- <p><input type="button" class="button hide-if-no-js" name="retranscodemedia-stop" id="retranscodemedia-stop" value="<?php esc_html_e ( 'Abort the Operation ' , 'transcoder ' ); ?> " /></p>
424+ <p><input type="button" class="button hide-if-no-js" name="retranscodemedia-stop" id="retranscodemedia-stop" value="<?php esc_attr_e ( 'Abort the Operation ' , 'transcoder ' ); ?> " /></p>
426425
427426 <h3 class="title"><?php esc_html_e ( 'Debugging Information ' , 'transcoder ' ); ?> </h3>
428427
@@ -594,7 +593,7 @@ function RetranscodeMedia( id ) {
594593
595594 <p><?php esc_html_e ( 'To begin, just press the button below. ' , 'transcoder ' ); ?> </p>
596595
597- <p><input type="submit" class="button hide-if-no-js button button-primary" name="rt-retranscoder" id="rt-retranscoder" value="<?php esc_html_e ( 'Retranscode All Media ' , 'transcoder ' ); ?> " /></p>
596+ <p><input type="submit" class="button hide-if-no-js button button-primary" name="rt-retranscoder" id="rt-retranscoder" value="<?php esc_attr_e ( 'Retranscode All Media ' , 'transcoder ' ); ?> " /></p>
598597
599598 <noscript><p><em><?php esc_html_e ( 'You must enable Javascript in order to proceed! ' , 'transcoder ' ); ?> </em></p></noscript>
600599
@@ -717,10 +716,10 @@ public function die_json_error_msg( $id, $message ) {
717716 /**
718717 * Helper function to escape quotes in strings for use in Javascript
719718 *
720- * @param string $string String to escape quotes from.
719+ * @param string $str String to escape quotes from.
721720 */
722- public function esc_quotes ( $ string ) {
723- return str_replace ( '" ' , '\" ' , $ string );
721+ public function esc_quotes ( $ str ) {
722+ return str_replace ( '" ' , '\" ' , $ str );
724723 }
725724
726725 /**
@@ -744,7 +743,7 @@ private function retranscode_admin_error_notice() {
744743 * @param number $media_id Post ID of the media.
745744 * @param array $post_request Post request coming for the transcoder API.
746745 */
747- public function rtt_before_thumbnail_store ( $ media_id = '' , $ post_request = '' ) {
746+ public function rtt_before_thumbnail_store ( $ media_id = '' , $ post_request = '' ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
748747 if ( empty ( $ media_id ) ) {
749748 return ;
750749 }
@@ -767,7 +766,6 @@ public function rtt_before_thumbnail_store( $media_id = '', $post_request = '' )
767766 rtt_delete_transcoded_files ( $ previous_thumbs );
768767 }
769768 delete_post_meta ( $ media_id , '_rt_media_thumbnails ' );
770-
771769 }
772770
773771 /**
@@ -776,7 +774,7 @@ public function rtt_before_thumbnail_store( $media_id = '', $post_request = '' )
776774 * @param number $media_id Post ID of the media.
777775 * @param array $transcoded_files Post request coming for the transcoder API.
778776 */
779- public function rtt_before_transcoded_media_store ( $ media_id = '' , $ transcoded_files = '' ) {
777+ public function rtt_before_transcoded_media_store ( $ media_id = '' , $ transcoded_files = '' ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
780778 if ( empty ( $ media_id ) ) {
781779 return ;
782780 }
@@ -791,7 +789,6 @@ public function rtt_before_transcoded_media_store( $media_id = '', $transcoded_f
791789 }
792790 }
793791 delete_post_meta ( $ media_id , '_rt_media_transcoded_files ' );
794-
795792 }
796793
797794 /**
@@ -872,7 +869,7 @@ public function transcoded_thumbnails_added( $media_id = '' ) {
872869 * @param number $attachment_id Post ID of the media.
873870 * @param string $job_id Unique job ID of the transcoding request.
874871 */
875- public function rtt_handle_callback_finished ( $ attachment_id = '' , $ job_id = '' ) {
872+ public function rtt_handle_callback_finished ( $ attachment_id = '' , $ job_id = '' ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
876873 if ( empty ( $ attachment_id ) ) {
877874 return ;
878875 }
@@ -884,7 +881,6 @@ public function rtt_handle_callback_finished( $attachment_id = '', $job_id = ''
884881 delete_post_meta ( $ attachment_id , '_rt_retranscoding_sent ' );
885882
886883 }
887-
888884 }
889885
890886 /**
@@ -1015,7 +1011,6 @@ public function add_search_mime_types( $where ) {
10151011 $ where .= " AND post_mime_type LIKE 'audio/%' OR post_mime_type LIKE 'video/%' " ;
10161012 return $ where ;
10171013 }
1018-
10191014}
10201015
10211016// Start up this plugin.
@@ -1024,11 +1019,9 @@ public function add_search_mime_types( $where ) {
10241019/**
10251020 * Execute RetranscodeMedia constructor.
10261021 */
1027- function retranscode_media () {
1022+ function retranscode_media () { // phpcs:ignore Universal.Files.SeparateFunctionsFromOO.Mixed
10281023
10291024 global $ RetranscodeMedia ; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
10301025
10311026 $ RetranscodeMedia = new RetranscodeMedia (); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
10321027}
1033-
1034- ?>
0 commit comments