From b37e7a5e288f3c30dd640cc9f02c6b76705923a7 Mon Sep 17 00:00:00 2001 From: umesh Date: Thu, 25 Jul 2024 00:09:53 +0530 Subject: [PATCH 1/2] Fixed spacing issues and blank line issues reported by PHPCS --- admin/index.php | 2 +- admin/rt-transcoder-progressbar.php | 1 - admin/rt-transcoder-rest-routes.php | 1 - inc/classes/class-filesystem.php | 3 --- inc/helpers/autoloader.php | 1 - inc/traits/trait-singleton.php | 2 -- 6 files changed, 1 insertion(+), 9 deletions(-) diff --git a/admin/index.php b/admin/index.php index 24dc103..8142269 100644 --- a/admin/index.php +++ b/admin/index.php @@ -1 +1 @@ - $final_file_url, ); } - } diff --git a/inc/classes/class-filesystem.php b/inc/classes/class-filesystem.php index 31275a0..9291472 100644 --- a/inc/classes/class-filesystem.php +++ b/inc/classes/class-filesystem.php @@ -22,7 +22,6 @@ class FileSystem { protected function __construct() { $this->init_file_system(); - } /** @@ -76,7 +75,5 @@ public static function delete_file( $file ) { global $wp_filesystem; return $wp_filesystem->delete( $file ); - } - } diff --git a/inc/helpers/autoloader.php b/inc/helpers/autoloader.php index b9e353e..ad3e638 100644 --- a/inc/helpers/autoloader.php +++ b/inc/helpers/autoloader.php @@ -79,7 +79,6 @@ function autoloader( $resource = '' ) { // We already making sure that file is exists and valid. require_once $resource_path; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingVariable } - } spl_autoload_register( __NAMESPACE__ . '\autoloader' ); diff --git a/inc/traits/trait-singleton.php b/inc/traits/trait-singleton.php index c4d6f8b..e39d1d2 100644 --- a/inc/traits/trait-singleton.php +++ b/inc/traits/trait-singleton.php @@ -83,7 +83,5 @@ final public static function get_instance() { } return $instance[ $called_class ]; - } - } // End trait From bb606adca3180c510904d791b4d0d189a9458301 Mon Sep 17 00:00:00 2001 From: umesh Date: Wed, 31 Jul 2024 20:47:06 +0530 Subject: [PATCH 2/2] Fixed warning in debug.log Creation of dynamic property RetranscodeMedia::$capability is deprecated in /var/www/htdocs/wp-content/plugins/transcoder/admin/rt-retranscode-admin.php on line 82 --- admin/rt-retranscode-admin.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/admin/rt-retranscode-admin.php b/admin/rt-retranscode-admin.php index 45fcccf..06f4f43 100644 --- a/admin/rt-retranscode-admin.php +++ b/admin/rt-retranscode-admin.php @@ -17,6 +17,13 @@ class RetranscodeMedia { */ public $menu_id; + /** + * capability of user required to retranscode. + * + * @var string + */ + public $capability; + /** * API key of transcoder subscription. * @@ -64,6 +71,9 @@ public function __construct() { return; } + // Allow people to change what capability is required to use this feature. + $this->capability = apply_filters( 'retranscode_media_cap', 'manage_options' ); + add_action( 'admin_menu', array( $this, 'add_admin_menu' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueues' ) ); add_action( 'wp_ajax_retranscodemedia', array( $this, 'ajax_process_retranscode_request' ) ); @@ -78,8 +88,6 @@ public function __construct() { add_filter( 'amp_story_allowed_video_types', array( $this, 'add_amp_video_extensions' ) ); // Extend allowed video mime type extensions for AMP Story Background. add_filter( 'render_block', array( $this, 'update_amp_story_video_url' ), 10, 2 ); // Filter block content and replace video URLs. - // Allow people to change what capability is required to use this feature. - $this->capability = apply_filters( 'retranscode_media_cap', 'manage_options' ); // Load Rest Endpoints. $this->load_rest_endpoints();