|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Wordlift\Videoobject; |
|
4
|
|
|
|
|
5
|
|
|
use Wordlift\Cache\Ttl_Cache; |
|
6
|
|
|
use Wordlift\Common\Loader\Default_Loader; |
|
7
|
|
|
use Wordlift\Videoobject\Api\Rest_Controller; |
|
8
|
|
|
use Wordlift\Videoobject\Background_Process\Videoobject_Background_Process; |
|
9
|
|
|
use Wordlift\Videoobject\Background_Process\Videos_Data_Source; |
|
10
|
|
|
use Wordlift\Videoobject\Data\Video_Storage\Video_Storage_Factory; |
|
11
|
|
|
use Wordlift\Videoobject\Filters\Post_Filter; |
|
12
|
|
|
use Wordlift\Videoobject\Jsonld\Jsonld; |
|
13
|
|
|
use Wordlift\Videoobject\Pages\Import_Videos_Page; |
|
14
|
|
|
use Wordlift\Videoobject\Sitemap\Video_Sitemap; |
|
15
|
|
|
use Wordlift\Videoobject\Tabs\Settings_Tab; |
|
16
|
|
|
use Wordlift\Videoobject\Ui\Post_Edit_Screen; |
|
17
|
|
|
|
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* @since 3.31.0 |
|
21
|
|
|
* @author Naveen Muthusamy <[email protected]> |
|
22
|
|
|
*/ |
|
23
|
|
|
class Loader extends Default_Loader { |
|
24
|
|
|
|
|
25
|
|
|
public function init_all_dependencies() { |
|
26
|
|
|
$video_storage = Video_Storage_Factory::get_storage(); |
|
27
|
|
|
new Jsonld( $video_storage ); |
|
28
|
|
|
|
|
29
|
|
|
$sitemap_cache = new Ttl_Cache( "wl_video_sitemap", 86400 ); |
|
30
|
|
|
|
|
31
|
|
|
$video_processor = new Video_Processor(); |
|
32
|
|
|
// Hook in to save_post to save the videos |
|
33
|
|
|
$post_filter = new Post_Filter( $video_processor ); |
|
34
|
|
|
$post_filter->init(); |
|
35
|
|
|
// Add entry to wordlift admin tabs |
|
36
|
|
|
$settings_tab = new Settings_Tab(); |
|
37
|
|
|
$settings_tab->init(); |
|
38
|
|
|
|
|
39
|
|
|
|
|
40
|
|
|
$video_sitemap = new Video_Sitemap( $sitemap_cache ); |
|
41
|
|
|
$video_sitemap->init(); |
|
42
|
|
|
$rest_controller = new Rest_Controller(); |
|
43
|
|
|
$rest_controller->register_all_routes(); |
|
44
|
|
|
|
|
45
|
|
|
$post_edit_screen = new Post_Edit_Screen(); |
|
46
|
|
|
$post_edit_screen->init(); |
|
47
|
|
|
|
|
48
|
|
|
new Import_Videos_Page(); |
|
49
|
|
|
|
|
50
|
|
|
$background_process_data_source = new Videos_Data_Source( '__wl_videoobject_import_state' ); |
|
51
|
|
|
$import_process = new Videoobject_Background_Process( $video_processor, $background_process_data_source ); |
|
|
|
|
|
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
public function get_feature_slug() { |
|
55
|
|
|
return 'videoobject'; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
public function get_feature_default_value() { |
|
59
|
|
|
return false; |
|
60
|
|
|
} |
|
61
|
|
|
} |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.