@@ -36,6 +36,9 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| 39 | + /** |
|
| 40 | + * @param Embedded_Video[] $embedded_videos |
|
| 41 | + */ |
|
| 39 | 42 | private function get_data_for_videos( $embedded_videos ) { |
| 40 | 43 | |
| 41 | 44 | $youtube_videos = $this->get_youtube_videos( $embedded_videos ); |
@@ -53,7 +56,7 @@ discard block |
||
| 53 | 56 | } |
| 54 | 57 | |
| 55 | 58 | /** |
| 56 | - * @param $storage Storage |
|
| 59 | + * @param Meta_Storage $storage Storage |
|
| 57 | 60 | * @param $post_id int |
| 58 | 61 | * @param $embedded_videos array<Embedded_Video> |
| 59 | 62 | */ |
@@ -124,7 +127,7 @@ discard block |
||
| 124 | 127 | } |
| 125 | 128 | |
| 126 | 129 | /** |
| 127 | - * @param $storage Storage |
|
| 130 | + * @param Meta_Storage $storage Storage |
|
| 128 | 131 | * @param $post_id int |
| 129 | 132 | * @param $embedded_videos array<Embedded_Video> |
| 130 | 133 | * |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Wordlift\Videoobject\Data\Embedded_Video\Embedded_Video; |
| 6 | 6 | use Wordlift\Videoobject\Data\Video\Video; |
| 7 | -use Wordlift\Videoobject\Data\Video_Storage\Meta_Storage; |
|
| 8 | 7 | use Wordlift\Videoobject\Data\Video_Storage\Storage; |
| 9 | 8 | use Wordlift\Videoobject\Data\Video_Storage\Video_Storage_Factory; |
| 10 | 9 | use Wordlift\Videoobject\Parser\Parser_Factory; |
@@ -16,166 +16,166 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | class Post_Filter { |
| 18 | 18 | |
| 19 | - public function init() { |
|
| 20 | - add_action( 'save_post', array( $this, 'save_post' ), 10, 3 ); |
|
| 21 | - } |
|
| 19 | + public function init() { |
|
| 20 | + add_action( 'save_post', array( $this, 'save_post' ), 10, 3 ); |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * @param $post_id int |
|
| 25 | - * @param $post \WP_Post |
|
| 26 | - * @param $update bool |
|
| 27 | - */ |
|
| 28 | - public function save_post( $post_id, $post, $update ) { |
|
| 23 | + /** |
|
| 24 | + * @param $post_id int |
|
| 25 | + * @param $post \WP_Post |
|
| 26 | + * @param $update bool |
|
| 27 | + */ |
|
| 28 | + public function save_post( $post_id, $post, $update ) { |
|
| 29 | 29 | |
| 30 | - if ( wp_is_post_revision( $post_id ) || wp_is_post_autosave( $post_id ) ) { |
|
| 31 | - return; |
|
| 32 | - } |
|
| 30 | + if ( wp_is_post_revision( $post_id ) || wp_is_post_autosave( $post_id ) ) { |
|
| 31 | + return; |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - $this->process_video_urls( $post, $post_id ); |
|
| 35 | - |
|
| 36 | - } |
|
| 37 | - |
|
| 38 | - |
|
| 39 | - private function get_data_for_videos( $embedded_videos ) { |
|
| 40 | - |
|
| 41 | - $youtube_videos = $this->get_youtube_videos( $embedded_videos ); |
|
| 42 | - |
|
| 43 | - $youtube_provider = Provider_Factory::get_provider( Provider_Factory::YOUTUBE ); |
|
| 44 | - $youtube_videos = $youtube_provider->get_videos_data( $youtube_videos ); |
|
| 45 | - |
|
| 46 | - $vimeo_videos = $this->get_vimeo_videos( $embedded_videos ); |
|
| 47 | - |
|
| 48 | - $vimeo_provider = Provider_Factory::get_provider( Provider_Factory::VIMEO ); |
|
| 49 | - $vimeo_videos = $vimeo_provider->get_videos_data( $vimeo_videos ); |
|
| 50 | - |
|
| 51 | - return array_merge( $youtube_videos, $vimeo_videos ); |
|
| 52 | - |
|
| 53 | - } |
|
| 54 | - |
|
| 55 | - /** |
|
| 56 | - * @param $storage Storage |
|
| 57 | - * @param $post_id int |
|
| 58 | - * @param $embedded_videos array<Embedded_Video> |
|
| 59 | - */ |
|
| 60 | - private function remove_videos_from_store_if_not_present_in_content( $storage, $post_id, $embedded_videos ) { |
|
| 61 | - |
|
| 62 | - $videos_to_be_deleted = $this->get_videos_to_be_deleted( $storage, $post_id, $embedded_videos ); |
|
| 63 | - $storage->remove_videos( $videos_to_be_deleted, $post_id ); |
|
| 64 | - |
|
| 65 | - } |
|
| 66 | - |
|
| 67 | - /** |
|
| 68 | - * @param Storage $storage |
|
| 69 | - * @param $post_id |
|
| 70 | - * @param array $embedded_videos |
|
| 71 | - * |
|
| 72 | - * @return array |
|
| 73 | - */ |
|
| 74 | - private function get_videos_to_be_deleted( Storage $storage, $post_id, array $embedded_videos ) { |
|
| 75 | - $videos_in_store = $storage->get_all_videos( $post_id ); |
|
| 76 | - $embedded_video_urls = array_map( function ( $embedded_video ) { |
|
| 77 | - /** |
|
| 78 | - * @var $embedded_video Embedded_Video |
|
| 79 | - */ |
|
| 80 | - return $embedded_video->get_url(); |
|
| 81 | - }, $embedded_videos ); |
|
| 82 | - |
|
| 83 | - return array_filter( $videos_in_store, function ( $video ) use ( $embedded_video_urls ) { |
|
| 84 | - /** |
|
| 85 | - * @var $video Video |
|
| 86 | - */ |
|
| 87 | - return ! in_array( $video->id, $embedded_video_urls ); |
|
| 88 | - } ); |
|
| 89 | - } |
|
| 90 | - |
|
| 91 | - /** |
|
| 92 | - * @param \WP_Post $post |
|
| 93 | - * @param $post_id |
|
| 94 | - */ |
|
| 95 | - private function process_video_urls( \WP_Post $post, $post_id ) { |
|
| 96 | - |
|
| 97 | - $parser = Parser_Factory::get_parser_from_content( $post->post_content ); |
|
| 98 | - |
|
| 99 | - $embedded_videos = $parser->get_videos( $post_id ); |
|
| 100 | - |
|
| 101 | - $storage = Video_Storage_Factory::get_storage(); |
|
| 102 | - |
|
| 103 | - // Before sending api requests we need to check if there are any videos in |
|
| 104 | - // store which is not present on post content, remove them if there are |
|
| 105 | - // any |
|
| 106 | - $this->remove_videos_from_store_if_not_present_in_content( $storage, $post_id, $embedded_videos ); |
|
| 107 | - |
|
| 108 | - $embedded_videos = $this->get_videos_without_existing_data( $storage, $post_id, $embedded_videos ); |
|
| 109 | - |
|
| 110 | - // Return early after removing all the videos. |
|
| 111 | - if ( ! $embedded_videos ) { |
|
| 112 | - return; |
|
| 113 | - } |
|
| 114 | - |
|
| 115 | - $videos = $this->get_data_for_videos( $embedded_videos ); |
|
| 116 | - |
|
| 117 | - if ( ! $videos ) { |
|
| 118 | - return; |
|
| 119 | - } |
|
| 120 | - |
|
| 121 | - foreach ( $videos as $video ) { |
|
| 122 | - $storage->add_video( $post_id, $video ); |
|
| 123 | - } |
|
| 124 | - } |
|
| 125 | - |
|
| 126 | - /** |
|
| 127 | - * @param $storage Storage |
|
| 128 | - * @param $post_id int |
|
| 129 | - * @param $embedded_videos array<Embedded_Video> |
|
| 130 | - * |
|
| 131 | - * @return array<Embedded_Video> Return array of embedded videos which are not in store. |
|
| 132 | - */ |
|
| 133 | - private function get_videos_without_existing_data( $storage, $post_id, $embedded_videos ) { |
|
| 134 | - $videos_in_store = $storage->get_all_videos( $post_id ); |
|
| 135 | - $video_ids_in_store = array_map( function ( $video ) { |
|
| 136 | - return $video->id; |
|
| 137 | - }, $videos_in_store ); |
|
| 138 | - |
|
| 139 | - return array_filter( $embedded_videos, function ( $embedded_video ) use ( $video_ids_in_store ) { |
|
| 140 | - return ! in_array( $embedded_video->get_url(), $video_ids_in_store ); |
|
| 141 | - } ); |
|
| 142 | - } |
|
| 143 | - |
|
| 144 | - /** |
|
| 145 | - * @param $embedded_videos |
|
| 146 | - * |
|
| 147 | - * @return array |
|
| 148 | - */ |
|
| 149 | - private function get_youtube_videos( $embedded_videos ) { |
|
| 150 | - return array_filter( $embedded_videos, function ( $embedded_video ) { |
|
| 151 | - /** |
|
| 152 | - * it should have youtube.com or youtu.be in the url |
|
| 153 | - * |
|
| 154 | - * @param $embedded_video Embedded_Video |
|
| 155 | - */ |
|
| 156 | - $video_url = $embedded_video->get_url(); |
|
| 157 | - |
|
| 158 | - return strpos( $video_url, "youtube.com" ) !== false || |
|
| 159 | - strpos( $video_url, "youtu.be" ) !== false; |
|
| 160 | - } ); |
|
| 161 | - } |
|
| 162 | - |
|
| 163 | - /** |
|
| 164 | - * @param $embedded_videos |
|
| 165 | - * |
|
| 166 | - * @return array |
|
| 167 | - */ |
|
| 168 | - private function get_vimeo_videos( $embedded_videos ) { |
|
| 169 | - return array_filter( $embedded_videos, function ( $embedded_video ) { |
|
| 170 | - /** |
|
| 171 | - * it should have vimeo.com in the url |
|
| 172 | - * |
|
| 173 | - * @param $embedded_video Embedded_Video |
|
| 174 | - */ |
|
| 175 | - $video_url = $embedded_video->get_url(); |
|
| 176 | - |
|
| 177 | - return strpos( $video_url, "vimeo.com" ) !== false; |
|
| 178 | - } ); |
|
| 179 | - } |
|
| 34 | + $this->process_video_urls( $post, $post_id ); |
|
| 35 | + |
|
| 36 | + } |
|
| 37 | + |
|
| 38 | + |
|
| 39 | + private function get_data_for_videos( $embedded_videos ) { |
|
| 40 | + |
|
| 41 | + $youtube_videos = $this->get_youtube_videos( $embedded_videos ); |
|
| 42 | + |
|
| 43 | + $youtube_provider = Provider_Factory::get_provider( Provider_Factory::YOUTUBE ); |
|
| 44 | + $youtube_videos = $youtube_provider->get_videos_data( $youtube_videos ); |
|
| 45 | + |
|
| 46 | + $vimeo_videos = $this->get_vimeo_videos( $embedded_videos ); |
|
| 47 | + |
|
| 48 | + $vimeo_provider = Provider_Factory::get_provider( Provider_Factory::VIMEO ); |
|
| 49 | + $vimeo_videos = $vimeo_provider->get_videos_data( $vimeo_videos ); |
|
| 50 | + |
|
| 51 | + return array_merge( $youtube_videos, $vimeo_videos ); |
|
| 52 | + |
|
| 53 | + } |
|
| 54 | + |
|
| 55 | + /** |
|
| 56 | + * @param $storage Storage |
|
| 57 | + * @param $post_id int |
|
| 58 | + * @param $embedded_videos array<Embedded_Video> |
|
| 59 | + */ |
|
| 60 | + private function remove_videos_from_store_if_not_present_in_content( $storage, $post_id, $embedded_videos ) { |
|
| 61 | + |
|
| 62 | + $videos_to_be_deleted = $this->get_videos_to_be_deleted( $storage, $post_id, $embedded_videos ); |
|
| 63 | + $storage->remove_videos( $videos_to_be_deleted, $post_id ); |
|
| 64 | + |
|
| 65 | + } |
|
| 66 | + |
|
| 67 | + /** |
|
| 68 | + * @param Storage $storage |
|
| 69 | + * @param $post_id |
|
| 70 | + * @param array $embedded_videos |
|
| 71 | + * |
|
| 72 | + * @return array |
|
| 73 | + */ |
|
| 74 | + private function get_videos_to_be_deleted( Storage $storage, $post_id, array $embedded_videos ) { |
|
| 75 | + $videos_in_store = $storage->get_all_videos( $post_id ); |
|
| 76 | + $embedded_video_urls = array_map( function ( $embedded_video ) { |
|
| 77 | + /** |
|
| 78 | + * @var $embedded_video Embedded_Video |
|
| 79 | + */ |
|
| 80 | + return $embedded_video->get_url(); |
|
| 81 | + }, $embedded_videos ); |
|
| 82 | + |
|
| 83 | + return array_filter( $videos_in_store, function ( $video ) use ( $embedded_video_urls ) { |
|
| 84 | + /** |
|
| 85 | + * @var $video Video |
|
| 86 | + */ |
|
| 87 | + return ! in_array( $video->id, $embedded_video_urls ); |
|
| 88 | + } ); |
|
| 89 | + } |
|
| 90 | + |
|
| 91 | + /** |
|
| 92 | + * @param \WP_Post $post |
|
| 93 | + * @param $post_id |
|
| 94 | + */ |
|
| 95 | + private function process_video_urls( \WP_Post $post, $post_id ) { |
|
| 96 | + |
|
| 97 | + $parser = Parser_Factory::get_parser_from_content( $post->post_content ); |
|
| 98 | + |
|
| 99 | + $embedded_videos = $parser->get_videos( $post_id ); |
|
| 100 | + |
|
| 101 | + $storage = Video_Storage_Factory::get_storage(); |
|
| 102 | + |
|
| 103 | + // Before sending api requests we need to check if there are any videos in |
|
| 104 | + // store which is not present on post content, remove them if there are |
|
| 105 | + // any |
|
| 106 | + $this->remove_videos_from_store_if_not_present_in_content( $storage, $post_id, $embedded_videos ); |
|
| 107 | + |
|
| 108 | + $embedded_videos = $this->get_videos_without_existing_data( $storage, $post_id, $embedded_videos ); |
|
| 109 | + |
|
| 110 | + // Return early after removing all the videos. |
|
| 111 | + if ( ! $embedded_videos ) { |
|
| 112 | + return; |
|
| 113 | + } |
|
| 114 | + |
|
| 115 | + $videos = $this->get_data_for_videos( $embedded_videos ); |
|
| 116 | + |
|
| 117 | + if ( ! $videos ) { |
|
| 118 | + return; |
|
| 119 | + } |
|
| 120 | + |
|
| 121 | + foreach ( $videos as $video ) { |
|
| 122 | + $storage->add_video( $post_id, $video ); |
|
| 123 | + } |
|
| 124 | + } |
|
| 125 | + |
|
| 126 | + /** |
|
| 127 | + * @param $storage Storage |
|
| 128 | + * @param $post_id int |
|
| 129 | + * @param $embedded_videos array<Embedded_Video> |
|
| 130 | + * |
|
| 131 | + * @return array<Embedded_Video> Return array of embedded videos which are not in store. |
|
| 132 | + */ |
|
| 133 | + private function get_videos_without_existing_data( $storage, $post_id, $embedded_videos ) { |
|
| 134 | + $videos_in_store = $storage->get_all_videos( $post_id ); |
|
| 135 | + $video_ids_in_store = array_map( function ( $video ) { |
|
| 136 | + return $video->id; |
|
| 137 | + }, $videos_in_store ); |
|
| 138 | + |
|
| 139 | + return array_filter( $embedded_videos, function ( $embedded_video ) use ( $video_ids_in_store ) { |
|
| 140 | + return ! in_array( $embedded_video->get_url(), $video_ids_in_store ); |
|
| 141 | + } ); |
|
| 142 | + } |
|
| 143 | + |
|
| 144 | + /** |
|
| 145 | + * @param $embedded_videos |
|
| 146 | + * |
|
| 147 | + * @return array |
|
| 148 | + */ |
|
| 149 | + private function get_youtube_videos( $embedded_videos ) { |
|
| 150 | + return array_filter( $embedded_videos, function ( $embedded_video ) { |
|
| 151 | + /** |
|
| 152 | + * it should have youtube.com or youtu.be in the url |
|
| 153 | + * |
|
| 154 | + * @param $embedded_video Embedded_Video |
|
| 155 | + */ |
|
| 156 | + $video_url = $embedded_video->get_url(); |
|
| 157 | + |
|
| 158 | + return strpos( $video_url, "youtube.com" ) !== false || |
|
| 159 | + strpos( $video_url, "youtu.be" ) !== false; |
|
| 160 | + } ); |
|
| 161 | + } |
|
| 162 | + |
|
| 163 | + /** |
|
| 164 | + * @param $embedded_videos |
|
| 165 | + * |
|
| 166 | + * @return array |
|
| 167 | + */ |
|
| 168 | + private function get_vimeo_videos( $embedded_videos ) { |
|
| 169 | + return array_filter( $embedded_videos, function ( $embedded_video ) { |
|
| 170 | + /** |
|
| 171 | + * it should have vimeo.com in the url |
|
| 172 | + * |
|
| 173 | + * @param $embedded_video Embedded_Video |
|
| 174 | + */ |
|
| 175 | + $video_url = $embedded_video->get_url(); |
|
| 176 | + |
|
| 177 | + return strpos( $video_url, "vimeo.com" ) !== false; |
|
| 178 | + } ); |
|
| 179 | + } |
|
| 180 | 180 | |
| 181 | 181 | } |
| 182 | 182 | \ No newline at end of file |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | class Post_Filter { |
| 18 | 18 | |
| 19 | 19 | public function init() { |
| 20 | - add_action( 'save_post', array( $this, 'save_post' ), 10, 3 ); |
|
| 20 | + add_action('save_post', array($this, 'save_post'), 10, 3); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -25,30 +25,30 @@ discard block |
||
| 25 | 25 | * @param $post \WP_Post |
| 26 | 26 | * @param $update bool |
| 27 | 27 | */ |
| 28 | - public function save_post( $post_id, $post, $update ) { |
|
| 28 | + public function save_post($post_id, $post, $update) { |
|
| 29 | 29 | |
| 30 | - if ( wp_is_post_revision( $post_id ) || wp_is_post_autosave( $post_id ) ) { |
|
| 30 | + if (wp_is_post_revision($post_id) || wp_is_post_autosave($post_id)) { |
|
| 31 | 31 | return; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - $this->process_video_urls( $post, $post_id ); |
|
| 34 | + $this->process_video_urls($post, $post_id); |
|
| 35 | 35 | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| 39 | - private function get_data_for_videos( $embedded_videos ) { |
|
| 39 | + private function get_data_for_videos($embedded_videos) { |
|
| 40 | 40 | |
| 41 | - $youtube_videos = $this->get_youtube_videos( $embedded_videos ); |
|
| 41 | + $youtube_videos = $this->get_youtube_videos($embedded_videos); |
|
| 42 | 42 | |
| 43 | - $youtube_provider = Provider_Factory::get_provider( Provider_Factory::YOUTUBE ); |
|
| 44 | - $youtube_videos = $youtube_provider->get_videos_data( $youtube_videos ); |
|
| 43 | + $youtube_provider = Provider_Factory::get_provider(Provider_Factory::YOUTUBE); |
|
| 44 | + $youtube_videos = $youtube_provider->get_videos_data($youtube_videos); |
|
| 45 | 45 | |
| 46 | - $vimeo_videos = $this->get_vimeo_videos( $embedded_videos ); |
|
| 46 | + $vimeo_videos = $this->get_vimeo_videos($embedded_videos); |
|
| 47 | 47 | |
| 48 | - $vimeo_provider = Provider_Factory::get_provider( Provider_Factory::VIMEO ); |
|
| 49 | - $vimeo_videos = $vimeo_provider->get_videos_data( $vimeo_videos ); |
|
| 48 | + $vimeo_provider = Provider_Factory::get_provider(Provider_Factory::VIMEO); |
|
| 49 | + $vimeo_videos = $vimeo_provider->get_videos_data($vimeo_videos); |
|
| 50 | 50 | |
| 51 | - return array_merge( $youtube_videos, $vimeo_videos ); |
|
| 51 | + return array_merge($youtube_videos, $vimeo_videos); |
|
| 52 | 52 | |
| 53 | 53 | } |
| 54 | 54 | |
@@ -57,10 +57,10 @@ discard block |
||
| 57 | 57 | * @param $post_id int |
| 58 | 58 | * @param $embedded_videos array<Embedded_Video> |
| 59 | 59 | */ |
| 60 | - private function remove_videos_from_store_if_not_present_in_content( $storage, $post_id, $embedded_videos ) { |
|
| 60 | + private function remove_videos_from_store_if_not_present_in_content($storage, $post_id, $embedded_videos) { |
|
| 61 | 61 | |
| 62 | - $videos_to_be_deleted = $this->get_videos_to_be_deleted( $storage, $post_id, $embedded_videos ); |
|
| 63 | - $storage->remove_videos( $videos_to_be_deleted, $post_id ); |
|
| 62 | + $videos_to_be_deleted = $this->get_videos_to_be_deleted($storage, $post_id, $embedded_videos); |
|
| 63 | + $storage->remove_videos($videos_to_be_deleted, $post_id); |
|
| 64 | 64 | |
| 65 | 65 | } |
| 66 | 66 | |
@@ -71,20 +71,20 @@ discard block |
||
| 71 | 71 | * |
| 72 | 72 | * @return array |
| 73 | 73 | */ |
| 74 | - private function get_videos_to_be_deleted( Storage $storage, $post_id, array $embedded_videos ) { |
|
| 75 | - $videos_in_store = $storage->get_all_videos( $post_id ); |
|
| 76 | - $embedded_video_urls = array_map( function ( $embedded_video ) { |
|
| 74 | + private function get_videos_to_be_deleted(Storage $storage, $post_id, array $embedded_videos) { |
|
| 75 | + $videos_in_store = $storage->get_all_videos($post_id); |
|
| 76 | + $embedded_video_urls = array_map(function($embedded_video) { |
|
| 77 | 77 | /** |
| 78 | 78 | * @var $embedded_video Embedded_Video |
| 79 | 79 | */ |
| 80 | 80 | return $embedded_video->get_url(); |
| 81 | - }, $embedded_videos ); |
|
| 81 | + }, $embedded_videos); |
|
| 82 | 82 | |
| 83 | - return array_filter( $videos_in_store, function ( $video ) use ( $embedded_video_urls ) { |
|
| 83 | + return array_filter($videos_in_store, function($video) use ($embedded_video_urls) { |
|
| 84 | 84 | /** |
| 85 | 85 | * @var $video Video |
| 86 | 86 | */ |
| 87 | - return ! in_array( $video->id, $embedded_video_urls ); |
|
| 87 | + return ! in_array($video->id, $embedded_video_urls); |
|
| 88 | 88 | } ); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -92,34 +92,34 @@ discard block |
||
| 92 | 92 | * @param \WP_Post $post |
| 93 | 93 | * @param $post_id |
| 94 | 94 | */ |
| 95 | - private function process_video_urls( \WP_Post $post, $post_id ) { |
|
| 95 | + private function process_video_urls(\WP_Post $post, $post_id) { |
|
| 96 | 96 | |
| 97 | - $parser = Parser_Factory::get_parser_from_content( $post->post_content ); |
|
| 97 | + $parser = Parser_Factory::get_parser_from_content($post->post_content); |
|
| 98 | 98 | |
| 99 | - $embedded_videos = $parser->get_videos( $post_id ); |
|
| 99 | + $embedded_videos = $parser->get_videos($post_id); |
|
| 100 | 100 | |
| 101 | 101 | $storage = Video_Storage_Factory::get_storage(); |
| 102 | 102 | |
| 103 | 103 | // Before sending api requests we need to check if there are any videos in |
| 104 | 104 | // store which is not present on post content, remove them if there are |
| 105 | 105 | // any |
| 106 | - $this->remove_videos_from_store_if_not_present_in_content( $storage, $post_id, $embedded_videos ); |
|
| 106 | + $this->remove_videos_from_store_if_not_present_in_content($storage, $post_id, $embedded_videos); |
|
| 107 | 107 | |
| 108 | - $embedded_videos = $this->get_videos_without_existing_data( $storage, $post_id, $embedded_videos ); |
|
| 108 | + $embedded_videos = $this->get_videos_without_existing_data($storage, $post_id, $embedded_videos); |
|
| 109 | 109 | |
| 110 | 110 | // Return early after removing all the videos. |
| 111 | - if ( ! $embedded_videos ) { |
|
| 111 | + if ( ! $embedded_videos) { |
|
| 112 | 112 | return; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - $videos = $this->get_data_for_videos( $embedded_videos ); |
|
| 115 | + $videos = $this->get_data_for_videos($embedded_videos); |
|
| 116 | 116 | |
| 117 | - if ( ! $videos ) { |
|
| 117 | + if ( ! $videos) { |
|
| 118 | 118 | return; |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - foreach ( $videos as $video ) { |
|
| 122 | - $storage->add_video( $post_id, $video ); |
|
| 121 | + foreach ($videos as $video) { |
|
| 122 | + $storage->add_video($post_id, $video); |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | |
@@ -130,14 +130,14 @@ discard block |
||
| 130 | 130 | * |
| 131 | 131 | * @return array<Embedded_Video> Return array of embedded videos which are not in store. |
| 132 | 132 | */ |
| 133 | - private function get_videos_without_existing_data( $storage, $post_id, $embedded_videos ) { |
|
| 134 | - $videos_in_store = $storage->get_all_videos( $post_id ); |
|
| 135 | - $video_ids_in_store = array_map( function ( $video ) { |
|
| 133 | + private function get_videos_without_existing_data($storage, $post_id, $embedded_videos) { |
|
| 134 | + $videos_in_store = $storage->get_all_videos($post_id); |
|
| 135 | + $video_ids_in_store = array_map(function($video) { |
|
| 136 | 136 | return $video->id; |
| 137 | - }, $videos_in_store ); |
|
| 137 | + }, $videos_in_store); |
|
| 138 | 138 | |
| 139 | - return array_filter( $embedded_videos, function ( $embedded_video ) use ( $video_ids_in_store ) { |
|
| 140 | - return ! in_array( $embedded_video->get_url(), $video_ids_in_store ); |
|
| 139 | + return array_filter($embedded_videos, function($embedded_video) use ($video_ids_in_store) { |
|
| 140 | + return ! in_array($embedded_video->get_url(), $video_ids_in_store); |
|
| 141 | 141 | } ); |
| 142 | 142 | } |
| 143 | 143 | |
@@ -146,8 +146,8 @@ discard block |
||
| 146 | 146 | * |
| 147 | 147 | * @return array |
| 148 | 148 | */ |
| 149 | - private function get_youtube_videos( $embedded_videos ) { |
|
| 150 | - return array_filter( $embedded_videos, function ( $embedded_video ) { |
|
| 149 | + private function get_youtube_videos($embedded_videos) { |
|
| 150 | + return array_filter($embedded_videos, function($embedded_video) { |
|
| 151 | 151 | /** |
| 152 | 152 | * it should have youtube.com or youtu.be in the url |
| 153 | 153 | * |
@@ -155,8 +155,8 @@ discard block |
||
| 155 | 155 | */ |
| 156 | 156 | $video_url = $embedded_video->get_url(); |
| 157 | 157 | |
| 158 | - return strpos( $video_url, "youtube.com" ) !== false || |
|
| 159 | - strpos( $video_url, "youtu.be" ) !== false; |
|
| 158 | + return strpos($video_url, "youtube.com") !== false || |
|
| 159 | + strpos($video_url, "youtu.be") !== false; |
|
| 160 | 160 | } ); |
| 161 | 161 | } |
| 162 | 162 | |
@@ -165,8 +165,8 @@ discard block |
||
| 165 | 165 | * |
| 166 | 166 | * @return array |
| 167 | 167 | */ |
| 168 | - private function get_vimeo_videos( $embedded_videos ) { |
|
| 169 | - return array_filter( $embedded_videos, function ( $embedded_video ) { |
|
| 168 | + private function get_vimeo_videos($embedded_videos) { |
|
| 169 | + return array_filter($embedded_videos, function($embedded_video) { |
|
| 170 | 170 | /** |
| 171 | 171 | * it should have vimeo.com in the url |
| 172 | 172 | * |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | $video_url = $embedded_video->get_url(); |
| 176 | 176 | |
| 177 | - return strpos( $video_url, "vimeo.com" ) !== false; |
|
| 177 | + return strpos($video_url, "vimeo.com") !== false; |
|
| 178 | 178 | } ); |
| 179 | 179 | } |
| 180 | 180 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | /** |
| 20 | 20 | * Jsonld constructor. |
| 21 | 21 | * |
| 22 | - * @param $video_storage Storage |
|
| 22 | + * @param \Wordlift\Videoobject\Data\Video_Storage\Meta_Storage $video_storage Storage |
|
| 23 | 23 | */ |
| 24 | 24 | public function __construct( $video_storage ) { |
| 25 | 25 | add_action( 'wl_post_jsonld', array( $this, 'wl_post_jsonld' ), 10, 3 ); |
@@ -11,152 +11,152 @@ |
||
| 11 | 11 | use Wordlift\Videoobject\Data\Video_Storage\Storage; |
| 12 | 12 | |
| 13 | 13 | class Jsonld { |
| 14 | - /** |
|
| 15 | - * @var Storage |
|
| 16 | - */ |
|
| 17 | - private $video_storage; |
|
| 18 | - |
|
| 19 | - /** |
|
| 20 | - * Jsonld constructor. |
|
| 21 | - * |
|
| 22 | - * @param $video_storage Storage |
|
| 23 | - */ |
|
| 24 | - public function __construct( $video_storage ) { |
|
| 25 | - add_action( 'wl_post_jsonld', array( $this, 'wl_post_jsonld' ), 10, 3 ); |
|
| 26 | - add_action( 'wl_after_get_jsonld', array( $this, 'wl_after_get_jsonld' ), 10, 3 ); |
|
| 27 | - $this->video_storage = $video_storage; |
|
| 28 | - } |
|
| 29 | - |
|
| 30 | - |
|
| 31 | - public function wl_after_get_jsonld( $jsonld, $post_id, $context ) { |
|
| 32 | - if ( 0 === count( $jsonld ) ) { |
|
| 33 | - return $jsonld; |
|
| 34 | - } |
|
| 35 | - $current_item = $jsonld[0]; |
|
| 36 | - |
|
| 37 | - if ( ! array_key_exists( '@type', $current_item ) ) { |
|
| 38 | - // Cant determine type return early. |
|
| 39 | - return $jsonld; |
|
| 40 | - } |
|
| 41 | - |
|
| 42 | - $type = $current_item['@type']; |
|
| 43 | - if ( ( is_string( $type ) && $type === 'Article' ) || |
|
| 44 | - ( is_array( $type ) && in_array( 'Article', $type ) ) ) { |
|
| 45 | - return $jsonld; |
|
| 46 | - } |
|
| 47 | - |
|
| 48 | - $videos_jsonld = $this->get_videos_jsonld( $post_id ); |
|
| 49 | - if ( 0 === count( $videos_jsonld ) ) { |
|
| 50 | - return $jsonld; |
|
| 51 | - } |
|
| 52 | - |
|
| 53 | - return array_merge( $jsonld, $videos_jsonld ); |
|
| 54 | - } |
|
| 55 | - |
|
| 56 | - /** |
|
| 57 | - * @param $existing_video_data string | array associative or sequential array. |
|
| 58 | - * @param $new_video_data array Sequential array. |
|
| 59 | - * |
|
| 60 | - * @return array |
|
| 61 | - */ |
|
| 62 | - private function merge_video_data( $existing_video_data, $new_video_data ) { |
|
| 63 | - if ( ! is_array( $existing_video_data ) ) { |
|
| 64 | - $new_video_data[] = $existing_video_data; |
|
| 65 | - |
|
| 66 | - return $new_video_data; |
|
| 67 | - } |
|
| 68 | - |
|
| 69 | - if ( $this->is_associative_array( $existing_video_data ) ) { |
|
| 70 | - $new_video_data[] = $existing_video_data; |
|
| 71 | - |
|
| 72 | - return $new_video_data; |
|
| 73 | - } |
|
| 74 | - |
|
| 75 | - return array_merge( $existing_video_data, $new_video_data ); |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - public function wl_post_jsonld( $jsonld, $post_id, $references ) { |
|
| 79 | - |
|
| 80 | - $video_jsonld = $this->get_videos_jsonld( $post_id ); |
|
| 81 | - if ( count( $video_jsonld ) === 0 ) { |
|
| 82 | - return $jsonld; |
|
| 83 | - } |
|
| 84 | - // Before adding the video jsonld check if the key |
|
| 85 | - // is present and additional data might be present, |
|
| 86 | - // if not present just add the data and return early. |
|
| 87 | - if ( ! array_key_exists( 'video', $jsonld ) ) { |
|
| 88 | - $jsonld['video'] = $video_jsonld; |
|
| 89 | - |
|
| 90 | - return $jsonld; |
|
| 91 | - } |
|
| 92 | - |
|
| 93 | - // since key exists, we need to merge the data based on type. |
|
| 94 | - $previous_video_data = $jsonld['video']; |
|
| 95 | - $jsonld['video'] = $this->merge_video_data( $previous_video_data, $video_jsonld ); |
|
| 96 | - |
|
| 97 | - return $jsonld; |
|
| 98 | - } |
|
| 99 | - |
|
| 100 | - |
|
| 101 | - /** |
|
| 102 | - * @param $post_id int Post id. |
|
| 103 | - * |
|
| 104 | - * @return array |
|
| 105 | - */ |
|
| 106 | - public function get_videos_jsonld( $post_id ) { |
|
| 107 | - |
|
| 108 | - $videos = $this->video_storage->get_all_videos( $post_id ); |
|
| 109 | - |
|
| 110 | - $jsonld = array(); |
|
| 111 | - |
|
| 112 | - foreach ( $videos as $video ) { |
|
| 113 | - /** |
|
| 114 | - * @var $video Video |
|
| 115 | - */ |
|
| 116 | - $single_jsonld = array( |
|
| 117 | - '@type' => 'VideoObject', |
|
| 118 | - 'name' => $video->name, |
|
| 119 | - 'description' => $video->description, |
|
| 120 | - 'contentUrl' => $video->content_url, |
|
| 121 | - 'embedUrl' => $video->embed_url, |
|
| 122 | - 'uploadDate' => $video->upload_date, |
|
| 123 | - 'thumbnailUrl' => $video->thumbnail_urls, |
|
| 124 | - 'duration' => $video->duration, |
|
| 125 | - ); |
|
| 126 | - |
|
| 127 | - if ( $video->views ) { |
|
| 128 | - $single_jsonld['interactionStatistic'] = array( |
|
| 129 | - '@type' => 'InteractionCounter', |
|
| 130 | - 'interactionType' => array( |
|
| 131 | - '@type' => 'http://schema.org/WatchAction' |
|
| 132 | - ), |
|
| 133 | - 'userInteractionCount' => $video->views |
|
| 134 | - ); |
|
| 135 | - } |
|
| 136 | - |
|
| 137 | - if ( $video->is_live_video ) { |
|
| 138 | - $single_jsonld['publication'] = array( |
|
| 139 | - '@type' => 'BroadcastEvent', |
|
| 140 | - 'isLiveBroadcast' => true, |
|
| 141 | - 'startDate' => $video->live_video_start_date, |
|
| 142 | - 'endDate' => $video->live_video_end_date |
|
| 143 | - ); |
|
| 144 | - } |
|
| 145 | - |
|
| 146 | - $jsonld[] = $single_jsonld; |
|
| 147 | - } |
|
| 148 | - |
|
| 149 | - return $jsonld; |
|
| 150 | - } |
|
| 151 | - |
|
| 152 | - |
|
| 153 | - private function is_associative_array( $arr ) { |
|
| 154 | - if ( array() === $arr ) { |
|
| 155 | - return false; |
|
| 156 | - } |
|
| 157 | - |
|
| 158 | - return array_keys( $arr ) !== range( 0, count( $arr ) - 1 ); |
|
| 159 | - } |
|
| 14 | + /** |
|
| 15 | + * @var Storage |
|
| 16 | + */ |
|
| 17 | + private $video_storage; |
|
| 18 | + |
|
| 19 | + /** |
|
| 20 | + * Jsonld constructor. |
|
| 21 | + * |
|
| 22 | + * @param $video_storage Storage |
|
| 23 | + */ |
|
| 24 | + public function __construct( $video_storage ) { |
|
| 25 | + add_action( 'wl_post_jsonld', array( $this, 'wl_post_jsonld' ), 10, 3 ); |
|
| 26 | + add_action( 'wl_after_get_jsonld', array( $this, 'wl_after_get_jsonld' ), 10, 3 ); |
|
| 27 | + $this->video_storage = $video_storage; |
|
| 28 | + } |
|
| 29 | + |
|
| 30 | + |
|
| 31 | + public function wl_after_get_jsonld( $jsonld, $post_id, $context ) { |
|
| 32 | + if ( 0 === count( $jsonld ) ) { |
|
| 33 | + return $jsonld; |
|
| 34 | + } |
|
| 35 | + $current_item = $jsonld[0]; |
|
| 36 | + |
|
| 37 | + if ( ! array_key_exists( '@type', $current_item ) ) { |
|
| 38 | + // Cant determine type return early. |
|
| 39 | + return $jsonld; |
|
| 40 | + } |
|
| 41 | + |
|
| 42 | + $type = $current_item['@type']; |
|
| 43 | + if ( ( is_string( $type ) && $type === 'Article' ) || |
|
| 44 | + ( is_array( $type ) && in_array( 'Article', $type ) ) ) { |
|
| 45 | + return $jsonld; |
|
| 46 | + } |
|
| 47 | + |
|
| 48 | + $videos_jsonld = $this->get_videos_jsonld( $post_id ); |
|
| 49 | + if ( 0 === count( $videos_jsonld ) ) { |
|
| 50 | + return $jsonld; |
|
| 51 | + } |
|
| 52 | + |
|
| 53 | + return array_merge( $jsonld, $videos_jsonld ); |
|
| 54 | + } |
|
| 55 | + |
|
| 56 | + /** |
|
| 57 | + * @param $existing_video_data string | array associative or sequential array. |
|
| 58 | + * @param $new_video_data array Sequential array. |
|
| 59 | + * |
|
| 60 | + * @return array |
|
| 61 | + */ |
|
| 62 | + private function merge_video_data( $existing_video_data, $new_video_data ) { |
|
| 63 | + if ( ! is_array( $existing_video_data ) ) { |
|
| 64 | + $new_video_data[] = $existing_video_data; |
|
| 65 | + |
|
| 66 | + return $new_video_data; |
|
| 67 | + } |
|
| 68 | + |
|
| 69 | + if ( $this->is_associative_array( $existing_video_data ) ) { |
|
| 70 | + $new_video_data[] = $existing_video_data; |
|
| 71 | + |
|
| 72 | + return $new_video_data; |
|
| 73 | + } |
|
| 74 | + |
|
| 75 | + return array_merge( $existing_video_data, $new_video_data ); |
|
| 76 | + } |
|
| 77 | + |
|
| 78 | + public function wl_post_jsonld( $jsonld, $post_id, $references ) { |
|
| 79 | + |
|
| 80 | + $video_jsonld = $this->get_videos_jsonld( $post_id ); |
|
| 81 | + if ( count( $video_jsonld ) === 0 ) { |
|
| 82 | + return $jsonld; |
|
| 83 | + } |
|
| 84 | + // Before adding the video jsonld check if the key |
|
| 85 | + // is present and additional data might be present, |
|
| 86 | + // if not present just add the data and return early. |
|
| 87 | + if ( ! array_key_exists( 'video', $jsonld ) ) { |
|
| 88 | + $jsonld['video'] = $video_jsonld; |
|
| 89 | + |
|
| 90 | + return $jsonld; |
|
| 91 | + } |
|
| 92 | + |
|
| 93 | + // since key exists, we need to merge the data based on type. |
|
| 94 | + $previous_video_data = $jsonld['video']; |
|
| 95 | + $jsonld['video'] = $this->merge_video_data( $previous_video_data, $video_jsonld ); |
|
| 96 | + |
|
| 97 | + return $jsonld; |
|
| 98 | + } |
|
| 99 | + |
|
| 100 | + |
|
| 101 | + /** |
|
| 102 | + * @param $post_id int Post id. |
|
| 103 | + * |
|
| 104 | + * @return array |
|
| 105 | + */ |
|
| 106 | + public function get_videos_jsonld( $post_id ) { |
|
| 107 | + |
|
| 108 | + $videos = $this->video_storage->get_all_videos( $post_id ); |
|
| 109 | + |
|
| 110 | + $jsonld = array(); |
|
| 111 | + |
|
| 112 | + foreach ( $videos as $video ) { |
|
| 113 | + /** |
|
| 114 | + * @var $video Video |
|
| 115 | + */ |
|
| 116 | + $single_jsonld = array( |
|
| 117 | + '@type' => 'VideoObject', |
|
| 118 | + 'name' => $video->name, |
|
| 119 | + 'description' => $video->description, |
|
| 120 | + 'contentUrl' => $video->content_url, |
|
| 121 | + 'embedUrl' => $video->embed_url, |
|
| 122 | + 'uploadDate' => $video->upload_date, |
|
| 123 | + 'thumbnailUrl' => $video->thumbnail_urls, |
|
| 124 | + 'duration' => $video->duration, |
|
| 125 | + ); |
|
| 126 | + |
|
| 127 | + if ( $video->views ) { |
|
| 128 | + $single_jsonld['interactionStatistic'] = array( |
|
| 129 | + '@type' => 'InteractionCounter', |
|
| 130 | + 'interactionType' => array( |
|
| 131 | + '@type' => 'http://schema.org/WatchAction' |
|
| 132 | + ), |
|
| 133 | + 'userInteractionCount' => $video->views |
|
| 134 | + ); |
|
| 135 | + } |
|
| 136 | + |
|
| 137 | + if ( $video->is_live_video ) { |
|
| 138 | + $single_jsonld['publication'] = array( |
|
| 139 | + '@type' => 'BroadcastEvent', |
|
| 140 | + 'isLiveBroadcast' => true, |
|
| 141 | + 'startDate' => $video->live_video_start_date, |
|
| 142 | + 'endDate' => $video->live_video_end_date |
|
| 143 | + ); |
|
| 144 | + } |
|
| 145 | + |
|
| 146 | + $jsonld[] = $single_jsonld; |
|
| 147 | + } |
|
| 148 | + |
|
| 149 | + return $jsonld; |
|
| 150 | + } |
|
| 151 | + |
|
| 152 | + |
|
| 153 | + private function is_associative_array( $arr ) { |
|
| 154 | + if ( array() === $arr ) { |
|
| 155 | + return false; |
|
| 156 | + } |
|
| 157 | + |
|
| 158 | + return array_keys( $arr ) !== range( 0, count( $arr ) - 1 ); |
|
| 159 | + } |
|
| 160 | 160 | |
| 161 | 161 | |
| 162 | 162 | } |
@@ -21,36 +21,36 @@ discard block |
||
| 21 | 21 | * |
| 22 | 22 | * @param $video_storage Storage |
| 23 | 23 | */ |
| 24 | - public function __construct( $video_storage ) { |
|
| 25 | - add_action( 'wl_post_jsonld', array( $this, 'wl_post_jsonld' ), 10, 3 ); |
|
| 26 | - add_action( 'wl_after_get_jsonld', array( $this, 'wl_after_get_jsonld' ), 10, 3 ); |
|
| 24 | + public function __construct($video_storage) { |
|
| 25 | + add_action('wl_post_jsonld', array($this, 'wl_post_jsonld'), 10, 3); |
|
| 26 | + add_action('wl_after_get_jsonld', array($this, 'wl_after_get_jsonld'), 10, 3); |
|
| 27 | 27 | $this->video_storage = $video_storage; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
| 31 | - public function wl_after_get_jsonld( $jsonld, $post_id, $context ) { |
|
| 32 | - if ( 0 === count( $jsonld ) ) { |
|
| 31 | + public function wl_after_get_jsonld($jsonld, $post_id, $context) { |
|
| 32 | + if (0 === count($jsonld)) { |
|
| 33 | 33 | return $jsonld; |
| 34 | 34 | } |
| 35 | 35 | $current_item = $jsonld[0]; |
| 36 | 36 | |
| 37 | - if ( ! array_key_exists( '@type', $current_item ) ) { |
|
| 37 | + if ( ! array_key_exists('@type', $current_item)) { |
|
| 38 | 38 | // Cant determine type return early. |
| 39 | 39 | return $jsonld; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | $type = $current_item['@type']; |
| 43 | - if ( ( is_string( $type ) && $type === 'Article' ) || |
|
| 44 | - ( is_array( $type ) && in_array( 'Article', $type ) ) ) { |
|
| 43 | + if ((is_string($type) && $type === 'Article') || |
|
| 44 | + (is_array($type) && in_array('Article', $type))) { |
|
| 45 | 45 | return $jsonld; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - $videos_jsonld = $this->get_videos_jsonld( $post_id ); |
|
| 49 | - if ( 0 === count( $videos_jsonld ) ) { |
|
| 48 | + $videos_jsonld = $this->get_videos_jsonld($post_id); |
|
| 49 | + if (0 === count($videos_jsonld)) { |
|
| 50 | 50 | return $jsonld; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - return array_merge( $jsonld, $videos_jsonld ); |
|
| 53 | + return array_merge($jsonld, $videos_jsonld); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -59,32 +59,32 @@ discard block |
||
| 59 | 59 | * |
| 60 | 60 | * @return array |
| 61 | 61 | */ |
| 62 | - private function merge_video_data( $existing_video_data, $new_video_data ) { |
|
| 63 | - if ( ! is_array( $existing_video_data ) ) { |
|
| 62 | + private function merge_video_data($existing_video_data, $new_video_data) { |
|
| 63 | + if ( ! is_array($existing_video_data)) { |
|
| 64 | 64 | $new_video_data[] = $existing_video_data; |
| 65 | 65 | |
| 66 | 66 | return $new_video_data; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - if ( $this->is_associative_array( $existing_video_data ) ) { |
|
| 69 | + if ($this->is_associative_array($existing_video_data)) { |
|
| 70 | 70 | $new_video_data[] = $existing_video_data; |
| 71 | 71 | |
| 72 | 72 | return $new_video_data; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - return array_merge( $existing_video_data, $new_video_data ); |
|
| 75 | + return array_merge($existing_video_data, $new_video_data); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - public function wl_post_jsonld( $jsonld, $post_id, $references ) { |
|
| 78 | + public function wl_post_jsonld($jsonld, $post_id, $references) { |
|
| 79 | 79 | |
| 80 | - $video_jsonld = $this->get_videos_jsonld( $post_id ); |
|
| 81 | - if ( count( $video_jsonld ) === 0 ) { |
|
| 80 | + $video_jsonld = $this->get_videos_jsonld($post_id); |
|
| 81 | + if (count($video_jsonld) === 0) { |
|
| 82 | 82 | return $jsonld; |
| 83 | 83 | } |
| 84 | 84 | // Before adding the video jsonld check if the key |
| 85 | 85 | // is present and additional data might be present, |
| 86 | 86 | // if not present just add the data and return early. |
| 87 | - if ( ! array_key_exists( 'video', $jsonld ) ) { |
|
| 87 | + if ( ! array_key_exists('video', $jsonld)) { |
|
| 88 | 88 | $jsonld['video'] = $video_jsonld; |
| 89 | 89 | |
| 90 | 90 | return $jsonld; |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | // since key exists, we need to merge the data based on type. |
| 94 | 94 | $previous_video_data = $jsonld['video']; |
| 95 | - $jsonld['video'] = $this->merge_video_data( $previous_video_data, $video_jsonld ); |
|
| 95 | + $jsonld['video'] = $this->merge_video_data($previous_video_data, $video_jsonld); |
|
| 96 | 96 | |
| 97 | 97 | return $jsonld; |
| 98 | 98 | } |
@@ -103,13 +103,13 @@ discard block |
||
| 103 | 103 | * |
| 104 | 104 | * @return array |
| 105 | 105 | */ |
| 106 | - public function get_videos_jsonld( $post_id ) { |
|
| 106 | + public function get_videos_jsonld($post_id) { |
|
| 107 | 107 | |
| 108 | - $videos = $this->video_storage->get_all_videos( $post_id ); |
|
| 108 | + $videos = $this->video_storage->get_all_videos($post_id); |
|
| 109 | 109 | |
| 110 | 110 | $jsonld = array(); |
| 111 | 111 | |
| 112 | - foreach ( $videos as $video ) { |
|
| 112 | + foreach ($videos as $video) { |
|
| 113 | 113 | /** |
| 114 | 114 | * @var $video Video |
| 115 | 115 | */ |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | 'duration' => $video->duration, |
| 125 | 125 | ); |
| 126 | 126 | |
| 127 | - if ( $video->views ) { |
|
| 127 | + if ($video->views) { |
|
| 128 | 128 | $single_jsonld['interactionStatistic'] = array( |
| 129 | 129 | '@type' => 'InteractionCounter', |
| 130 | 130 | 'interactionType' => array( |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | ); |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - if ( $video->is_live_video ) { |
|
| 137 | + if ($video->is_live_video) { |
|
| 138 | 138 | $single_jsonld['publication'] = array( |
| 139 | 139 | '@type' => 'BroadcastEvent', |
| 140 | 140 | 'isLiveBroadcast' => true, |
@@ -150,12 +150,12 @@ discard block |
||
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
| 153 | - private function is_associative_array( $arr ) { |
|
| 154 | - if ( array() === $arr ) { |
|
| 153 | + private function is_associative_array($arr) { |
|
| 154 | + if (array() === $arr) { |
|
| 155 | 155 | return false; |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | - return array_keys( $arr ) !== range( 0, count( $arr ) - 1 ); |
|
| 158 | + return array_keys($arr) !== range(0, count($arr) - 1); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | - * @param $response_body string |
|
| 55 | + * @param string $response_body string |
|
| 56 | 56 | * |
| 57 | 57 | * @return array<Video> |
| 58 | 58 | */ |
@@ -12,130 +12,130 @@ |
||
| 12 | 12 | class Youtube extends Api_Provider { |
| 13 | 13 | |
| 14 | 14 | |
| 15 | - const YT_API_FIELD_NAME = '__wl_video_object_youtube_api_key'; |
|
| 16 | - |
|
| 17 | - private static function get_thumbnails( $api_thumbnail_data ) { |
|
| 18 | - return array_map( function ( $item ) { |
|
| 19 | - return $item['url']; |
|
| 20 | - |
|
| 21 | - }, $api_thumbnail_data ); |
|
| 22 | - } |
|
| 23 | - |
|
| 24 | - |
|
| 25 | - public function get_videos_data( $videos ) { |
|
| 26 | - $urls = array_map( function ( $video ) { |
|
| 27 | - /** |
|
| 28 | - * @param $video Video |
|
| 29 | - */ |
|
| 30 | - return $video->get_url(); |
|
| 31 | - }, $videos ); |
|
| 32 | - |
|
| 33 | - return $this->get_data( $urls ); |
|
| 34 | - |
|
| 35 | - } |
|
| 36 | - |
|
| 37 | - |
|
| 38 | - /** |
|
| 39 | - * @param $video_urls |
|
| 40 | - * |
|
| 41 | - * @return bool | array<Video> |
|
| 42 | - */ |
|
| 43 | - public function get_data( $video_urls ) { |
|
| 44 | - // extract ids from the url list. |
|
| 45 | - if ( ! is_array( $video_urls ) ) { |
|
| 46 | - return array(); |
|
| 47 | - } |
|
| 48 | - $response_body = $this->api_client->get_data( $video_urls ); |
|
| 49 | - |
|
| 50 | - return $this->parse_youtube_video_data_from_response( $response_body ); |
|
| 51 | - } |
|
| 52 | - |
|
| 53 | - |
|
| 54 | - /** |
|
| 55 | - * @param $response_body string |
|
| 56 | - * |
|
| 57 | - * @return array<Video> |
|
| 58 | - */ |
|
| 59 | - private function parse_youtube_video_data_from_response( $response_body ) { |
|
| 60 | - $result = json_decode( $response_body, true ); |
|
| 61 | - if ( ! is_array( $result ) ) { |
|
| 62 | - // Return empty array since the response body is invalid. |
|
| 63 | - return array(); |
|
| 64 | - } |
|
| 65 | - if ( ! array_key_exists( 'items', $result ) ) { |
|
| 66 | - return array(); |
|
| 67 | - } |
|
| 68 | - $videos_json_data = $result['items']; |
|
| 69 | - $videos = array(); |
|
| 70 | - foreach ( $videos_json_data as $single_video_json_data ) { |
|
| 71 | - $videos[] = self::create_video_from_youtube_data( $single_video_json_data ); |
|
| 72 | - } |
|
| 73 | - |
|
| 74 | - return $videos; |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - public static function create_video_from_youtube_data( $video_data ) { |
|
| 78 | - |
|
| 79 | - $video = new Video(); |
|
| 80 | - if ( array_key_exists( 'contentDetails', $video_data ) ) { |
|
| 81 | - $video->duration = $video_data['contentDetails']['duration']; |
|
| 82 | - } |
|
| 83 | - |
|
| 84 | - if ( array_key_exists( 'id', $video_data ) ) { |
|
| 85 | - $video_id = $video_data['id']; |
|
| 86 | - $video->embed_url = "https://www.youtube.com/embed/${video_id}"; |
|
| 87 | - $video->content_url = "https://www.youtube.com/watch?v=${video_id}"; |
|
| 88 | - } |
|
| 89 | - if ( ! array_key_exists( 'snippet', $video_data ) ) { |
|
| 90 | - return false; |
|
| 91 | - } |
|
| 92 | - |
|
| 93 | - $video->name = $video_data['snippet']['title']; |
|
| 94 | - $video->description = $video_data['snippet']['description']; |
|
| 95 | - |
|
| 96 | - /** |
|
| 97 | - * @since 3.30.0 |
|
| 98 | - * Use title as fallback if description is not present. |
|
| 99 | - */ |
|
| 100 | - if ( ! $video->description ) { |
|
| 101 | - $video->description = $video->name; |
|
| 102 | - } |
|
| 103 | - |
|
| 104 | - $video->upload_date = $video_data['snippet']['publishedAt']; |
|
| 105 | - |
|
| 106 | - if ( array_key_exists( 'thumbnails', $video_data['snippet'] ) ) { |
|
| 107 | - $api_thumbnail_data = array_values( $video_data['snippet']['thumbnails'] ); |
|
| 108 | - $video->thumbnail_urls = self::get_thumbnails( $api_thumbnail_data ); |
|
| 109 | - } |
|
| 110 | - |
|
| 111 | - if ( array_key_exists( 'statistics', $video_data ) |
|
| 112 | - && array_key_exists( 'viewCount', $video_data['statistics'] ) ) { |
|
| 113 | - $video->views = $video_data['statistics']['viewCount']; |
|
| 114 | - } |
|
| 115 | - |
|
| 116 | - if ( array_key_exists( 'liveStreamingDetails', $video_data ) && |
|
| 117 | - array_key_exists( 'scheduledStartTime', $video_data['liveStreamingDetails'] ) ) { |
|
| 118 | - $video->is_live_video = true; |
|
| 119 | - $video->live_video_start_date = $video_data['liveStreamingDetails']['scheduledStartTime']; |
|
| 120 | - try { |
|
| 121 | - $end_date = new \DateTime( $video->live_video_start_date ); |
|
| 122 | - /** |
|
| 123 | - * the google doc says : |
|
| 124 | - * It is required to provide the endDate once the video has finished and is no longer live. |
|
| 125 | - * If the expected endDate is unknown prior to the livestream starting, we recommend providing an approximate endDate. |
|
| 126 | - */ |
|
| 127 | - // we add 1 day to start date |
|
| 128 | - $end_date->add( new DateInterval( 'P1D' ) ); |
|
| 129 | - $video->live_video_end_date = $end_date->format( 'c' ); |
|
| 130 | - } catch ( \Exception $e ) { |
|
| 131 | - } |
|
| 132 | - } |
|
| 133 | - |
|
| 134 | - $video->id = $video->content_url; |
|
| 135 | - |
|
| 136 | - return $video; |
|
| 137 | - |
|
| 138 | - } |
|
| 15 | + const YT_API_FIELD_NAME = '__wl_video_object_youtube_api_key'; |
|
| 16 | + |
|
| 17 | + private static function get_thumbnails( $api_thumbnail_data ) { |
|
| 18 | + return array_map( function ( $item ) { |
|
| 19 | + return $item['url']; |
|
| 20 | + |
|
| 21 | + }, $api_thumbnail_data ); |
|
| 22 | + } |
|
| 23 | + |
|
| 24 | + |
|
| 25 | + public function get_videos_data( $videos ) { |
|
| 26 | + $urls = array_map( function ( $video ) { |
|
| 27 | + /** |
|
| 28 | + * @param $video Video |
|
| 29 | + */ |
|
| 30 | + return $video->get_url(); |
|
| 31 | + }, $videos ); |
|
| 32 | + |
|
| 33 | + return $this->get_data( $urls ); |
|
| 34 | + |
|
| 35 | + } |
|
| 36 | + |
|
| 37 | + |
|
| 38 | + /** |
|
| 39 | + * @param $video_urls |
|
| 40 | + * |
|
| 41 | + * @return bool | array<Video> |
|
| 42 | + */ |
|
| 43 | + public function get_data( $video_urls ) { |
|
| 44 | + // extract ids from the url list. |
|
| 45 | + if ( ! is_array( $video_urls ) ) { |
|
| 46 | + return array(); |
|
| 47 | + } |
|
| 48 | + $response_body = $this->api_client->get_data( $video_urls ); |
|
| 49 | + |
|
| 50 | + return $this->parse_youtube_video_data_from_response( $response_body ); |
|
| 51 | + } |
|
| 52 | + |
|
| 53 | + |
|
| 54 | + /** |
|
| 55 | + * @param $response_body string |
|
| 56 | + * |
|
| 57 | + * @return array<Video> |
|
| 58 | + */ |
|
| 59 | + private function parse_youtube_video_data_from_response( $response_body ) { |
|
| 60 | + $result = json_decode( $response_body, true ); |
|
| 61 | + if ( ! is_array( $result ) ) { |
|
| 62 | + // Return empty array since the response body is invalid. |
|
| 63 | + return array(); |
|
| 64 | + } |
|
| 65 | + if ( ! array_key_exists( 'items', $result ) ) { |
|
| 66 | + return array(); |
|
| 67 | + } |
|
| 68 | + $videos_json_data = $result['items']; |
|
| 69 | + $videos = array(); |
|
| 70 | + foreach ( $videos_json_data as $single_video_json_data ) { |
|
| 71 | + $videos[] = self::create_video_from_youtube_data( $single_video_json_data ); |
|
| 72 | + } |
|
| 73 | + |
|
| 74 | + return $videos; |
|
| 75 | + } |
|
| 76 | + |
|
| 77 | + public static function create_video_from_youtube_data( $video_data ) { |
|
| 78 | + |
|
| 79 | + $video = new Video(); |
|
| 80 | + if ( array_key_exists( 'contentDetails', $video_data ) ) { |
|
| 81 | + $video->duration = $video_data['contentDetails']['duration']; |
|
| 82 | + } |
|
| 83 | + |
|
| 84 | + if ( array_key_exists( 'id', $video_data ) ) { |
|
| 85 | + $video_id = $video_data['id']; |
|
| 86 | + $video->embed_url = "https://www.youtube.com/embed/${video_id}"; |
|
| 87 | + $video->content_url = "https://www.youtube.com/watch?v=${video_id}"; |
|
| 88 | + } |
|
| 89 | + if ( ! array_key_exists( 'snippet', $video_data ) ) { |
|
| 90 | + return false; |
|
| 91 | + } |
|
| 92 | + |
|
| 93 | + $video->name = $video_data['snippet']['title']; |
|
| 94 | + $video->description = $video_data['snippet']['description']; |
|
| 95 | + |
|
| 96 | + /** |
|
| 97 | + * @since 3.30.0 |
|
| 98 | + * Use title as fallback if description is not present. |
|
| 99 | + */ |
|
| 100 | + if ( ! $video->description ) { |
|
| 101 | + $video->description = $video->name; |
|
| 102 | + } |
|
| 103 | + |
|
| 104 | + $video->upload_date = $video_data['snippet']['publishedAt']; |
|
| 105 | + |
|
| 106 | + if ( array_key_exists( 'thumbnails', $video_data['snippet'] ) ) { |
|
| 107 | + $api_thumbnail_data = array_values( $video_data['snippet']['thumbnails'] ); |
|
| 108 | + $video->thumbnail_urls = self::get_thumbnails( $api_thumbnail_data ); |
|
| 109 | + } |
|
| 110 | + |
|
| 111 | + if ( array_key_exists( 'statistics', $video_data ) |
|
| 112 | + && array_key_exists( 'viewCount', $video_data['statistics'] ) ) { |
|
| 113 | + $video->views = $video_data['statistics']['viewCount']; |
|
| 114 | + } |
|
| 115 | + |
|
| 116 | + if ( array_key_exists( 'liveStreamingDetails', $video_data ) && |
|
| 117 | + array_key_exists( 'scheduledStartTime', $video_data['liveStreamingDetails'] ) ) { |
|
| 118 | + $video->is_live_video = true; |
|
| 119 | + $video->live_video_start_date = $video_data['liveStreamingDetails']['scheduledStartTime']; |
|
| 120 | + try { |
|
| 121 | + $end_date = new \DateTime( $video->live_video_start_date ); |
|
| 122 | + /** |
|
| 123 | + * the google doc says : |
|
| 124 | + * It is required to provide the endDate once the video has finished and is no longer live. |
|
| 125 | + * If the expected endDate is unknown prior to the livestream starting, we recommend providing an approximate endDate. |
|
| 126 | + */ |
|
| 127 | + // we add 1 day to start date |
|
| 128 | + $end_date->add( new DateInterval( 'P1D' ) ); |
|
| 129 | + $video->live_video_end_date = $end_date->format( 'c' ); |
|
| 130 | + } catch ( \Exception $e ) { |
|
| 131 | + } |
|
| 132 | + } |
|
| 133 | + |
|
| 134 | + $video->id = $video->content_url; |
|
| 135 | + |
|
| 136 | + return $video; |
|
| 137 | + |
|
| 138 | + } |
|
| 139 | 139 | |
| 140 | 140 | |
| 141 | 141 | } |
| 142 | 142 | \ No newline at end of file |
@@ -14,23 +14,23 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | const YT_API_FIELD_NAME = '__wl_video_object_youtube_api_key'; |
| 16 | 16 | |
| 17 | - private static function get_thumbnails( $api_thumbnail_data ) { |
|
| 18 | - return array_map( function ( $item ) { |
|
| 17 | + private static function get_thumbnails($api_thumbnail_data) { |
|
| 18 | + return array_map(function($item) { |
|
| 19 | 19 | return $item['url']; |
| 20 | 20 | |
| 21 | - }, $api_thumbnail_data ); |
|
| 21 | + }, $api_thumbnail_data); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | |
| 25 | - public function get_videos_data( $videos ) { |
|
| 26 | - $urls = array_map( function ( $video ) { |
|
| 25 | + public function get_videos_data($videos) { |
|
| 26 | + $urls = array_map(function($video) { |
|
| 27 | 27 | /** |
| 28 | 28 | * @param $video Video |
| 29 | 29 | */ |
| 30 | 30 | return $video->get_url(); |
| 31 | - }, $videos ); |
|
| 31 | + }, $videos); |
|
| 32 | 32 | |
| 33 | - return $this->get_data( $urls ); |
|
| 33 | + return $this->get_data($urls); |
|
| 34 | 34 | |
| 35 | 35 | } |
| 36 | 36 | |
@@ -40,14 +40,14 @@ discard block |
||
| 40 | 40 | * |
| 41 | 41 | * @return bool | array<Video> |
| 42 | 42 | */ |
| 43 | - public function get_data( $video_urls ) { |
|
| 43 | + public function get_data($video_urls) { |
|
| 44 | 44 | // extract ids from the url list. |
| 45 | - if ( ! is_array( $video_urls ) ) { |
|
| 45 | + if ( ! is_array($video_urls)) { |
|
| 46 | 46 | return array(); |
| 47 | 47 | } |
| 48 | - $response_body = $this->api_client->get_data( $video_urls ); |
|
| 48 | + $response_body = $this->api_client->get_data($video_urls); |
|
| 49 | 49 | |
| 50 | - return $this->parse_youtube_video_data_from_response( $response_body ); |
|
| 50 | + return $this->parse_youtube_video_data_from_response($response_body); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | |
@@ -56,37 +56,37 @@ discard block |
||
| 56 | 56 | * |
| 57 | 57 | * @return array<Video> |
| 58 | 58 | */ |
| 59 | - private function parse_youtube_video_data_from_response( $response_body ) { |
|
| 60 | - $result = json_decode( $response_body, true ); |
|
| 61 | - if ( ! is_array( $result ) ) { |
|
| 59 | + private function parse_youtube_video_data_from_response($response_body) { |
|
| 60 | + $result = json_decode($response_body, true); |
|
| 61 | + if ( ! is_array($result)) { |
|
| 62 | 62 | // Return empty array since the response body is invalid. |
| 63 | 63 | return array(); |
| 64 | 64 | } |
| 65 | - if ( ! array_key_exists( 'items', $result ) ) { |
|
| 65 | + if ( ! array_key_exists('items', $result)) { |
|
| 66 | 66 | return array(); |
| 67 | 67 | } |
| 68 | 68 | $videos_json_data = $result['items']; |
| 69 | 69 | $videos = array(); |
| 70 | - foreach ( $videos_json_data as $single_video_json_data ) { |
|
| 71 | - $videos[] = self::create_video_from_youtube_data( $single_video_json_data ); |
|
| 70 | + foreach ($videos_json_data as $single_video_json_data) { |
|
| 71 | + $videos[] = self::create_video_from_youtube_data($single_video_json_data); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | return $videos; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - public static function create_video_from_youtube_data( $video_data ) { |
|
| 77 | + public static function create_video_from_youtube_data($video_data) { |
|
| 78 | 78 | |
| 79 | 79 | $video = new Video(); |
| 80 | - if ( array_key_exists( 'contentDetails', $video_data ) ) { |
|
| 80 | + if (array_key_exists('contentDetails', $video_data)) { |
|
| 81 | 81 | $video->duration = $video_data['contentDetails']['duration']; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - if ( array_key_exists( 'id', $video_data ) ) { |
|
| 84 | + if (array_key_exists('id', $video_data)) { |
|
| 85 | 85 | $video_id = $video_data['id']; |
| 86 | 86 | $video->embed_url = "https://www.youtube.com/embed/${video_id}"; |
| 87 | 87 | $video->content_url = "https://www.youtube.com/watch?v=${video_id}"; |
| 88 | 88 | } |
| 89 | - if ( ! array_key_exists( 'snippet', $video_data ) ) { |
|
| 89 | + if ( ! array_key_exists('snippet', $video_data)) { |
|
| 90 | 90 | return false; |
| 91 | 91 | } |
| 92 | 92 | |
@@ -97,37 +97,37 @@ discard block |
||
| 97 | 97 | * @since 3.30.0 |
| 98 | 98 | * Use title as fallback if description is not present. |
| 99 | 99 | */ |
| 100 | - if ( ! $video->description ) { |
|
| 100 | + if ( ! $video->description) { |
|
| 101 | 101 | $video->description = $video->name; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | $video->upload_date = $video_data['snippet']['publishedAt']; |
| 105 | 105 | |
| 106 | - if ( array_key_exists( 'thumbnails', $video_data['snippet'] ) ) { |
|
| 107 | - $api_thumbnail_data = array_values( $video_data['snippet']['thumbnails'] ); |
|
| 108 | - $video->thumbnail_urls = self::get_thumbnails( $api_thumbnail_data ); |
|
| 106 | + if (array_key_exists('thumbnails', $video_data['snippet'])) { |
|
| 107 | + $api_thumbnail_data = array_values($video_data['snippet']['thumbnails']); |
|
| 108 | + $video->thumbnail_urls = self::get_thumbnails($api_thumbnail_data); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - if ( array_key_exists( 'statistics', $video_data ) |
|
| 112 | - && array_key_exists( 'viewCount', $video_data['statistics'] ) ) { |
|
| 111 | + if (array_key_exists('statistics', $video_data) |
|
| 112 | + && array_key_exists('viewCount', $video_data['statistics'])) { |
|
| 113 | 113 | $video->views = $video_data['statistics']['viewCount']; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - if ( array_key_exists( 'liveStreamingDetails', $video_data ) && |
|
| 117 | - array_key_exists( 'scheduledStartTime', $video_data['liveStreamingDetails'] ) ) { |
|
| 116 | + if (array_key_exists('liveStreamingDetails', $video_data) && |
|
| 117 | + array_key_exists('scheduledStartTime', $video_data['liveStreamingDetails'])) { |
|
| 118 | 118 | $video->is_live_video = true; |
| 119 | 119 | $video->live_video_start_date = $video_data['liveStreamingDetails']['scheduledStartTime']; |
| 120 | 120 | try { |
| 121 | - $end_date = new \DateTime( $video->live_video_start_date ); |
|
| 121 | + $end_date = new \DateTime($video->live_video_start_date); |
|
| 122 | 122 | /** |
| 123 | 123 | * the google doc says : |
| 124 | 124 | * It is required to provide the endDate once the video has finished and is no longer live. |
| 125 | 125 | * If the expected endDate is unknown prior to the livestream starting, we recommend providing an approximate endDate. |
| 126 | 126 | */ |
| 127 | 127 | // we add 1 day to start date |
| 128 | - $end_date->add( new DateInterval( 'P1D' ) ); |
|
| 129 | - $video->live_video_end_date = $end_date->format( 'c' ); |
|
| 130 | - } catch ( \Exception $e ) { |
|
| 128 | + $end_date->add(new DateInterval('P1D')); |
|
| 129 | + $video->live_video_end_date = $end_date->format('c'); |
|
| 130 | + } catch (\Exception $e) { |
|
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | /** |
| 80 | - * @param $video Video |
|
| 80 | + * @param Video $video Video |
|
| 81 | 81 | * @param $post_id int |
| 82 | 82 | * |
| 83 | 83 | * @return string |
@@ -12,89 +12,89 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | class Xml_Generator { |
| 14 | 14 | |
| 15 | - private static function iso8601_to_seconds( $iso8601_interval_string ) { |
|
| 16 | - try { |
|
| 17 | - $interval = new \DateInterval( $iso8601_interval_string ); |
|
| 18 | - } catch ( \Exception $e ) { |
|
| 19 | - return 0; |
|
| 20 | - } |
|
| 21 | - |
|
| 22 | - $days_to_seconds = $interval->d * 60 * 60 * 24; |
|
| 23 | - $hours_to_seconds = $interval->h * 60 * 60; |
|
| 24 | - $minutes_to_seconds = $interval->i * 60; |
|
| 25 | - $seconds = $interval->s; |
|
| 26 | - |
|
| 27 | - return $days_to_seconds + $hours_to_seconds + $minutes_to_seconds + $seconds; |
|
| 28 | - |
|
| 29 | - } |
|
| 30 | - |
|
| 31 | - public static function get_xml_for_all_posts_with_videos() { |
|
| 32 | - |
|
| 33 | - $posts = get_posts( array( |
|
| 34 | - 'fields' => 'ids', |
|
| 35 | - 'numberposts' => - 1, |
|
| 36 | - 'meta_query' => array( |
|
| 37 | - array( |
|
| 38 | - 'key' => Meta_Storage::META_KEY, |
|
| 39 | - 'compare' => 'EXISTS' |
|
| 40 | - ) |
|
| 41 | - ) |
|
| 42 | - ) ); |
|
| 43 | - |
|
| 44 | - $all_posts_xml = ""; |
|
| 45 | - |
|
| 46 | - if ( ! $posts ) { |
|
| 47 | - return $all_posts_xml; |
|
| 48 | - } |
|
| 49 | - |
|
| 50 | - foreach ( $posts as $post_id ) { |
|
| 51 | - $all_posts_xml .= self::get_xml_for_single_post( $post_id ); |
|
| 52 | - } |
|
| 53 | - |
|
| 54 | - return $all_posts_xml; |
|
| 55 | - |
|
| 56 | - } |
|
| 57 | - |
|
| 58 | - |
|
| 59 | - /** |
|
| 60 | - * @param $post_id |
|
| 61 | - * |
|
| 62 | - * @return string XML string for single post. |
|
| 63 | - */ |
|
| 64 | - public static function get_xml_for_single_post( $post_id ) { |
|
| 65 | - $videos = Video_Storage_Factory::get_storage()->get_all_videos( $post_id ); |
|
| 66 | - if ( ! $videos ) { |
|
| 67 | - return ""; |
|
| 68 | - } |
|
| 69 | - $single_post_xml = ""; |
|
| 70 | - foreach ( $videos as $video ) { |
|
| 71 | - $single_post_xml .= self::get_xml_for_single_video( $video, $post_id ); |
|
| 72 | - } |
|
| 73 | - |
|
| 74 | - return $single_post_xml; |
|
| 75 | - |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - |
|
| 79 | - /** |
|
| 80 | - * @param $video Video |
|
| 81 | - * @param $post_id int |
|
| 82 | - * |
|
| 83 | - * @return string |
|
| 84 | - */ |
|
| 85 | - public static function get_xml_for_single_video( $video, $post_id ) { |
|
| 86 | - |
|
| 87 | - $permalink = get_permalink( $post_id ); |
|
| 88 | - $title = $video->name; |
|
| 89 | - $description = $video->description; |
|
| 90 | - $thumbnail_url = $video->thumbnail_urls[0]; |
|
| 91 | - $content_url = $video->content_url; |
|
| 92 | - $embed_url = $video->embed_url; |
|
| 93 | - $duration_in_seconds = self::iso8601_to_seconds( $video->duration ); |
|
| 94 | - $is_live_video = $video->is_live_video ? 'yes' : 'no'; |
|
| 95 | - $view_count = $video->views; |
|
| 96 | - |
|
| 97 | - return <<<EOF |
|
| 15 | + private static function iso8601_to_seconds( $iso8601_interval_string ) { |
|
| 16 | + try { |
|
| 17 | + $interval = new \DateInterval( $iso8601_interval_string ); |
|
| 18 | + } catch ( \Exception $e ) { |
|
| 19 | + return 0; |
|
| 20 | + } |
|
| 21 | + |
|
| 22 | + $days_to_seconds = $interval->d * 60 * 60 * 24; |
|
| 23 | + $hours_to_seconds = $interval->h * 60 * 60; |
|
| 24 | + $minutes_to_seconds = $interval->i * 60; |
|
| 25 | + $seconds = $interval->s; |
|
| 26 | + |
|
| 27 | + return $days_to_seconds + $hours_to_seconds + $minutes_to_seconds + $seconds; |
|
| 28 | + |
|
| 29 | + } |
|
| 30 | + |
|
| 31 | + public static function get_xml_for_all_posts_with_videos() { |
|
| 32 | + |
|
| 33 | + $posts = get_posts( array( |
|
| 34 | + 'fields' => 'ids', |
|
| 35 | + 'numberposts' => - 1, |
|
| 36 | + 'meta_query' => array( |
|
| 37 | + array( |
|
| 38 | + 'key' => Meta_Storage::META_KEY, |
|
| 39 | + 'compare' => 'EXISTS' |
|
| 40 | + ) |
|
| 41 | + ) |
|
| 42 | + ) ); |
|
| 43 | + |
|
| 44 | + $all_posts_xml = ""; |
|
| 45 | + |
|
| 46 | + if ( ! $posts ) { |
|
| 47 | + return $all_posts_xml; |
|
| 48 | + } |
|
| 49 | + |
|
| 50 | + foreach ( $posts as $post_id ) { |
|
| 51 | + $all_posts_xml .= self::get_xml_for_single_post( $post_id ); |
|
| 52 | + } |
|
| 53 | + |
|
| 54 | + return $all_posts_xml; |
|
| 55 | + |
|
| 56 | + } |
|
| 57 | + |
|
| 58 | + |
|
| 59 | + /** |
|
| 60 | + * @param $post_id |
|
| 61 | + * |
|
| 62 | + * @return string XML string for single post. |
|
| 63 | + */ |
|
| 64 | + public static function get_xml_for_single_post( $post_id ) { |
|
| 65 | + $videos = Video_Storage_Factory::get_storage()->get_all_videos( $post_id ); |
|
| 66 | + if ( ! $videos ) { |
|
| 67 | + return ""; |
|
| 68 | + } |
|
| 69 | + $single_post_xml = ""; |
|
| 70 | + foreach ( $videos as $video ) { |
|
| 71 | + $single_post_xml .= self::get_xml_for_single_video( $video, $post_id ); |
|
| 72 | + } |
|
| 73 | + |
|
| 74 | + return $single_post_xml; |
|
| 75 | + |
|
| 76 | + } |
|
| 77 | + |
|
| 78 | + |
|
| 79 | + /** |
|
| 80 | + * @param $video Video |
|
| 81 | + * @param $post_id int |
|
| 82 | + * |
|
| 83 | + * @return string |
|
| 84 | + */ |
|
| 85 | + public static function get_xml_for_single_video( $video, $post_id ) { |
|
| 86 | + |
|
| 87 | + $permalink = get_permalink( $post_id ); |
|
| 88 | + $title = $video->name; |
|
| 89 | + $description = $video->description; |
|
| 90 | + $thumbnail_url = $video->thumbnail_urls[0]; |
|
| 91 | + $content_url = $video->content_url; |
|
| 92 | + $embed_url = $video->embed_url; |
|
| 93 | + $duration_in_seconds = self::iso8601_to_seconds( $video->duration ); |
|
| 94 | + $is_live_video = $video->is_live_video ? 'yes' : 'no'; |
|
| 95 | + $view_count = $video->views; |
|
| 96 | + |
|
| 97 | + return <<<EOF |
|
| 98 | 98 | <url> |
| 99 | 99 | <loc>${permalink}</loc> |
| 100 | 100 | <video:video> |
@@ -110,6 +110,6 @@ discard block |
||
| 110 | 110 | </url> |
| 111 | 111 | EOF; |
| 112 | 112 | |
| 113 | - } |
|
| 113 | + } |
|
| 114 | 114 | |
| 115 | 115 | } |
| 116 | 116 | \ No newline at end of file |
@@ -12,10 +12,10 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | class Xml_Generator { |
| 14 | 14 | |
| 15 | - private static function iso8601_to_seconds( $iso8601_interval_string ) { |
|
| 15 | + private static function iso8601_to_seconds($iso8601_interval_string) { |
|
| 16 | 16 | try { |
| 17 | - $interval = new \DateInterval( $iso8601_interval_string ); |
|
| 18 | - } catch ( \Exception $e ) { |
|
| 17 | + $interval = new \DateInterval($iso8601_interval_string); |
|
| 18 | + } catch (\Exception $e) { |
|
| 19 | 19 | return 0; |
| 20 | 20 | } |
| 21 | 21 | |
@@ -30,25 +30,25 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | public static function get_xml_for_all_posts_with_videos() { |
| 32 | 32 | |
| 33 | - $posts = get_posts( array( |
|
| 33 | + $posts = get_posts(array( |
|
| 34 | 34 | 'fields' => 'ids', |
| 35 | - 'numberposts' => - 1, |
|
| 35 | + 'numberposts' => -1, |
|
| 36 | 36 | 'meta_query' => array( |
| 37 | 37 | array( |
| 38 | 38 | 'key' => Meta_Storage::META_KEY, |
| 39 | 39 | 'compare' => 'EXISTS' |
| 40 | 40 | ) |
| 41 | 41 | ) |
| 42 | - ) ); |
|
| 42 | + )); |
|
| 43 | 43 | |
| 44 | 44 | $all_posts_xml = ""; |
| 45 | 45 | |
| 46 | - if ( ! $posts ) { |
|
| 46 | + if ( ! $posts) { |
|
| 47 | 47 | return $all_posts_xml; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - foreach ( $posts as $post_id ) { |
|
| 51 | - $all_posts_xml .= self::get_xml_for_single_post( $post_id ); |
|
| 50 | + foreach ($posts as $post_id) { |
|
| 51 | + $all_posts_xml .= self::get_xml_for_single_post($post_id); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | return $all_posts_xml; |
@@ -61,14 +61,14 @@ discard block |
||
| 61 | 61 | * |
| 62 | 62 | * @return string XML string for single post. |
| 63 | 63 | */ |
| 64 | - public static function get_xml_for_single_post( $post_id ) { |
|
| 65 | - $videos = Video_Storage_Factory::get_storage()->get_all_videos( $post_id ); |
|
| 66 | - if ( ! $videos ) { |
|
| 64 | + public static function get_xml_for_single_post($post_id) { |
|
| 65 | + $videos = Video_Storage_Factory::get_storage()->get_all_videos($post_id); |
|
| 66 | + if ( ! $videos) { |
|
| 67 | 67 | return ""; |
| 68 | 68 | } |
| 69 | 69 | $single_post_xml = ""; |
| 70 | - foreach ( $videos as $video ) { |
|
| 71 | - $single_post_xml .= self::get_xml_for_single_video( $video, $post_id ); |
|
| 70 | + foreach ($videos as $video) { |
|
| 71 | + $single_post_xml .= self::get_xml_for_single_video($video, $post_id); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | return $single_post_xml; |
@@ -82,15 +82,15 @@ discard block |
||
| 82 | 82 | * |
| 83 | 83 | * @return string |
| 84 | 84 | */ |
| 85 | - public static function get_xml_for_single_video( $video, $post_id ) { |
|
| 85 | + public static function get_xml_for_single_video($video, $post_id) { |
|
| 86 | 86 | |
| 87 | - $permalink = get_permalink( $post_id ); |
|
| 87 | + $permalink = get_permalink($post_id); |
|
| 88 | 88 | $title = $video->name; |
| 89 | 89 | $description = $video->description; |
| 90 | 90 | $thumbnail_url = $video->thumbnail_urls[0]; |
| 91 | 91 | $content_url = $video->content_url; |
| 92 | 92 | $embed_url = $video->embed_url; |
| 93 | - $duration_in_seconds = self::iso8601_to_seconds( $video->duration ); |
|
| 93 | + $duration_in_seconds = self::iso8601_to_seconds($video->duration); |
|
| 94 | 94 | $is_live_video = $video->is_live_video ? 'yes' : 'no'; |
| 95 | 95 | $view_count = $video->views; |
| 96 | 96 | |
@@ -6,29 +6,29 @@ discard block |
||
| 6 | 6 | if ( isset( $_POST['wordlift_videoobject_youtube_api_key'] ) |
| 7 | 7 | || isset( $_POST['wordlift_videoobject_vimeo_api_key'] ) ) { |
| 8 | 8 | |
| 9 | - /** |
|
| 10 | - * @todo: does this fields need to be encrypted before saving ? |
|
| 11 | - */ |
|
| 12 | - $youtube_api_key = (string) $_POST['wordlift_videoobject_youtube_api_key']; |
|
| 13 | - $vimeo_api_key = (string) $_POST['wordlift_videoobject_vimeo_api_key']; |
|
| 9 | + /** |
|
| 10 | + * @todo: does this fields need to be encrypted before saving ? |
|
| 11 | + */ |
|
| 12 | + $youtube_api_key = (string) $_POST['wordlift_videoobject_youtube_api_key']; |
|
| 13 | + $vimeo_api_key = (string) $_POST['wordlift_videoobject_vimeo_api_key']; |
|
| 14 | 14 | |
| 15 | - if ( $youtube_api_key ) { |
|
| 16 | - update_option( Youtube_Client::get_api_key_option_name(), $youtube_api_key ); |
|
| 17 | - } |
|
| 15 | + if ( $youtube_api_key ) { |
|
| 16 | + update_option( Youtube_Client::get_api_key_option_name(), $youtube_api_key ); |
|
| 17 | + } |
|
| 18 | 18 | |
| 19 | - if ( $vimeo_api_key ) { |
|
| 20 | - update_option( Vimeo_Client::get_api_key_option_name(), $vimeo_api_key ); |
|
| 21 | - } |
|
| 19 | + if ( $vimeo_api_key ) { |
|
| 20 | + update_option( Vimeo_Client::get_api_key_option_name(), $vimeo_api_key ); |
|
| 21 | + } |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | if ( isset( $_POST['submit'] ) ) { |
| 25 | - if ( isset( $_POST['wl_enable_video_sitemap'] ) ) { |
|
| 26 | - update_option( "_wl_video_sitemap_generation", 1 ); |
|
| 27 | - do_action( 'wordlift_generate_video_sitemap_on' ); |
|
| 28 | - } else { |
|
| 29 | - update_option( "_wl_video_sitemap_generation", 0 ); |
|
| 30 | - do_action( 'wordlift_generate_video_sitemap_off' ); |
|
| 31 | - } |
|
| 25 | + if ( isset( $_POST['wl_enable_video_sitemap'] ) ) { |
|
| 26 | + update_option( "_wl_video_sitemap_generation", 1 ); |
|
| 27 | + do_action( 'wordlift_generate_video_sitemap_on' ); |
|
| 28 | + } else { |
|
| 29 | + update_option( "_wl_video_sitemap_generation", 0 ); |
|
| 30 | + do_action( 'wordlift_generate_video_sitemap_off' ); |
|
| 31 | + } |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | ?> |
@@ -42,13 +42,13 @@ discard block |
||
| 42 | 42 | </td> |
| 43 | 43 | <td> |
| 44 | 44 | <?php |
| 45 | - $element = new Wordlift_Admin_Input_Element(); |
|
| 46 | - $element->render( array( |
|
| 47 | - 'id' => 'wordlift_videoobject_youtube_api_key', |
|
| 48 | - 'name' => 'wordlift_videoobject_youtube_api_key', |
|
| 49 | - 'value' => Youtube_Client::get_api_key() |
|
| 50 | - ) ); |
|
| 51 | - ?> |
|
| 45 | + $element = new Wordlift_Admin_Input_Element(); |
|
| 46 | + $element->render( array( |
|
| 47 | + 'id' => 'wordlift_videoobject_youtube_api_key', |
|
| 48 | + 'name' => 'wordlift_videoobject_youtube_api_key', |
|
| 49 | + 'value' => Youtube_Client::get_api_key() |
|
| 50 | + ) ); |
|
| 51 | + ?> |
|
| 52 | 52 | </td> |
| 53 | 53 | <td> |
| 54 | 54 | <a href="https://developers.google.com/youtube/registering_an_application"><?php _e( 'here', 'wordlift' ); ?></a> |
@@ -62,13 +62,13 @@ discard block |
||
| 62 | 62 | </td> |
| 63 | 63 | <td> |
| 64 | 64 | <?php |
| 65 | - $element = new Wordlift_Admin_Input_Element(); |
|
| 66 | - $element->render( array( |
|
| 67 | - 'id' => 'wordlift_videoobject_vimeo_api_key', |
|
| 68 | - 'name' => 'wordlift_videoobject_vimeo_api_key', |
|
| 69 | - 'value' => Vimeo_Client::get_api_key() |
|
| 70 | - ) ); |
|
| 71 | - ?> |
|
| 65 | + $element = new Wordlift_Admin_Input_Element(); |
|
| 66 | + $element->render( array( |
|
| 67 | + 'id' => 'wordlift_videoobject_vimeo_api_key', |
|
| 68 | + 'name' => 'wordlift_videoobject_vimeo_api_key', |
|
| 69 | + 'value' => Vimeo_Client::get_api_key() |
|
| 70 | + ) ); |
|
| 71 | + ?> |
|
| 72 | 72 | </td> |
| 73 | 73 | <td> |
| 74 | 74 | <a href="https://developer.vimeo.com/api/guides/start"><?php _e( 'here', 'wordlift' ); ?></a> |
@@ -3,8 +3,8 @@ discard block |
||
| 3 | 3 | use Wordlift\Videoobject\Provider\Client\Vimeo_Client; |
| 4 | 4 | use Wordlift\Videoobject\Provider\Client\Youtube_Client; |
| 5 | 5 | |
| 6 | -if ( isset( $_POST['wordlift_videoobject_youtube_api_key'] ) |
|
| 7 | - || isset( $_POST['wordlift_videoobject_vimeo_api_key'] ) ) { |
|
| 6 | +if (isset($_POST['wordlift_videoobject_youtube_api_key']) |
|
| 7 | + || isset($_POST['wordlift_videoobject_vimeo_api_key'])) { |
|
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | 10 | * @todo: does this fields need to be encrypted before saving ? |
@@ -12,28 +12,28 @@ discard block |
||
| 12 | 12 | $youtube_api_key = (string) $_POST['wordlift_videoobject_youtube_api_key']; |
| 13 | 13 | $vimeo_api_key = (string) $_POST['wordlift_videoobject_vimeo_api_key']; |
| 14 | 14 | |
| 15 | - if ( $youtube_api_key ) { |
|
| 16 | - update_option( Youtube_Client::get_api_key_option_name(), $youtube_api_key ); |
|
| 15 | + if ($youtube_api_key) { |
|
| 16 | + update_option(Youtube_Client::get_api_key_option_name(), $youtube_api_key); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - if ( $vimeo_api_key ) { |
|
| 20 | - update_option( Vimeo_Client::get_api_key_option_name(), $vimeo_api_key ); |
|
| 19 | + if ($vimeo_api_key) { |
|
| 20 | + update_option(Vimeo_Client::get_api_key_option_name(), $vimeo_api_key); |
|
| 21 | 21 | } |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | -if ( isset( $_POST['submit'] ) ) { |
|
| 25 | - if ( isset( $_POST['wl_enable_video_sitemap'] ) ) { |
|
| 26 | - update_option( "_wl_video_sitemap_generation", 1 ); |
|
| 27 | - do_action( 'wordlift_generate_video_sitemap_on' ); |
|
| 24 | +if (isset($_POST['submit'])) { |
|
| 25 | + if (isset($_POST['wl_enable_video_sitemap'])) { |
|
| 26 | + update_option("_wl_video_sitemap_generation", 1); |
|
| 27 | + do_action('wordlift_generate_video_sitemap_on'); |
|
| 28 | 28 | } else { |
| 29 | - update_option( "_wl_video_sitemap_generation", 0 ); |
|
| 30 | - do_action( 'wordlift_generate_video_sitemap_off' ); |
|
| 29 | + update_option("_wl_video_sitemap_generation", 0); |
|
| 30 | + do_action('wordlift_generate_video_sitemap_off'); |
|
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | ?> |
| 35 | -<h1><?php _e( 'API Settings', 'wordlift' ); ?></h1> |
|
| 36 | -<p><?php _e( 'To let WordLift access metadata from Youtube or Vimeo you will need to add here your API Key.' ); ?></p> |
|
| 35 | +<h1><?php _e('API Settings', 'wordlift'); ?></h1> |
|
| 36 | +<p><?php _e('To let WordLift access metadata from Youtube or Vimeo you will need to add here your API Key.'); ?></p> |
|
| 37 | 37 | <form method="post"> |
| 38 | 38 | <table> |
| 39 | 39 | <tr> |
@@ -43,16 +43,16 @@ discard block |
||
| 43 | 43 | <td> |
| 44 | 44 | <?php |
| 45 | 45 | $element = new Wordlift_Admin_Input_Element(); |
| 46 | - $element->render( array( |
|
| 46 | + $element->render(array( |
|
| 47 | 47 | 'id' => 'wordlift_videoobject_youtube_api_key', |
| 48 | 48 | 'name' => 'wordlift_videoobject_youtube_api_key', |
| 49 | 49 | 'value' => Youtube_Client::get_api_key() |
| 50 | - ) ); |
|
| 50 | + )); |
|
| 51 | 51 | ?> |
| 52 | 52 | </td> |
| 53 | 53 | <td> |
| 54 | - <a href="https://developers.google.com/youtube/registering_an_application"><?php _e( 'here', 'wordlift' ); ?></a> |
|
| 55 | - <?php _e( ' is how to get it', 'wordlift' ); ?> |
|
| 54 | + <a href="https://developers.google.com/youtube/registering_an_application"><?php _e('here', 'wordlift'); ?></a> |
|
| 55 | + <?php _e(' is how to get it', 'wordlift'); ?> |
|
| 56 | 56 | </td> |
| 57 | 57 | </tr> |
| 58 | 58 | |
@@ -63,28 +63,28 @@ discard block |
||
| 63 | 63 | <td> |
| 64 | 64 | <?php |
| 65 | 65 | $element = new Wordlift_Admin_Input_Element(); |
| 66 | - $element->render( array( |
|
| 66 | + $element->render(array( |
|
| 67 | 67 | 'id' => 'wordlift_videoobject_vimeo_api_key', |
| 68 | 68 | 'name' => 'wordlift_videoobject_vimeo_api_key', |
| 69 | 69 | 'value' => Vimeo_Client::get_api_key() |
| 70 | - ) ); |
|
| 70 | + )); |
|
| 71 | 71 | ?> |
| 72 | 72 | </td> |
| 73 | 73 | <td> |
| 74 | - <a href="https://developer.vimeo.com/api/guides/start"><?php _e( 'here', 'wordlift' ); ?></a> |
|
| 75 | - <?php _e( ' is how to get it', 'wordlift' ); ?> |
|
| 74 | + <a href="https://developer.vimeo.com/api/guides/start"><?php _e('here', 'wordlift'); ?></a> |
|
| 75 | + <?php _e(' is how to get it', 'wordlift'); ?> |
|
| 76 | 76 | </td> |
| 77 | 77 | </tr> |
| 78 | 78 | |
| 79 | 79 | </table> |
| 80 | - <h1><?php _e( 'Video Sitemap', 'wordlift' ); ?></h1> |
|
| 80 | + <h1><?php _e('Video Sitemap', 'wordlift'); ?></h1> |
|
| 81 | 81 | <p> |
| 82 | - <?php _e( 'The Video Sitemap works like any other XML Sitemap. Search engines will use it to display rich snippets in result pages.' ); ?> |
|
| 82 | + <?php _e('The Video Sitemap works like any other XML Sitemap. Search engines will use it to display rich snippets in result pages.'); ?> |
|
| 83 | 83 | </p> |
| 84 | - <?php $is_checked = get_option( '_wl_video_sitemap_generation', false ) ? 'checked' : '' ?> |
|
| 85 | - <p> <?php _e( 'Enable Video Sitemap' ); ?> |
|
| 84 | + <?php $is_checked = get_option('_wl_video_sitemap_generation', false) ? 'checked' : '' ?> |
|
| 85 | + <p> <?php _e('Enable Video Sitemap'); ?> |
|
| 86 | 86 | <input type="checkbox" name="wl_enable_video_sitemap" value="1" <?php echo $is_checked; ?> ></p> |
| 87 | - <p> <?php _e( 'Here is link to your Video Sitemap. Add it now, to Google Search Console.', 'wordlift' ); ?></p> |
|
| 87 | + <p> <?php _e('Here is link to your Video Sitemap. Add it now, to Google Search Console.', 'wordlift'); ?></p> |
|
| 88 | 88 | |
| 89 | 89 | <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" |
| 90 | 90 | value="Save Changes"> |
@@ -76,1616 +76,1616 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | class Wordlift { |
| 78 | 78 | |
| 79 | - //<editor-fold desc="## FIELDS"> |
|
| 80 | - |
|
| 81 | - /** |
|
| 82 | - * The loader that's responsible for maintaining and registering all hooks that power |
|
| 83 | - * the plugin. |
|
| 84 | - * |
|
| 85 | - * @since 1.0.0 |
|
| 86 | - * @access protected |
|
| 87 | - * @var Wordlift_Loader $loader Maintains and registers all hooks for the plugin. |
|
| 88 | - */ |
|
| 89 | - protected $loader; |
|
| 90 | - |
|
| 91 | - /** |
|
| 92 | - * The unique identifier of this plugin. |
|
| 93 | - * |
|
| 94 | - * @since 1.0.0 |
|
| 95 | - * @access protected |
|
| 96 | - * @var string $plugin_name The string used to uniquely identify this plugin. |
|
| 97 | - */ |
|
| 98 | - protected $plugin_name; |
|
| 99 | - |
|
| 100 | - /** |
|
| 101 | - * The current version of the plugin. |
|
| 102 | - * |
|
| 103 | - * @since 1.0.0 |
|
| 104 | - * @access protected |
|
| 105 | - * @var string $version The current version of the plugin. |
|
| 106 | - */ |
|
| 107 | - protected $version; |
|
| 108 | - |
|
| 109 | - /** |
|
| 110 | - * The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 111 | - * |
|
| 112 | - * @since 3.12.0 |
|
| 113 | - * @access protected |
|
| 114 | - * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 115 | - */ |
|
| 116 | - protected $tinymce_adapter; |
|
| 117 | - |
|
| 118 | - /** |
|
| 119 | - * The {@link Faq_Tinymce_Adapter} instance |
|
| 120 | - * @since 3.26.0 |
|
| 121 | - * @access protected |
|
| 122 | - * @var Faq_Tinymce_Adapter $faq_tinymce_adapter . |
|
| 123 | - */ |
|
| 124 | - //protected $faq_tinymce_adapter; |
|
| 125 | - |
|
| 126 | - /** |
|
| 127 | - * The Thumbnail service. |
|
| 128 | - * |
|
| 129 | - * @since 3.1.5 |
|
| 130 | - * @access private |
|
| 131 | - * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service. |
|
| 132 | - */ |
|
| 133 | - private $thumbnail_service; |
|
| 134 | - |
|
| 135 | - /** |
|
| 136 | - * The UI service. |
|
| 137 | - * |
|
| 138 | - * @since 3.2.0 |
|
| 139 | - * @access private |
|
| 140 | - * @var \Wordlift_UI_Service $ui_service The UI service. |
|
| 141 | - */ |
|
| 142 | - private $ui_service; |
|
| 143 | - |
|
| 144 | - /** |
|
| 145 | - * The Schema service. |
|
| 146 | - * |
|
| 147 | - * @since 3.3.0 |
|
| 148 | - * @access protected |
|
| 149 | - * @var \Wordlift_Schema_Service $schema_service The Schema service. |
|
| 150 | - */ |
|
| 151 | - protected $schema_service; |
|
| 152 | - |
|
| 153 | - /** |
|
| 154 | - * The Entity service. |
|
| 155 | - * |
|
| 156 | - * @since 3.1.0 |
|
| 157 | - * @access protected |
|
| 158 | - * @var \Wordlift_Entity_Service $entity_service The Entity service. |
|
| 159 | - */ |
|
| 160 | - protected $entity_service; |
|
| 161 | - |
|
| 162 | - /** |
|
| 163 | - * The Topic Taxonomy service. |
|
| 164 | - * |
|
| 165 | - * @since 3.5.0 |
|
| 166 | - * @access private |
|
| 167 | - * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service. |
|
| 168 | - */ |
|
| 169 | - private $topic_taxonomy_service; |
|
| 170 | - |
|
| 171 | - /** |
|
| 172 | - * The Entity Types Taxonomy service. |
|
| 173 | - * |
|
| 174 | - * @since 3.18.0 |
|
| 175 | - * @access private |
|
| 176 | - * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service. |
|
| 177 | - */ |
|
| 178 | - private $entity_types_taxonomy_service; |
|
| 179 | - |
|
| 180 | - /** |
|
| 181 | - * The User service. |
|
| 182 | - * |
|
| 183 | - * @since 3.1.7 |
|
| 184 | - * @access protected |
|
| 185 | - * @var \Wordlift_User_Service $user_service The User service. |
|
| 186 | - */ |
|
| 187 | - protected $user_service; |
|
| 188 | - |
|
| 189 | - /** |
|
| 190 | - * The Timeline service. |
|
| 191 | - * |
|
| 192 | - * @since 3.1.0 |
|
| 193 | - * @access private |
|
| 194 | - * @var \Wordlift_Timeline_Service $timeline_service The Timeline service. |
|
| 195 | - */ |
|
| 196 | - private $timeline_service; |
|
| 197 | - |
|
| 198 | - /** |
|
| 199 | - * The Redirect service. |
|
| 200 | - * |
|
| 201 | - * @since 3.2.0 |
|
| 202 | - * @access private |
|
| 203 | - * @var \Wordlift_Redirect_Service $redirect_service The Redirect service. |
|
| 204 | - */ |
|
| 205 | - private $redirect_service; |
|
| 206 | - |
|
| 207 | - /** |
|
| 208 | - * The Notice service. |
|
| 209 | - * |
|
| 210 | - * @since 3.3.0 |
|
| 211 | - * @access private |
|
| 212 | - * @var \Wordlift_Notice_Service $notice_service The Notice service. |
|
| 213 | - */ |
|
| 214 | - private $notice_service; |
|
| 215 | - |
|
| 216 | - /** |
|
| 217 | - * The Entity list customization. |
|
| 218 | - * |
|
| 219 | - * @since 3.3.0 |
|
| 220 | - * @access protected |
|
| 221 | - * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service. |
|
| 222 | - */ |
|
| 223 | - protected $entity_list_service; |
|
| 224 | - |
|
| 225 | - /** |
|
| 226 | - * The Entity Types Taxonomy Walker. |
|
| 227 | - * |
|
| 228 | - * @since 3.1.0 |
|
| 229 | - * @access private |
|
| 230 | - * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker |
|
| 231 | - */ |
|
| 232 | - private $entity_types_taxonomy_walker; |
|
| 233 | - |
|
| 234 | - /** |
|
| 235 | - * The ShareThis service. |
|
| 236 | - * |
|
| 237 | - * @since 3.2.0 |
|
| 238 | - * @access private |
|
| 239 | - * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service. |
|
| 240 | - */ |
|
| 241 | - private $sharethis_service; |
|
| 242 | - |
|
| 243 | - /** |
|
| 244 | - * The PrimaShop adapter. |
|
| 245 | - * |
|
| 246 | - * @since 3.2.3 |
|
| 247 | - * @access private |
|
| 248 | - * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter. |
|
| 249 | - */ |
|
| 250 | - private $primashop_adapter; |
|
| 251 | - |
|
| 252 | - /** |
|
| 253 | - * The WordLift Dashboard adapter. |
|
| 254 | - * |
|
| 255 | - * @since 3.4.0 |
|
| 256 | - * @access private |
|
| 257 | - * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service; |
|
| 258 | - */ |
|
| 259 | - private $dashboard_service; |
|
| 260 | - |
|
| 261 | - /** |
|
| 262 | - * The entity type service. |
|
| 263 | - * |
|
| 264 | - * @since 3.6.0 |
|
| 265 | - * @access private |
|
| 266 | - * @var \Wordlift_Entity_Post_Type_Service |
|
| 267 | - */ |
|
| 268 | - private $entity_post_type_service; |
|
| 269 | - |
|
| 270 | - /** |
|
| 271 | - * The entity link service used to mangle links to entities with a custom slug or even w/o a slug. |
|
| 272 | - * |
|
| 273 | - * @since 3.6.0 |
|
| 274 | - * @access private |
|
| 275 | - * @var \Wordlift_Entity_Link_Service $entity_link_service The {@link Wordlift_Entity_Link_Service} instance. |
|
| 276 | - */ |
|
| 277 | - private $entity_link_service; |
|
| 278 | - |
|
| 279 | - /** |
|
| 280 | - * A {@link Wordlift_Sparql_Service} instance. |
|
| 281 | - * |
|
| 282 | - * @since 3.6.0 |
|
| 283 | - * @access protected |
|
| 284 | - * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance. |
|
| 285 | - */ |
|
| 286 | - protected $sparql_service; |
|
| 287 | - |
|
| 288 | - /** |
|
| 289 | - * A {@link Wordlift_Import_Service} instance. |
|
| 290 | - * |
|
| 291 | - * @since 3.6.0 |
|
| 292 | - * @access private |
|
| 293 | - * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance. |
|
| 294 | - */ |
|
| 295 | - private $import_service; |
|
| 296 | - |
|
| 297 | - /** |
|
| 298 | - * A {@link Wordlift_Rebuild_Service} instance. |
|
| 299 | - * |
|
| 300 | - * @since 3.6.0 |
|
| 301 | - * @access private |
|
| 302 | - * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance. |
|
| 303 | - */ |
|
| 304 | - private $rebuild_service; |
|
| 305 | - |
|
| 306 | - /** |
|
| 307 | - * A {@link Wordlift_Jsonld_Service} instance. |
|
| 308 | - * |
|
| 309 | - * @since 3.7.0 |
|
| 310 | - * @access protected |
|
| 311 | - * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance. |
|
| 312 | - */ |
|
| 313 | - protected $jsonld_service; |
|
| 314 | - |
|
| 315 | - /** |
|
| 316 | - * A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 317 | - * |
|
| 318 | - * @since 3.14.0 |
|
| 319 | - * @access protected |
|
| 320 | - * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 321 | - */ |
|
| 322 | - protected $jsonld_website_converter; |
|
| 323 | - |
|
| 324 | - /** |
|
| 325 | - * A {@link Wordlift_Property_Factory} instance. |
|
| 326 | - * |
|
| 327 | - * @since 3.7.0 |
|
| 328 | - * @access private |
|
| 329 | - * @var \Wordlift_Property_Factory $property_factory |
|
| 330 | - */ |
|
| 331 | - private $property_factory; |
|
| 332 | - |
|
| 333 | - /** |
|
| 334 | - * The 'Download Your Data' page. |
|
| 335 | - * |
|
| 336 | - * @since 3.6.0 |
|
| 337 | - * @access private |
|
| 338 | - * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page. |
|
| 339 | - */ |
|
| 340 | - private $download_your_data_page; |
|
| 341 | - |
|
| 342 | - /** |
|
| 343 | - * The 'WordLift Settings' page. |
|
| 344 | - * |
|
| 345 | - * @since 3.11.0 |
|
| 346 | - * @access protected |
|
| 347 | - * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page. |
|
| 348 | - */ |
|
| 349 | - protected $settings_page; |
|
| 350 | - |
|
| 351 | - /** |
|
| 352 | - * The install wizard page. |
|
| 353 | - * |
|
| 354 | - * @since 3.9.0 |
|
| 355 | - * @access private |
|
| 356 | - * @var \Wordlift_Admin_Setup $admin_setup The Install wizard. |
|
| 357 | - */ |
|
| 358 | - public $admin_setup; |
|
| 359 | - |
|
| 360 | - /** |
|
| 361 | - * The Content Filter Service hooks up to the 'the_content' filter and provides |
|
| 362 | - * linking of entities to their pages. |
|
| 363 | - * |
|
| 364 | - * @since 3.8.0 |
|
| 365 | - * @access private |
|
| 366 | - * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance. |
|
| 367 | - */ |
|
| 368 | - private $content_filter_service; |
|
| 369 | - |
|
| 370 | - /** |
|
| 371 | - * The Faq Content filter service |
|
| 372 | - * @since 3.26.0 |
|
| 373 | - * @access private |
|
| 374 | - * @var Faq_Content_Filter $faq_content_filter_service A {@link Faq_Content_Filter} instance. |
|
| 375 | - */ |
|
| 376 | - private $faq_content_filter_service; |
|
| 377 | - |
|
| 378 | - /** |
|
| 379 | - * A {@link Wordlift_Key_Validation_Service} instance. |
|
| 380 | - * |
|
| 381 | - * @since 3.9.0 |
|
| 382 | - * @access private |
|
| 383 | - * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance. |
|
| 384 | - */ |
|
| 385 | - private $key_validation_service; |
|
| 386 | - |
|
| 387 | - /** |
|
| 388 | - * A {@link Wordlift_Rating_Service} instance. |
|
| 389 | - * |
|
| 390 | - * @since 3.10.0 |
|
| 391 | - * @access private |
|
| 392 | - * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance. |
|
| 393 | - */ |
|
| 394 | - private $rating_service; |
|
| 395 | - |
|
| 396 | - /** |
|
| 397 | - * A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 398 | - * |
|
| 399 | - * @since 3.10.0 |
|
| 400 | - * @access protected |
|
| 401 | - * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 402 | - */ |
|
| 403 | - protected $post_to_jsonld_converter; |
|
| 404 | - |
|
| 405 | - /** |
|
| 406 | - * A {@link Wordlift_Configuration_Service} instance. |
|
| 407 | - * |
|
| 408 | - * @since 3.10.0 |
|
| 409 | - * @access protected |
|
| 410 | - * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance. |
|
| 411 | - */ |
|
| 412 | - protected $configuration_service; |
|
| 413 | - |
|
| 414 | - /** |
|
| 415 | - * A {@link Wordlift_Install_Service} instance. |
|
| 416 | - * |
|
| 417 | - * @since 3.18.0 |
|
| 418 | - * @access protected |
|
| 419 | - * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance. |
|
| 420 | - */ |
|
| 421 | - protected $install_service; |
|
| 422 | - |
|
| 423 | - /** |
|
| 424 | - * A {@link Wordlift_Entity_Type_Service} instance. |
|
| 425 | - * |
|
| 426 | - * @since 3.10.0 |
|
| 427 | - * @access protected |
|
| 428 | - * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance. |
|
| 429 | - */ |
|
| 430 | - protected $entity_type_service; |
|
| 431 | - |
|
| 432 | - /** |
|
| 433 | - * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 434 | - * |
|
| 435 | - * @since 3.10.0 |
|
| 436 | - * @access protected |
|
| 437 | - * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 438 | - */ |
|
| 439 | - protected $entity_post_to_jsonld_converter; |
|
| 440 | - |
|
| 441 | - /** |
|
| 442 | - * A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 443 | - * |
|
| 444 | - * @since 3.10.0 |
|
| 445 | - * @access protected |
|
| 446 | - * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 447 | - */ |
|
| 448 | - protected $postid_to_jsonld_converter; |
|
| 449 | - |
|
| 450 | - /** |
|
| 451 | - * The {@link Wordlift_Admin_Status_Page} class. |
|
| 452 | - * |
|
| 453 | - * @since 3.9.8 |
|
| 454 | - * @access private |
|
| 455 | - * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class. |
|
| 456 | - */ |
|
| 457 | - private $status_page; |
|
| 458 | - |
|
| 459 | - /** |
|
| 460 | - * The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 461 | - * |
|
| 462 | - * @since 3.11.0 |
|
| 463 | - * @access protected |
|
| 464 | - * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 465 | - */ |
|
| 466 | - protected $category_taxonomy_service; |
|
| 467 | - |
|
| 468 | - /** |
|
| 469 | - * The {@link Wordlift_Entity_Page_Service} instance. |
|
| 470 | - * |
|
| 471 | - * @since 3.11.0 |
|
| 472 | - * @access protected |
|
| 473 | - * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance. |
|
| 474 | - */ |
|
| 475 | - protected $entity_page_service; |
|
| 476 | - |
|
| 477 | - /** |
|
| 478 | - * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 479 | - * |
|
| 480 | - * @since 3.11.0 |
|
| 481 | - * @access protected |
|
| 482 | - * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 483 | - */ |
|
| 484 | - protected $settings_page_action_link; |
|
| 485 | - |
|
| 486 | - /** |
|
| 487 | - * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 488 | - * |
|
| 489 | - * @since 3.11.0 |
|
| 490 | - * @access protected |
|
| 491 | - * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 492 | - */ |
|
| 493 | - protected $analytics_settings_page_action_link; |
|
| 494 | - |
|
| 495 | - /** |
|
| 496 | - * The {@link Wordlift_Analytics_Connect} class. |
|
| 497 | - * |
|
| 498 | - * @since 3.11.0 |
|
| 499 | - * @access protected |
|
| 500 | - * @var \Wordlift_Analytics_Connect $analytics_connect The {@link Wordlift_Analytics_Connect} class. |
|
| 501 | - */ |
|
| 502 | - protected $analytics_connect; |
|
| 503 | - |
|
| 504 | - /** |
|
| 505 | - * The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 506 | - * |
|
| 507 | - * @since 3.11.0 |
|
| 508 | - * @access protected |
|
| 509 | - * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 510 | - */ |
|
| 511 | - protected $publisher_ajax_adapter; |
|
| 512 | - |
|
| 513 | - /** |
|
| 514 | - * The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 515 | - * |
|
| 516 | - * @since 3.11.0 |
|
| 517 | - * @access protected |
|
| 518 | - * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 519 | - */ |
|
| 520 | - protected $input_element; |
|
| 521 | - |
|
| 522 | - /** |
|
| 523 | - * The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 524 | - * |
|
| 525 | - * @since 3.13.0 |
|
| 526 | - * @access protected |
|
| 527 | - * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 528 | - */ |
|
| 529 | - protected $radio_input_element; |
|
| 530 | - |
|
| 531 | - /** |
|
| 532 | - * The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 533 | - * |
|
| 534 | - * @since 3.11.0 |
|
| 535 | - * @access protected |
|
| 536 | - * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 537 | - */ |
|
| 538 | - protected $language_select_element; |
|
| 539 | - |
|
| 540 | - /** |
|
| 541 | - * The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
| 542 | - * |
|
| 543 | - * @since 3.18.0 |
|
| 544 | - * @access protected |
|
| 545 | - * @var \Wordlift_Admin_Country_Select_Element $country_select_element The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
| 546 | - */ |
|
| 547 | - protected $country_select_element; |
|
| 548 | - |
|
| 549 | - /** |
|
| 550 | - * The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 551 | - * |
|
| 552 | - * @since 3.11.0 |
|
| 553 | - * @access protected |
|
| 554 | - * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 555 | - */ |
|
| 556 | - protected $publisher_element; |
|
| 557 | - |
|
| 558 | - /** |
|
| 559 | - * The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 560 | - * |
|
| 561 | - * @since 3.11.0 |
|
| 562 | - * @access protected |
|
| 563 | - * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 564 | - */ |
|
| 565 | - protected $select2_element; |
|
| 566 | - |
|
| 567 | - /** |
|
| 568 | - * The controller for the entity type list admin page |
|
| 569 | - * |
|
| 570 | - * @since 3.11.0 |
|
| 571 | - * @access private |
|
| 572 | - * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class. |
|
| 573 | - */ |
|
| 574 | - private $entity_type_admin_page; |
|
| 575 | - |
|
| 576 | - /** |
|
| 577 | - * The controller for the entity type settings admin page |
|
| 578 | - * |
|
| 579 | - * @since 3.11.0 |
|
| 580 | - * @access private |
|
| 581 | - * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class. |
|
| 582 | - */ |
|
| 583 | - private $entity_type_settings_admin_page; |
|
| 584 | - |
|
| 585 | - /** |
|
| 586 | - * The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 587 | - * |
|
| 588 | - * @since 3.11.0 |
|
| 589 | - * @access protected |
|
| 590 | - * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 591 | - */ |
|
| 592 | - protected $related_entities_cloud_widget; |
|
| 593 | - |
|
| 594 | - /** |
|
| 595 | - * The {@link Wordlift_Admin_Author_Element} instance. |
|
| 596 | - * |
|
| 597 | - * @since 3.14.0 |
|
| 598 | - * @access protected |
|
| 599 | - * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance. |
|
| 600 | - */ |
|
| 601 | - protected $author_element; |
|
| 602 | - |
|
| 603 | - /** |
|
| 604 | - * The {@link Wordlift_Sample_Data_Service} instance. |
|
| 605 | - * |
|
| 606 | - * @since 3.12.0 |
|
| 607 | - * @access protected |
|
| 608 | - * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance. |
|
| 609 | - */ |
|
| 610 | - protected $sample_data_service; |
|
| 611 | - |
|
| 612 | - /** |
|
| 613 | - * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 614 | - * |
|
| 615 | - * @since 3.12.0 |
|
| 616 | - * @access protected |
|
| 617 | - * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 618 | - */ |
|
| 619 | - protected $sample_data_ajax_adapter; |
|
| 620 | - |
|
| 621 | - /** |
|
| 622 | - * The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 623 | - * |
|
| 624 | - * @since 3.14.3 |
|
| 625 | - * @access private |
|
| 626 | - * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 627 | - */ |
|
| 628 | - private $relation_rebuild_service; |
|
| 629 | - |
|
| 630 | - /** |
|
| 631 | - * The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 632 | - * |
|
| 633 | - * @since 3.14.3 |
|
| 634 | - * @access private |
|
| 635 | - * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 636 | - */ |
|
| 637 | - private $relation_rebuild_adapter; |
|
| 638 | - |
|
| 639 | - /** |
|
| 640 | - * The {@link Wordlift_Reference_Rebuild_Service} instance. |
|
| 641 | - * |
|
| 642 | - * @since 3.18.0 |
|
| 643 | - * @access private |
|
| 644 | - * @var \Wordlift_Reference_Rebuild_Service $reference_rebuild_service The {@link Wordlift_Reference_Rebuild_Service} instance. |
|
| 645 | - */ |
|
| 646 | - private $reference_rebuild_service; |
|
| 647 | - |
|
| 648 | - /** |
|
| 649 | - * The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 650 | - * |
|
| 651 | - * @since 3.16.0 |
|
| 652 | - * @access protected |
|
| 653 | - * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 654 | - */ |
|
| 655 | - protected $google_analytics_export_service; |
|
| 656 | - |
|
| 657 | - /** |
|
| 658 | - * {@link Wordlift}'s singleton instance. |
|
| 659 | - * |
|
| 660 | - * @since 3.15.0 |
|
| 661 | - * @access protected |
|
| 662 | - * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance. |
|
| 663 | - */ |
|
| 664 | - protected $entity_type_adapter; |
|
| 665 | - |
|
| 666 | - /** |
|
| 667 | - * The {@link Wordlift_Storage_Factory} instance. |
|
| 668 | - * |
|
| 669 | - * @since 3.15.0 |
|
| 670 | - * @access protected |
|
| 671 | - * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance. |
|
| 672 | - */ |
|
| 673 | - protected $storage_factory; |
|
| 674 | - |
|
| 675 | - /** |
|
| 676 | - * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 677 | - * |
|
| 678 | - * @since 3.15.0 |
|
| 679 | - * @access protected |
|
| 680 | - * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 681 | - */ |
|
| 682 | - protected $rendition_factory; |
|
| 683 | - |
|
| 684 | - /** |
|
| 685 | - * The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 686 | - * |
|
| 687 | - * @since 3.15.0 |
|
| 688 | - * @access private |
|
| 689 | - * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 690 | - */ |
|
| 691 | - private $autocomplete_adapter; |
|
| 692 | - |
|
| 693 | - /** |
|
| 694 | - * The {@link Wordlift_Relation_Service} instance. |
|
| 695 | - * |
|
| 696 | - * @since 3.15.0 |
|
| 697 | - * @access protected |
|
| 698 | - * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance. |
|
| 699 | - */ |
|
| 700 | - protected $relation_service; |
|
| 701 | - |
|
| 702 | - /** |
|
| 703 | - * The {@link Wordlift_Cached_Post_Converter} instance. |
|
| 704 | - * |
|
| 705 | - * @since 3.16.0 |
|
| 706 | - * @access protected |
|
| 707 | - * @var \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance. |
|
| 708 | - * |
|
| 709 | - */ |
|
| 710 | - protected $cached_postid_to_jsonld_converter; |
|
| 711 | - |
|
| 712 | - /** |
|
| 713 | - * The {@link Wordlift_Entity_Uri_Service} instance. |
|
| 714 | - * |
|
| 715 | - * @since 3.16.3 |
|
| 716 | - * @access protected |
|
| 717 | - * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance. |
|
| 718 | - */ |
|
| 719 | - protected $entity_uri_service; |
|
| 720 | - |
|
| 721 | - /** |
|
| 722 | - * The {@link Wordlift_Publisher_Service} instance. |
|
| 723 | - * |
|
| 724 | - * @since 3.19.0 |
|
| 725 | - * @access protected |
|
| 726 | - * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance. |
|
| 727 | - */ |
|
| 728 | - protected $publisher_service; |
|
| 729 | - |
|
| 730 | - /** |
|
| 731 | - * The {@link Wordlift_Context_Cards_Service} instance. |
|
| 732 | - * |
|
| 733 | - * @var \Wordlift_Context_Cards_Service The {@link Wordlift_Context_Cards_Service} instance. |
|
| 734 | - */ |
|
| 735 | - protected $context_cards_service; |
|
| 736 | - |
|
| 737 | - /** |
|
| 738 | - * {@link Wordlift}'s singleton instance. |
|
| 739 | - * |
|
| 740 | - * @since 3.11.2 |
|
| 741 | - * @access private |
|
| 742 | - * @var Wordlift $instance {@link Wordlift}'s singleton instance. |
|
| 743 | - */ |
|
| 744 | - private static $instance; |
|
| 745 | - |
|
| 746 | - /** |
|
| 747 | - * A singleton instance of features registry. |
|
| 748 | - * @since 3.30.0 |
|
| 749 | - * @var Features_Registry |
|
| 750 | - */ |
|
| 751 | - private $features_registry; |
|
| 752 | - |
|
| 753 | - //</editor-fold> |
|
| 754 | - |
|
| 755 | - /** |
|
| 756 | - * Define the core functionality of the plugin. |
|
| 757 | - * |
|
| 758 | - * Set the plugin name and the plugin version that can be used throughout the plugin. |
|
| 759 | - * Load the dependencies, define the locale, and set the hooks for the admin area and |
|
| 760 | - * the public-facing side of the site. |
|
| 761 | - * |
|
| 762 | - * @since 1.0.0 |
|
| 763 | - */ |
|
| 764 | - public function __construct() { |
|
| 765 | - |
|
| 766 | - self::$instance = $this; |
|
| 767 | - |
|
| 768 | - $this->plugin_name = 'wordlift'; |
|
| 769 | - $this->version = '3.30.1'; |
|
| 770 | - $this->load_dependencies(); |
|
| 771 | - $this->set_locale(); |
|
| 772 | - $this->define_admin_hooks(); |
|
| 773 | - $this->define_public_hooks(); |
|
| 774 | - |
|
| 775 | - // If we're in `WP_CLI` load the related files. |
|
| 776 | - if ( class_exists( 'WP_CLI' ) ) { |
|
| 777 | - $this->load_cli_dependencies(); |
|
| 778 | - } |
|
| 779 | - |
|
| 780 | - } |
|
| 781 | - |
|
| 782 | - /** |
|
| 783 | - * Get the singleton instance. |
|
| 784 | - * |
|
| 785 | - * @return Wordlift The {@link Wordlift} singleton instance. |
|
| 786 | - * @since 3.11.2 |
|
| 787 | - * |
|
| 788 | - */ |
|
| 789 | - public static function get_instance() { |
|
| 790 | - |
|
| 791 | - return self::$instance; |
|
| 792 | - } |
|
| 793 | - |
|
| 794 | - /** |
|
| 795 | - * Load the required dependencies for this plugin. |
|
| 796 | - * |
|
| 797 | - * Include the following files that make up the plugin: |
|
| 798 | - * |
|
| 799 | - * - Wordlift_Loader. Orchestrates the hooks of the plugin. |
|
| 800 | - * - Wordlift_i18n. Defines internationalization functionality. |
|
| 801 | - * - Wordlift_Admin. Defines all hooks for the admin area. |
|
| 802 | - * - Wordlift_Public. Defines all hooks for the public side of the site. |
|
| 803 | - * |
|
| 804 | - * Create an instance of the loader which will be used to register the hooks |
|
| 805 | - * with WordPress. |
|
| 806 | - * |
|
| 807 | - * @throws Exception |
|
| 808 | - * @since 1.0.0 |
|
| 809 | - * @access private |
|
| 810 | - */ |
|
| 811 | - private function load_dependencies() { |
|
| 812 | - |
|
| 813 | - /** |
|
| 814 | - * The class responsible for orchestrating the actions and filters of the |
|
| 815 | - * core plugin. |
|
| 816 | - */ |
|
| 817 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 818 | - |
|
| 819 | - // The class responsible for plugin uninstall. |
|
| 820 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
|
| 821 | - |
|
| 822 | - /** |
|
| 823 | - * The class responsible for defining internationalization functionality |
|
| 824 | - * of the plugin. |
|
| 825 | - */ |
|
| 826 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 827 | - |
|
| 828 | - /** |
|
| 829 | - * WordLift's supported languages. |
|
| 830 | - */ |
|
| 831 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 832 | - |
|
| 833 | - /** |
|
| 834 | - * WordLift's supported countries. |
|
| 835 | - */ |
|
| 836 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php'; |
|
| 837 | - |
|
| 838 | - /** |
|
| 839 | - * Provide support functions to sanitize data. |
|
| 840 | - */ |
|
| 841 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 842 | - |
|
| 843 | - /** Services. */ |
|
| 844 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 845 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
|
| 846 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 847 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 848 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 849 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 850 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 851 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
|
| 852 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 853 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php'; |
|
| 854 | - |
|
| 855 | - /** |
|
| 856 | - * The Query builder. |
|
| 857 | - */ |
|
| 858 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 859 | - |
|
| 860 | - /** |
|
| 861 | - * The Schema service. |
|
| 862 | - */ |
|
| 863 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 864 | - |
|
| 865 | - /** |
|
| 866 | - * The schema:url property service. |
|
| 867 | - */ |
|
| 868 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 869 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 870 | - |
|
| 871 | - /** |
|
| 872 | - * The UI service. |
|
| 873 | - */ |
|
| 874 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 875 | - |
|
| 876 | - /** |
|
| 877 | - * The Thumbnail service. |
|
| 878 | - */ |
|
| 879 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 880 | - |
|
| 881 | - /** |
|
| 882 | - * The Entity Types Taxonomy service. |
|
| 883 | - */ |
|
| 884 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 885 | - |
|
| 886 | - /** |
|
| 887 | - * The Entity service. |
|
| 888 | - */ |
|
| 889 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
|
| 890 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 891 | - |
|
| 892 | - // Add the entity rating service. |
|
| 893 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 894 | - |
|
| 895 | - /** |
|
| 896 | - * The User service. |
|
| 897 | - */ |
|
| 898 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 899 | - |
|
| 900 | - /** |
|
| 901 | - * The Timeline service. |
|
| 902 | - */ |
|
| 903 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 904 | - |
|
| 905 | - /** |
|
| 906 | - * The Topic Taxonomy service. |
|
| 907 | - */ |
|
| 908 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 909 | - |
|
| 910 | - /** |
|
| 911 | - * The SPARQL service. |
|
| 912 | - */ |
|
| 913 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 914 | - |
|
| 915 | - /** |
|
| 916 | - * The WordLift import service. |
|
| 917 | - */ |
|
| 918 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 919 | - |
|
| 920 | - /** |
|
| 921 | - * The WordLift URI service. |
|
| 922 | - */ |
|
| 923 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 924 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 925 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 926 | - |
|
| 927 | - /** |
|
| 928 | - * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
|
| 929 | - */ |
|
| 930 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php'; |
|
| 931 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php'; |
|
| 932 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php'; |
|
| 933 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php'; |
|
| 934 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php'; |
|
| 935 | - |
|
| 936 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 937 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 938 | - |
|
| 939 | - /** |
|
| 940 | - * Load the converters. |
|
| 941 | - */ |
|
| 942 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 943 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 944 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 945 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 946 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 947 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 948 | - |
|
| 949 | - /** |
|
| 950 | - * Load cache-related files. |
|
| 951 | - */ |
|
| 952 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
|
| 953 | - |
|
| 954 | - /** |
|
| 955 | - * Load the content filter. |
|
| 956 | - */ |
|
| 957 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 958 | - |
|
| 959 | - /* |
|
| 79 | + //<editor-fold desc="## FIELDS"> |
|
| 80 | + |
|
| 81 | + /** |
|
| 82 | + * The loader that's responsible for maintaining and registering all hooks that power |
|
| 83 | + * the plugin. |
|
| 84 | + * |
|
| 85 | + * @since 1.0.0 |
|
| 86 | + * @access protected |
|
| 87 | + * @var Wordlift_Loader $loader Maintains and registers all hooks for the plugin. |
|
| 88 | + */ |
|
| 89 | + protected $loader; |
|
| 90 | + |
|
| 91 | + /** |
|
| 92 | + * The unique identifier of this plugin. |
|
| 93 | + * |
|
| 94 | + * @since 1.0.0 |
|
| 95 | + * @access protected |
|
| 96 | + * @var string $plugin_name The string used to uniquely identify this plugin. |
|
| 97 | + */ |
|
| 98 | + protected $plugin_name; |
|
| 99 | + |
|
| 100 | + /** |
|
| 101 | + * The current version of the plugin. |
|
| 102 | + * |
|
| 103 | + * @since 1.0.0 |
|
| 104 | + * @access protected |
|
| 105 | + * @var string $version The current version of the plugin. |
|
| 106 | + */ |
|
| 107 | + protected $version; |
|
| 108 | + |
|
| 109 | + /** |
|
| 110 | + * The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 111 | + * |
|
| 112 | + * @since 3.12.0 |
|
| 113 | + * @access protected |
|
| 114 | + * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 115 | + */ |
|
| 116 | + protected $tinymce_adapter; |
|
| 117 | + |
|
| 118 | + /** |
|
| 119 | + * The {@link Faq_Tinymce_Adapter} instance |
|
| 120 | + * @since 3.26.0 |
|
| 121 | + * @access protected |
|
| 122 | + * @var Faq_Tinymce_Adapter $faq_tinymce_adapter . |
|
| 123 | + */ |
|
| 124 | + //protected $faq_tinymce_adapter; |
|
| 125 | + |
|
| 126 | + /** |
|
| 127 | + * The Thumbnail service. |
|
| 128 | + * |
|
| 129 | + * @since 3.1.5 |
|
| 130 | + * @access private |
|
| 131 | + * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service. |
|
| 132 | + */ |
|
| 133 | + private $thumbnail_service; |
|
| 134 | + |
|
| 135 | + /** |
|
| 136 | + * The UI service. |
|
| 137 | + * |
|
| 138 | + * @since 3.2.0 |
|
| 139 | + * @access private |
|
| 140 | + * @var \Wordlift_UI_Service $ui_service The UI service. |
|
| 141 | + */ |
|
| 142 | + private $ui_service; |
|
| 143 | + |
|
| 144 | + /** |
|
| 145 | + * The Schema service. |
|
| 146 | + * |
|
| 147 | + * @since 3.3.0 |
|
| 148 | + * @access protected |
|
| 149 | + * @var \Wordlift_Schema_Service $schema_service The Schema service. |
|
| 150 | + */ |
|
| 151 | + protected $schema_service; |
|
| 152 | + |
|
| 153 | + /** |
|
| 154 | + * The Entity service. |
|
| 155 | + * |
|
| 156 | + * @since 3.1.0 |
|
| 157 | + * @access protected |
|
| 158 | + * @var \Wordlift_Entity_Service $entity_service The Entity service. |
|
| 159 | + */ |
|
| 160 | + protected $entity_service; |
|
| 161 | + |
|
| 162 | + /** |
|
| 163 | + * The Topic Taxonomy service. |
|
| 164 | + * |
|
| 165 | + * @since 3.5.0 |
|
| 166 | + * @access private |
|
| 167 | + * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service. |
|
| 168 | + */ |
|
| 169 | + private $topic_taxonomy_service; |
|
| 170 | + |
|
| 171 | + /** |
|
| 172 | + * The Entity Types Taxonomy service. |
|
| 173 | + * |
|
| 174 | + * @since 3.18.0 |
|
| 175 | + * @access private |
|
| 176 | + * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service. |
|
| 177 | + */ |
|
| 178 | + private $entity_types_taxonomy_service; |
|
| 179 | + |
|
| 180 | + /** |
|
| 181 | + * The User service. |
|
| 182 | + * |
|
| 183 | + * @since 3.1.7 |
|
| 184 | + * @access protected |
|
| 185 | + * @var \Wordlift_User_Service $user_service The User service. |
|
| 186 | + */ |
|
| 187 | + protected $user_service; |
|
| 188 | + |
|
| 189 | + /** |
|
| 190 | + * The Timeline service. |
|
| 191 | + * |
|
| 192 | + * @since 3.1.0 |
|
| 193 | + * @access private |
|
| 194 | + * @var \Wordlift_Timeline_Service $timeline_service The Timeline service. |
|
| 195 | + */ |
|
| 196 | + private $timeline_service; |
|
| 197 | + |
|
| 198 | + /** |
|
| 199 | + * The Redirect service. |
|
| 200 | + * |
|
| 201 | + * @since 3.2.0 |
|
| 202 | + * @access private |
|
| 203 | + * @var \Wordlift_Redirect_Service $redirect_service The Redirect service. |
|
| 204 | + */ |
|
| 205 | + private $redirect_service; |
|
| 206 | + |
|
| 207 | + /** |
|
| 208 | + * The Notice service. |
|
| 209 | + * |
|
| 210 | + * @since 3.3.0 |
|
| 211 | + * @access private |
|
| 212 | + * @var \Wordlift_Notice_Service $notice_service The Notice service. |
|
| 213 | + */ |
|
| 214 | + private $notice_service; |
|
| 215 | + |
|
| 216 | + /** |
|
| 217 | + * The Entity list customization. |
|
| 218 | + * |
|
| 219 | + * @since 3.3.0 |
|
| 220 | + * @access protected |
|
| 221 | + * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service. |
|
| 222 | + */ |
|
| 223 | + protected $entity_list_service; |
|
| 224 | + |
|
| 225 | + /** |
|
| 226 | + * The Entity Types Taxonomy Walker. |
|
| 227 | + * |
|
| 228 | + * @since 3.1.0 |
|
| 229 | + * @access private |
|
| 230 | + * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker |
|
| 231 | + */ |
|
| 232 | + private $entity_types_taxonomy_walker; |
|
| 233 | + |
|
| 234 | + /** |
|
| 235 | + * The ShareThis service. |
|
| 236 | + * |
|
| 237 | + * @since 3.2.0 |
|
| 238 | + * @access private |
|
| 239 | + * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service. |
|
| 240 | + */ |
|
| 241 | + private $sharethis_service; |
|
| 242 | + |
|
| 243 | + /** |
|
| 244 | + * The PrimaShop adapter. |
|
| 245 | + * |
|
| 246 | + * @since 3.2.3 |
|
| 247 | + * @access private |
|
| 248 | + * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter. |
|
| 249 | + */ |
|
| 250 | + private $primashop_adapter; |
|
| 251 | + |
|
| 252 | + /** |
|
| 253 | + * The WordLift Dashboard adapter. |
|
| 254 | + * |
|
| 255 | + * @since 3.4.0 |
|
| 256 | + * @access private |
|
| 257 | + * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service; |
|
| 258 | + */ |
|
| 259 | + private $dashboard_service; |
|
| 260 | + |
|
| 261 | + /** |
|
| 262 | + * The entity type service. |
|
| 263 | + * |
|
| 264 | + * @since 3.6.0 |
|
| 265 | + * @access private |
|
| 266 | + * @var \Wordlift_Entity_Post_Type_Service |
|
| 267 | + */ |
|
| 268 | + private $entity_post_type_service; |
|
| 269 | + |
|
| 270 | + /** |
|
| 271 | + * The entity link service used to mangle links to entities with a custom slug or even w/o a slug. |
|
| 272 | + * |
|
| 273 | + * @since 3.6.0 |
|
| 274 | + * @access private |
|
| 275 | + * @var \Wordlift_Entity_Link_Service $entity_link_service The {@link Wordlift_Entity_Link_Service} instance. |
|
| 276 | + */ |
|
| 277 | + private $entity_link_service; |
|
| 278 | + |
|
| 279 | + /** |
|
| 280 | + * A {@link Wordlift_Sparql_Service} instance. |
|
| 281 | + * |
|
| 282 | + * @since 3.6.0 |
|
| 283 | + * @access protected |
|
| 284 | + * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance. |
|
| 285 | + */ |
|
| 286 | + protected $sparql_service; |
|
| 287 | + |
|
| 288 | + /** |
|
| 289 | + * A {@link Wordlift_Import_Service} instance. |
|
| 290 | + * |
|
| 291 | + * @since 3.6.0 |
|
| 292 | + * @access private |
|
| 293 | + * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance. |
|
| 294 | + */ |
|
| 295 | + private $import_service; |
|
| 296 | + |
|
| 297 | + /** |
|
| 298 | + * A {@link Wordlift_Rebuild_Service} instance. |
|
| 299 | + * |
|
| 300 | + * @since 3.6.0 |
|
| 301 | + * @access private |
|
| 302 | + * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance. |
|
| 303 | + */ |
|
| 304 | + private $rebuild_service; |
|
| 305 | + |
|
| 306 | + /** |
|
| 307 | + * A {@link Wordlift_Jsonld_Service} instance. |
|
| 308 | + * |
|
| 309 | + * @since 3.7.0 |
|
| 310 | + * @access protected |
|
| 311 | + * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance. |
|
| 312 | + */ |
|
| 313 | + protected $jsonld_service; |
|
| 314 | + |
|
| 315 | + /** |
|
| 316 | + * A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 317 | + * |
|
| 318 | + * @since 3.14.0 |
|
| 319 | + * @access protected |
|
| 320 | + * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 321 | + */ |
|
| 322 | + protected $jsonld_website_converter; |
|
| 323 | + |
|
| 324 | + /** |
|
| 325 | + * A {@link Wordlift_Property_Factory} instance. |
|
| 326 | + * |
|
| 327 | + * @since 3.7.0 |
|
| 328 | + * @access private |
|
| 329 | + * @var \Wordlift_Property_Factory $property_factory |
|
| 330 | + */ |
|
| 331 | + private $property_factory; |
|
| 332 | + |
|
| 333 | + /** |
|
| 334 | + * The 'Download Your Data' page. |
|
| 335 | + * |
|
| 336 | + * @since 3.6.0 |
|
| 337 | + * @access private |
|
| 338 | + * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page. |
|
| 339 | + */ |
|
| 340 | + private $download_your_data_page; |
|
| 341 | + |
|
| 342 | + /** |
|
| 343 | + * The 'WordLift Settings' page. |
|
| 344 | + * |
|
| 345 | + * @since 3.11.0 |
|
| 346 | + * @access protected |
|
| 347 | + * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page. |
|
| 348 | + */ |
|
| 349 | + protected $settings_page; |
|
| 350 | + |
|
| 351 | + /** |
|
| 352 | + * The install wizard page. |
|
| 353 | + * |
|
| 354 | + * @since 3.9.0 |
|
| 355 | + * @access private |
|
| 356 | + * @var \Wordlift_Admin_Setup $admin_setup The Install wizard. |
|
| 357 | + */ |
|
| 358 | + public $admin_setup; |
|
| 359 | + |
|
| 360 | + /** |
|
| 361 | + * The Content Filter Service hooks up to the 'the_content' filter and provides |
|
| 362 | + * linking of entities to their pages. |
|
| 363 | + * |
|
| 364 | + * @since 3.8.0 |
|
| 365 | + * @access private |
|
| 366 | + * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance. |
|
| 367 | + */ |
|
| 368 | + private $content_filter_service; |
|
| 369 | + |
|
| 370 | + /** |
|
| 371 | + * The Faq Content filter service |
|
| 372 | + * @since 3.26.0 |
|
| 373 | + * @access private |
|
| 374 | + * @var Faq_Content_Filter $faq_content_filter_service A {@link Faq_Content_Filter} instance. |
|
| 375 | + */ |
|
| 376 | + private $faq_content_filter_service; |
|
| 377 | + |
|
| 378 | + /** |
|
| 379 | + * A {@link Wordlift_Key_Validation_Service} instance. |
|
| 380 | + * |
|
| 381 | + * @since 3.9.0 |
|
| 382 | + * @access private |
|
| 383 | + * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance. |
|
| 384 | + */ |
|
| 385 | + private $key_validation_service; |
|
| 386 | + |
|
| 387 | + /** |
|
| 388 | + * A {@link Wordlift_Rating_Service} instance. |
|
| 389 | + * |
|
| 390 | + * @since 3.10.0 |
|
| 391 | + * @access private |
|
| 392 | + * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance. |
|
| 393 | + */ |
|
| 394 | + private $rating_service; |
|
| 395 | + |
|
| 396 | + /** |
|
| 397 | + * A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 398 | + * |
|
| 399 | + * @since 3.10.0 |
|
| 400 | + * @access protected |
|
| 401 | + * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 402 | + */ |
|
| 403 | + protected $post_to_jsonld_converter; |
|
| 404 | + |
|
| 405 | + /** |
|
| 406 | + * A {@link Wordlift_Configuration_Service} instance. |
|
| 407 | + * |
|
| 408 | + * @since 3.10.0 |
|
| 409 | + * @access protected |
|
| 410 | + * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance. |
|
| 411 | + */ |
|
| 412 | + protected $configuration_service; |
|
| 413 | + |
|
| 414 | + /** |
|
| 415 | + * A {@link Wordlift_Install_Service} instance. |
|
| 416 | + * |
|
| 417 | + * @since 3.18.0 |
|
| 418 | + * @access protected |
|
| 419 | + * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance. |
|
| 420 | + */ |
|
| 421 | + protected $install_service; |
|
| 422 | + |
|
| 423 | + /** |
|
| 424 | + * A {@link Wordlift_Entity_Type_Service} instance. |
|
| 425 | + * |
|
| 426 | + * @since 3.10.0 |
|
| 427 | + * @access protected |
|
| 428 | + * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance. |
|
| 429 | + */ |
|
| 430 | + protected $entity_type_service; |
|
| 431 | + |
|
| 432 | + /** |
|
| 433 | + * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 434 | + * |
|
| 435 | + * @since 3.10.0 |
|
| 436 | + * @access protected |
|
| 437 | + * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 438 | + */ |
|
| 439 | + protected $entity_post_to_jsonld_converter; |
|
| 440 | + |
|
| 441 | + /** |
|
| 442 | + * A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 443 | + * |
|
| 444 | + * @since 3.10.0 |
|
| 445 | + * @access protected |
|
| 446 | + * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 447 | + */ |
|
| 448 | + protected $postid_to_jsonld_converter; |
|
| 449 | + |
|
| 450 | + /** |
|
| 451 | + * The {@link Wordlift_Admin_Status_Page} class. |
|
| 452 | + * |
|
| 453 | + * @since 3.9.8 |
|
| 454 | + * @access private |
|
| 455 | + * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class. |
|
| 456 | + */ |
|
| 457 | + private $status_page; |
|
| 458 | + |
|
| 459 | + /** |
|
| 460 | + * The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 461 | + * |
|
| 462 | + * @since 3.11.0 |
|
| 463 | + * @access protected |
|
| 464 | + * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 465 | + */ |
|
| 466 | + protected $category_taxonomy_service; |
|
| 467 | + |
|
| 468 | + /** |
|
| 469 | + * The {@link Wordlift_Entity_Page_Service} instance. |
|
| 470 | + * |
|
| 471 | + * @since 3.11.0 |
|
| 472 | + * @access protected |
|
| 473 | + * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance. |
|
| 474 | + */ |
|
| 475 | + protected $entity_page_service; |
|
| 476 | + |
|
| 477 | + /** |
|
| 478 | + * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 479 | + * |
|
| 480 | + * @since 3.11.0 |
|
| 481 | + * @access protected |
|
| 482 | + * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 483 | + */ |
|
| 484 | + protected $settings_page_action_link; |
|
| 485 | + |
|
| 486 | + /** |
|
| 487 | + * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 488 | + * |
|
| 489 | + * @since 3.11.0 |
|
| 490 | + * @access protected |
|
| 491 | + * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 492 | + */ |
|
| 493 | + protected $analytics_settings_page_action_link; |
|
| 494 | + |
|
| 495 | + /** |
|
| 496 | + * The {@link Wordlift_Analytics_Connect} class. |
|
| 497 | + * |
|
| 498 | + * @since 3.11.0 |
|
| 499 | + * @access protected |
|
| 500 | + * @var \Wordlift_Analytics_Connect $analytics_connect The {@link Wordlift_Analytics_Connect} class. |
|
| 501 | + */ |
|
| 502 | + protected $analytics_connect; |
|
| 503 | + |
|
| 504 | + /** |
|
| 505 | + * The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 506 | + * |
|
| 507 | + * @since 3.11.0 |
|
| 508 | + * @access protected |
|
| 509 | + * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 510 | + */ |
|
| 511 | + protected $publisher_ajax_adapter; |
|
| 512 | + |
|
| 513 | + /** |
|
| 514 | + * The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 515 | + * |
|
| 516 | + * @since 3.11.0 |
|
| 517 | + * @access protected |
|
| 518 | + * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 519 | + */ |
|
| 520 | + protected $input_element; |
|
| 521 | + |
|
| 522 | + /** |
|
| 523 | + * The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 524 | + * |
|
| 525 | + * @since 3.13.0 |
|
| 526 | + * @access protected |
|
| 527 | + * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 528 | + */ |
|
| 529 | + protected $radio_input_element; |
|
| 530 | + |
|
| 531 | + /** |
|
| 532 | + * The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 533 | + * |
|
| 534 | + * @since 3.11.0 |
|
| 535 | + * @access protected |
|
| 536 | + * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 537 | + */ |
|
| 538 | + protected $language_select_element; |
|
| 539 | + |
|
| 540 | + /** |
|
| 541 | + * The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
| 542 | + * |
|
| 543 | + * @since 3.18.0 |
|
| 544 | + * @access protected |
|
| 545 | + * @var \Wordlift_Admin_Country_Select_Element $country_select_element The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
| 546 | + */ |
|
| 547 | + protected $country_select_element; |
|
| 548 | + |
|
| 549 | + /** |
|
| 550 | + * The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 551 | + * |
|
| 552 | + * @since 3.11.0 |
|
| 553 | + * @access protected |
|
| 554 | + * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 555 | + */ |
|
| 556 | + protected $publisher_element; |
|
| 557 | + |
|
| 558 | + /** |
|
| 559 | + * The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 560 | + * |
|
| 561 | + * @since 3.11.0 |
|
| 562 | + * @access protected |
|
| 563 | + * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 564 | + */ |
|
| 565 | + protected $select2_element; |
|
| 566 | + |
|
| 567 | + /** |
|
| 568 | + * The controller for the entity type list admin page |
|
| 569 | + * |
|
| 570 | + * @since 3.11.0 |
|
| 571 | + * @access private |
|
| 572 | + * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class. |
|
| 573 | + */ |
|
| 574 | + private $entity_type_admin_page; |
|
| 575 | + |
|
| 576 | + /** |
|
| 577 | + * The controller for the entity type settings admin page |
|
| 578 | + * |
|
| 579 | + * @since 3.11.0 |
|
| 580 | + * @access private |
|
| 581 | + * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class. |
|
| 582 | + */ |
|
| 583 | + private $entity_type_settings_admin_page; |
|
| 584 | + |
|
| 585 | + /** |
|
| 586 | + * The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 587 | + * |
|
| 588 | + * @since 3.11.0 |
|
| 589 | + * @access protected |
|
| 590 | + * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 591 | + */ |
|
| 592 | + protected $related_entities_cloud_widget; |
|
| 593 | + |
|
| 594 | + /** |
|
| 595 | + * The {@link Wordlift_Admin_Author_Element} instance. |
|
| 596 | + * |
|
| 597 | + * @since 3.14.0 |
|
| 598 | + * @access protected |
|
| 599 | + * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance. |
|
| 600 | + */ |
|
| 601 | + protected $author_element; |
|
| 602 | + |
|
| 603 | + /** |
|
| 604 | + * The {@link Wordlift_Sample_Data_Service} instance. |
|
| 605 | + * |
|
| 606 | + * @since 3.12.0 |
|
| 607 | + * @access protected |
|
| 608 | + * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance. |
|
| 609 | + */ |
|
| 610 | + protected $sample_data_service; |
|
| 611 | + |
|
| 612 | + /** |
|
| 613 | + * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 614 | + * |
|
| 615 | + * @since 3.12.0 |
|
| 616 | + * @access protected |
|
| 617 | + * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 618 | + */ |
|
| 619 | + protected $sample_data_ajax_adapter; |
|
| 620 | + |
|
| 621 | + /** |
|
| 622 | + * The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 623 | + * |
|
| 624 | + * @since 3.14.3 |
|
| 625 | + * @access private |
|
| 626 | + * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 627 | + */ |
|
| 628 | + private $relation_rebuild_service; |
|
| 629 | + |
|
| 630 | + /** |
|
| 631 | + * The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 632 | + * |
|
| 633 | + * @since 3.14.3 |
|
| 634 | + * @access private |
|
| 635 | + * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 636 | + */ |
|
| 637 | + private $relation_rebuild_adapter; |
|
| 638 | + |
|
| 639 | + /** |
|
| 640 | + * The {@link Wordlift_Reference_Rebuild_Service} instance. |
|
| 641 | + * |
|
| 642 | + * @since 3.18.0 |
|
| 643 | + * @access private |
|
| 644 | + * @var \Wordlift_Reference_Rebuild_Service $reference_rebuild_service The {@link Wordlift_Reference_Rebuild_Service} instance. |
|
| 645 | + */ |
|
| 646 | + private $reference_rebuild_service; |
|
| 647 | + |
|
| 648 | + /** |
|
| 649 | + * The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 650 | + * |
|
| 651 | + * @since 3.16.0 |
|
| 652 | + * @access protected |
|
| 653 | + * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 654 | + */ |
|
| 655 | + protected $google_analytics_export_service; |
|
| 656 | + |
|
| 657 | + /** |
|
| 658 | + * {@link Wordlift}'s singleton instance. |
|
| 659 | + * |
|
| 660 | + * @since 3.15.0 |
|
| 661 | + * @access protected |
|
| 662 | + * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance. |
|
| 663 | + */ |
|
| 664 | + protected $entity_type_adapter; |
|
| 665 | + |
|
| 666 | + /** |
|
| 667 | + * The {@link Wordlift_Storage_Factory} instance. |
|
| 668 | + * |
|
| 669 | + * @since 3.15.0 |
|
| 670 | + * @access protected |
|
| 671 | + * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance. |
|
| 672 | + */ |
|
| 673 | + protected $storage_factory; |
|
| 674 | + |
|
| 675 | + /** |
|
| 676 | + * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 677 | + * |
|
| 678 | + * @since 3.15.0 |
|
| 679 | + * @access protected |
|
| 680 | + * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 681 | + */ |
|
| 682 | + protected $rendition_factory; |
|
| 683 | + |
|
| 684 | + /** |
|
| 685 | + * The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 686 | + * |
|
| 687 | + * @since 3.15.0 |
|
| 688 | + * @access private |
|
| 689 | + * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 690 | + */ |
|
| 691 | + private $autocomplete_adapter; |
|
| 692 | + |
|
| 693 | + /** |
|
| 694 | + * The {@link Wordlift_Relation_Service} instance. |
|
| 695 | + * |
|
| 696 | + * @since 3.15.0 |
|
| 697 | + * @access protected |
|
| 698 | + * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance. |
|
| 699 | + */ |
|
| 700 | + protected $relation_service; |
|
| 701 | + |
|
| 702 | + /** |
|
| 703 | + * The {@link Wordlift_Cached_Post_Converter} instance. |
|
| 704 | + * |
|
| 705 | + * @since 3.16.0 |
|
| 706 | + * @access protected |
|
| 707 | + * @var \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance. |
|
| 708 | + * |
|
| 709 | + */ |
|
| 710 | + protected $cached_postid_to_jsonld_converter; |
|
| 711 | + |
|
| 712 | + /** |
|
| 713 | + * The {@link Wordlift_Entity_Uri_Service} instance. |
|
| 714 | + * |
|
| 715 | + * @since 3.16.3 |
|
| 716 | + * @access protected |
|
| 717 | + * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance. |
|
| 718 | + */ |
|
| 719 | + protected $entity_uri_service; |
|
| 720 | + |
|
| 721 | + /** |
|
| 722 | + * The {@link Wordlift_Publisher_Service} instance. |
|
| 723 | + * |
|
| 724 | + * @since 3.19.0 |
|
| 725 | + * @access protected |
|
| 726 | + * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance. |
|
| 727 | + */ |
|
| 728 | + protected $publisher_service; |
|
| 729 | + |
|
| 730 | + /** |
|
| 731 | + * The {@link Wordlift_Context_Cards_Service} instance. |
|
| 732 | + * |
|
| 733 | + * @var \Wordlift_Context_Cards_Service The {@link Wordlift_Context_Cards_Service} instance. |
|
| 734 | + */ |
|
| 735 | + protected $context_cards_service; |
|
| 736 | + |
|
| 737 | + /** |
|
| 738 | + * {@link Wordlift}'s singleton instance. |
|
| 739 | + * |
|
| 740 | + * @since 3.11.2 |
|
| 741 | + * @access private |
|
| 742 | + * @var Wordlift $instance {@link Wordlift}'s singleton instance. |
|
| 743 | + */ |
|
| 744 | + private static $instance; |
|
| 745 | + |
|
| 746 | + /** |
|
| 747 | + * A singleton instance of features registry. |
|
| 748 | + * @since 3.30.0 |
|
| 749 | + * @var Features_Registry |
|
| 750 | + */ |
|
| 751 | + private $features_registry; |
|
| 752 | + |
|
| 753 | + //</editor-fold> |
|
| 754 | + |
|
| 755 | + /** |
|
| 756 | + * Define the core functionality of the plugin. |
|
| 757 | + * |
|
| 758 | + * Set the plugin name and the plugin version that can be used throughout the plugin. |
|
| 759 | + * Load the dependencies, define the locale, and set the hooks for the admin area and |
|
| 760 | + * the public-facing side of the site. |
|
| 761 | + * |
|
| 762 | + * @since 1.0.0 |
|
| 763 | + */ |
|
| 764 | + public function __construct() { |
|
| 765 | + |
|
| 766 | + self::$instance = $this; |
|
| 767 | + |
|
| 768 | + $this->plugin_name = 'wordlift'; |
|
| 769 | + $this->version = '3.30.1'; |
|
| 770 | + $this->load_dependencies(); |
|
| 771 | + $this->set_locale(); |
|
| 772 | + $this->define_admin_hooks(); |
|
| 773 | + $this->define_public_hooks(); |
|
| 774 | + |
|
| 775 | + // If we're in `WP_CLI` load the related files. |
|
| 776 | + if ( class_exists( 'WP_CLI' ) ) { |
|
| 777 | + $this->load_cli_dependencies(); |
|
| 778 | + } |
|
| 779 | + |
|
| 780 | + } |
|
| 781 | + |
|
| 782 | + /** |
|
| 783 | + * Get the singleton instance. |
|
| 784 | + * |
|
| 785 | + * @return Wordlift The {@link Wordlift} singleton instance. |
|
| 786 | + * @since 3.11.2 |
|
| 787 | + * |
|
| 788 | + */ |
|
| 789 | + public static function get_instance() { |
|
| 790 | + |
|
| 791 | + return self::$instance; |
|
| 792 | + } |
|
| 793 | + |
|
| 794 | + /** |
|
| 795 | + * Load the required dependencies for this plugin. |
|
| 796 | + * |
|
| 797 | + * Include the following files that make up the plugin: |
|
| 798 | + * |
|
| 799 | + * - Wordlift_Loader. Orchestrates the hooks of the plugin. |
|
| 800 | + * - Wordlift_i18n. Defines internationalization functionality. |
|
| 801 | + * - Wordlift_Admin. Defines all hooks for the admin area. |
|
| 802 | + * - Wordlift_Public. Defines all hooks for the public side of the site. |
|
| 803 | + * |
|
| 804 | + * Create an instance of the loader which will be used to register the hooks |
|
| 805 | + * with WordPress. |
|
| 806 | + * |
|
| 807 | + * @throws Exception |
|
| 808 | + * @since 1.0.0 |
|
| 809 | + * @access private |
|
| 810 | + */ |
|
| 811 | + private function load_dependencies() { |
|
| 812 | + |
|
| 813 | + /** |
|
| 814 | + * The class responsible for orchestrating the actions and filters of the |
|
| 815 | + * core plugin. |
|
| 816 | + */ |
|
| 817 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 818 | + |
|
| 819 | + // The class responsible for plugin uninstall. |
|
| 820 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
|
| 821 | + |
|
| 822 | + /** |
|
| 823 | + * The class responsible for defining internationalization functionality |
|
| 824 | + * of the plugin. |
|
| 825 | + */ |
|
| 826 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 827 | + |
|
| 828 | + /** |
|
| 829 | + * WordLift's supported languages. |
|
| 830 | + */ |
|
| 831 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 832 | + |
|
| 833 | + /** |
|
| 834 | + * WordLift's supported countries. |
|
| 835 | + */ |
|
| 836 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php'; |
|
| 837 | + |
|
| 838 | + /** |
|
| 839 | + * Provide support functions to sanitize data. |
|
| 840 | + */ |
|
| 841 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 842 | + |
|
| 843 | + /** Services. */ |
|
| 844 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 845 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
|
| 846 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 847 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 848 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 849 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 850 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 851 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
|
| 852 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 853 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php'; |
|
| 854 | + |
|
| 855 | + /** |
|
| 856 | + * The Query builder. |
|
| 857 | + */ |
|
| 858 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 859 | + |
|
| 860 | + /** |
|
| 861 | + * The Schema service. |
|
| 862 | + */ |
|
| 863 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 864 | + |
|
| 865 | + /** |
|
| 866 | + * The schema:url property service. |
|
| 867 | + */ |
|
| 868 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 869 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 870 | + |
|
| 871 | + /** |
|
| 872 | + * The UI service. |
|
| 873 | + */ |
|
| 874 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 875 | + |
|
| 876 | + /** |
|
| 877 | + * The Thumbnail service. |
|
| 878 | + */ |
|
| 879 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 880 | + |
|
| 881 | + /** |
|
| 882 | + * The Entity Types Taxonomy service. |
|
| 883 | + */ |
|
| 884 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 885 | + |
|
| 886 | + /** |
|
| 887 | + * The Entity service. |
|
| 888 | + */ |
|
| 889 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
|
| 890 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 891 | + |
|
| 892 | + // Add the entity rating service. |
|
| 893 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 894 | + |
|
| 895 | + /** |
|
| 896 | + * The User service. |
|
| 897 | + */ |
|
| 898 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 899 | + |
|
| 900 | + /** |
|
| 901 | + * The Timeline service. |
|
| 902 | + */ |
|
| 903 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 904 | + |
|
| 905 | + /** |
|
| 906 | + * The Topic Taxonomy service. |
|
| 907 | + */ |
|
| 908 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 909 | + |
|
| 910 | + /** |
|
| 911 | + * The SPARQL service. |
|
| 912 | + */ |
|
| 913 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 914 | + |
|
| 915 | + /** |
|
| 916 | + * The WordLift import service. |
|
| 917 | + */ |
|
| 918 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 919 | + |
|
| 920 | + /** |
|
| 921 | + * The WordLift URI service. |
|
| 922 | + */ |
|
| 923 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 924 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 925 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 926 | + |
|
| 927 | + /** |
|
| 928 | + * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
|
| 929 | + */ |
|
| 930 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php'; |
|
| 931 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php'; |
|
| 932 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php'; |
|
| 933 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php'; |
|
| 934 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php'; |
|
| 935 | + |
|
| 936 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 937 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 938 | + |
|
| 939 | + /** |
|
| 940 | + * Load the converters. |
|
| 941 | + */ |
|
| 942 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 943 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 944 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 945 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 946 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 947 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 948 | + |
|
| 949 | + /** |
|
| 950 | + * Load cache-related files. |
|
| 951 | + */ |
|
| 952 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
|
| 953 | + |
|
| 954 | + /** |
|
| 955 | + * Load the content filter. |
|
| 956 | + */ |
|
| 957 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 958 | + |
|
| 959 | + /* |
|
| 960 | 960 | * Load the excerpt helper. |
| 961 | 961 | */ |
| 962 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 963 | - |
|
| 964 | - /** |
|
| 965 | - * Load the JSON-LD service to publish entities using JSON-LD.s |
|
| 966 | - * |
|
| 967 | - * @since 3.8.0 |
|
| 968 | - */ |
|
| 969 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 970 | - |
|
| 971 | - // The Publisher Service and the AJAX adapter. |
|
| 972 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 973 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 974 | - |
|
| 975 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 976 | - |
|
| 977 | - /** |
|
| 978 | - * Load the WordLift key validation service. |
|
| 979 | - */ |
|
| 980 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 981 | - |
|
| 982 | - // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
|
| 983 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 984 | - |
|
| 985 | - // Load the `Wordlift_Entity_Page_Service` class definition. |
|
| 986 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
| 987 | - |
|
| 988 | - /** Linked Data. */ |
|
| 989 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 990 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 991 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 992 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 993 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 994 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 995 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 996 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 997 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 998 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 999 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 1000 | - |
|
| 1001 | - /** Linked Data Rendition. */ |
|
| 1002 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php'; |
|
| 1003 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php'; |
|
| 1004 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php'; |
|
| 1005 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 1006 | - |
|
| 1007 | - /** Services. */ |
|
| 1008 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 1009 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php'; |
|
| 1010 | - |
|
| 1011 | - /** Adapters. */ |
|
| 1012 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 1013 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 1014 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 1015 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 1016 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php'; |
|
| 1017 | - |
|
| 1018 | - /** Async Tasks. */ |
|
| 1019 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php'; |
|
| 1020 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 1021 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php'; |
|
| 1022 | - |
|
| 1023 | - /** Autocomplete. */ |
|
| 1024 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 1025 | - |
|
| 1026 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
|
| 1027 | - |
|
| 1028 | - /** Analytics */ |
|
| 1029 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 1030 | - |
|
| 1031 | - /** |
|
| 1032 | - * The class responsible for defining all actions that occur in the admin area. |
|
| 1033 | - */ |
|
| 1034 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 1035 | - |
|
| 1036 | - /** |
|
| 1037 | - * The class to customize the entity list admin page. |
|
| 1038 | - */ |
|
| 1039 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 1040 | - |
|
| 1041 | - /** |
|
| 1042 | - * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
|
| 1043 | - */ |
|
| 1044 | - global $wp_version; |
|
| 1045 | - if ( version_compare( $wp_version, '5.3', '<' ) ) { |
|
| 1046 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 1047 | - } else { |
|
| 1048 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
| 1049 | - } |
|
| 1050 | - |
|
| 1051 | - /** |
|
| 1052 | - * The Notice service. |
|
| 1053 | - */ |
|
| 1054 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 1055 | - |
|
| 1056 | - /** |
|
| 1057 | - * The PrimaShop adapter. |
|
| 1058 | - */ |
|
| 1059 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 1060 | - |
|
| 1061 | - /** |
|
| 1062 | - * The WordLift Dashboard service. |
|
| 1063 | - */ |
|
| 1064 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 1065 | - |
|
| 1066 | - /** |
|
| 1067 | - * The admin 'Install wizard' page. |
|
| 1068 | - */ |
|
| 1069 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 1070 | - |
|
| 1071 | - /** |
|
| 1072 | - * The WordLift entity type list admin page controller. |
|
| 1073 | - */ |
|
| 1074 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 1075 | - |
|
| 1076 | - /** |
|
| 1077 | - * The WordLift entity type settings admin page controller. |
|
| 1078 | - */ |
|
| 1079 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 1080 | - |
|
| 1081 | - /** |
|
| 1082 | - * The admin 'Download Your Data' page. |
|
| 1083 | - */ |
|
| 1084 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 1085 | - |
|
| 1086 | - /** |
|
| 1087 | - * The admin 'WordLift Settings' page. |
|
| 1088 | - */ |
|
| 1089 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php'; |
|
| 1090 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 1091 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 1092 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 1093 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 1094 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 1095 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 1096 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 1097 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 1098 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 1099 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 1100 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 1101 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
| 1102 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 1103 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
| 1104 | - |
|
| 1105 | - /** Admin Pages */ |
|
| 1106 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 1107 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 1108 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-page.php'; |
|
| 1109 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 1110 | - |
|
| 1111 | - /** |
|
| 1112 | - * The class responsible for defining all actions that occur in the public-facing |
|
| 1113 | - * side of the site. |
|
| 1114 | - */ |
|
| 1115 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 1116 | - |
|
| 1117 | - /** |
|
| 1118 | - * The shortcode abstract class. |
|
| 1119 | - */ |
|
| 1120 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 1121 | - |
|
| 1122 | - /** |
|
| 1123 | - * The Timeline shortcode. |
|
| 1124 | - */ |
|
| 1125 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 1126 | - |
|
| 1127 | - /** |
|
| 1128 | - * The Navigator shortcode. |
|
| 1129 | - */ |
|
| 1130 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 1131 | - |
|
| 1132 | - /** |
|
| 1133 | - * The Products Navigator shortcode. |
|
| 1134 | - */ |
|
| 1135 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php'; |
|
| 1136 | - |
|
| 1137 | - /** |
|
| 1138 | - * The chord shortcode. |
|
| 1139 | - */ |
|
| 1140 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 1141 | - |
|
| 1142 | - /** |
|
| 1143 | - * The geomap shortcode. |
|
| 1144 | - */ |
|
| 1145 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 1146 | - |
|
| 1147 | - /** |
|
| 1148 | - * The entity cloud shortcode. |
|
| 1149 | - */ |
|
| 1150 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 1151 | - |
|
| 1152 | - /** |
|
| 1153 | - * The entity glossary shortcode. |
|
| 1154 | - */ |
|
| 1155 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
|
| 1156 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 1157 | - |
|
| 1158 | - /** |
|
| 1159 | - * Faceted Search shortcode. |
|
| 1160 | - */ |
|
| 1161 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 1162 | - |
|
| 1163 | - /** |
|
| 1164 | - * The ShareThis service. |
|
| 1165 | - */ |
|
| 1166 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 1167 | - |
|
| 1168 | - /** |
|
| 1169 | - * The SEO service. |
|
| 1170 | - */ |
|
| 1171 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 1172 | - |
|
| 1173 | - /** |
|
| 1174 | - * The AMP service. |
|
| 1175 | - */ |
|
| 1176 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1177 | - |
|
| 1178 | - /** Widgets */ |
|
| 1179 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1180 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1181 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php'; |
|
| 1182 | - |
|
| 1183 | - /* |
|
| 962 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 963 | + |
|
| 964 | + /** |
|
| 965 | + * Load the JSON-LD service to publish entities using JSON-LD.s |
|
| 966 | + * |
|
| 967 | + * @since 3.8.0 |
|
| 968 | + */ |
|
| 969 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 970 | + |
|
| 971 | + // The Publisher Service and the AJAX adapter. |
|
| 972 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 973 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 974 | + |
|
| 975 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 976 | + |
|
| 977 | + /** |
|
| 978 | + * Load the WordLift key validation service. |
|
| 979 | + */ |
|
| 980 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 981 | + |
|
| 982 | + // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
|
| 983 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 984 | + |
|
| 985 | + // Load the `Wordlift_Entity_Page_Service` class definition. |
|
| 986 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
| 987 | + |
|
| 988 | + /** Linked Data. */ |
|
| 989 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 990 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 991 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 992 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 993 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 994 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 995 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 996 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 997 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 998 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 999 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 1000 | + |
|
| 1001 | + /** Linked Data Rendition. */ |
|
| 1002 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php'; |
|
| 1003 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php'; |
|
| 1004 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php'; |
|
| 1005 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 1006 | + |
|
| 1007 | + /** Services. */ |
|
| 1008 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 1009 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php'; |
|
| 1010 | + |
|
| 1011 | + /** Adapters. */ |
|
| 1012 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 1013 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 1014 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 1015 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 1016 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php'; |
|
| 1017 | + |
|
| 1018 | + /** Async Tasks. */ |
|
| 1019 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php'; |
|
| 1020 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 1021 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php'; |
|
| 1022 | + |
|
| 1023 | + /** Autocomplete. */ |
|
| 1024 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 1025 | + |
|
| 1026 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
|
| 1027 | + |
|
| 1028 | + /** Analytics */ |
|
| 1029 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 1030 | + |
|
| 1031 | + /** |
|
| 1032 | + * The class responsible for defining all actions that occur in the admin area. |
|
| 1033 | + */ |
|
| 1034 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 1035 | + |
|
| 1036 | + /** |
|
| 1037 | + * The class to customize the entity list admin page. |
|
| 1038 | + */ |
|
| 1039 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 1040 | + |
|
| 1041 | + /** |
|
| 1042 | + * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
|
| 1043 | + */ |
|
| 1044 | + global $wp_version; |
|
| 1045 | + if ( version_compare( $wp_version, '5.3', '<' ) ) { |
|
| 1046 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 1047 | + } else { |
|
| 1048 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
| 1049 | + } |
|
| 1050 | + |
|
| 1051 | + /** |
|
| 1052 | + * The Notice service. |
|
| 1053 | + */ |
|
| 1054 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 1055 | + |
|
| 1056 | + /** |
|
| 1057 | + * The PrimaShop adapter. |
|
| 1058 | + */ |
|
| 1059 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 1060 | + |
|
| 1061 | + /** |
|
| 1062 | + * The WordLift Dashboard service. |
|
| 1063 | + */ |
|
| 1064 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 1065 | + |
|
| 1066 | + /** |
|
| 1067 | + * The admin 'Install wizard' page. |
|
| 1068 | + */ |
|
| 1069 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 1070 | + |
|
| 1071 | + /** |
|
| 1072 | + * The WordLift entity type list admin page controller. |
|
| 1073 | + */ |
|
| 1074 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 1075 | + |
|
| 1076 | + /** |
|
| 1077 | + * The WordLift entity type settings admin page controller. |
|
| 1078 | + */ |
|
| 1079 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 1080 | + |
|
| 1081 | + /** |
|
| 1082 | + * The admin 'Download Your Data' page. |
|
| 1083 | + */ |
|
| 1084 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 1085 | + |
|
| 1086 | + /** |
|
| 1087 | + * The admin 'WordLift Settings' page. |
|
| 1088 | + */ |
|
| 1089 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php'; |
|
| 1090 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 1091 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 1092 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 1093 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 1094 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 1095 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 1096 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 1097 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 1098 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 1099 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 1100 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 1101 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
| 1102 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 1103 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
| 1104 | + |
|
| 1105 | + /** Admin Pages */ |
|
| 1106 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 1107 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 1108 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-page.php'; |
|
| 1109 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 1110 | + |
|
| 1111 | + /** |
|
| 1112 | + * The class responsible for defining all actions that occur in the public-facing |
|
| 1113 | + * side of the site. |
|
| 1114 | + */ |
|
| 1115 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 1116 | + |
|
| 1117 | + /** |
|
| 1118 | + * The shortcode abstract class. |
|
| 1119 | + */ |
|
| 1120 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 1121 | + |
|
| 1122 | + /** |
|
| 1123 | + * The Timeline shortcode. |
|
| 1124 | + */ |
|
| 1125 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 1126 | + |
|
| 1127 | + /** |
|
| 1128 | + * The Navigator shortcode. |
|
| 1129 | + */ |
|
| 1130 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 1131 | + |
|
| 1132 | + /** |
|
| 1133 | + * The Products Navigator shortcode. |
|
| 1134 | + */ |
|
| 1135 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php'; |
|
| 1136 | + |
|
| 1137 | + /** |
|
| 1138 | + * The chord shortcode. |
|
| 1139 | + */ |
|
| 1140 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 1141 | + |
|
| 1142 | + /** |
|
| 1143 | + * The geomap shortcode. |
|
| 1144 | + */ |
|
| 1145 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 1146 | + |
|
| 1147 | + /** |
|
| 1148 | + * The entity cloud shortcode. |
|
| 1149 | + */ |
|
| 1150 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 1151 | + |
|
| 1152 | + /** |
|
| 1153 | + * The entity glossary shortcode. |
|
| 1154 | + */ |
|
| 1155 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
|
| 1156 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 1157 | + |
|
| 1158 | + /** |
|
| 1159 | + * Faceted Search shortcode. |
|
| 1160 | + */ |
|
| 1161 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 1162 | + |
|
| 1163 | + /** |
|
| 1164 | + * The ShareThis service. |
|
| 1165 | + */ |
|
| 1166 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 1167 | + |
|
| 1168 | + /** |
|
| 1169 | + * The SEO service. |
|
| 1170 | + */ |
|
| 1171 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 1172 | + |
|
| 1173 | + /** |
|
| 1174 | + * The AMP service. |
|
| 1175 | + */ |
|
| 1176 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1177 | + |
|
| 1178 | + /** Widgets */ |
|
| 1179 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1180 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1181 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php'; |
|
| 1182 | + |
|
| 1183 | + /* |
|
| 1184 | 1184 | * Schema.org Services. |
| 1185 | 1185 | * |
| 1186 | 1186 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1187 | 1187 | */ |
| 1188 | - if ( WL_ALL_ENTITY_TYPES ) { |
|
| 1189 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1190 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1191 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1192 | - new Wordlift_Schemaorg_Sync_Service(); |
|
| 1193 | - $schemaorg_property_service = new Wordlift_Schemaorg_Property_Service(); |
|
| 1194 | - new Wordlift_Schemaorg_Class_Service(); |
|
| 1195 | - } else { |
|
| 1196 | - $schemaorg_property_service = null; |
|
| 1197 | - } |
|
| 1198 | - |
|
| 1199 | - $this->loader = new Wordlift_Loader(); |
|
| 1200 | - /** |
|
| 1201 | - * @since 3.30.0 |
|
| 1202 | - */ |
|
| 1203 | - $this->features_registry = Features_Registry::get_instance(); |
|
| 1188 | + if ( WL_ALL_ENTITY_TYPES ) { |
|
| 1189 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1190 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1191 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1192 | + new Wordlift_Schemaorg_Sync_Service(); |
|
| 1193 | + $schemaorg_property_service = new Wordlift_Schemaorg_Property_Service(); |
|
| 1194 | + new Wordlift_Schemaorg_Class_Service(); |
|
| 1195 | + } else { |
|
| 1196 | + $schemaorg_property_service = null; |
|
| 1197 | + } |
|
| 1204 | 1198 | |
| 1205 | - // Instantiate a global logger. |
|
| 1206 | - global $wl_logger; |
|
| 1207 | - $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1199 | + $this->loader = new Wordlift_Loader(); |
|
| 1200 | + /** |
|
| 1201 | + * @since 3.30.0 |
|
| 1202 | + */ |
|
| 1203 | + $this->features_registry = Features_Registry::get_instance(); |
|
| 1208 | 1204 | |
| 1209 | - // Load the `wl-api` end-point. |
|
| 1210 | - new Wordlift_Http_Api(); |
|
| 1205 | + // Instantiate a global logger. |
|
| 1206 | + global $wl_logger; |
|
| 1207 | + $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1211 | 1208 | |
| 1212 | - // Load the Install Service. |
|
| 1213 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
|
| 1214 | - $this->install_service = new Wordlift_Install_Service(); |
|
| 1209 | + // Load the `wl-api` end-point. |
|
| 1210 | + new Wordlift_Http_Api(); |
|
| 1215 | 1211 | |
| 1216 | - /** Services. */ |
|
| 1217 | - // Create the configuration service. |
|
| 1218 | - $this->configuration_service = new Wordlift_Configuration_Service(); |
|
| 1219 | - $api_service = new Wordlift_Api_Service( $this->configuration_service ); |
|
| 1212 | + // Load the Install Service. |
|
| 1213 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
|
| 1214 | + $this->install_service = new Wordlift_Install_Service(); |
|
| 1220 | 1215 | |
| 1221 | - // Create an entity type service instance. It'll be later bound to the init action. |
|
| 1222 | - $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 1216 | + /** Services. */ |
|
| 1217 | + // Create the configuration service. |
|
| 1218 | + $this->configuration_service = new Wordlift_Configuration_Service(); |
|
| 1219 | + $api_service = new Wordlift_Api_Service( $this->configuration_service ); |
|
| 1223 | 1220 | |
| 1224 | - // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
|
| 1225 | - $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 1221 | + // Create an entity type service instance. It'll be later bound to the init action. |
|
| 1222 | + $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 1226 | 1223 | |
| 1227 | - // Create an instance of the UI service. |
|
| 1228 | - $this->ui_service = new Wordlift_UI_Service(); |
|
| 1224 | + // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
|
| 1225 | + $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 1229 | 1226 | |
| 1230 | - // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events. |
|
| 1231 | - $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
|
| 1227 | + // Create an instance of the UI service. |
|
| 1228 | + $this->ui_service = new Wordlift_UI_Service(); |
|
| 1232 | 1229 | |
| 1233 | - $this->sparql_service = new Wordlift_Sparql_Service(); |
|
| 1234 | - $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 1235 | - $this->notice_service = new Wordlift_Notice_Service(); |
|
| 1236 | - $this->relation_service = new Wordlift_Relation_Service(); |
|
| 1230 | + // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events. |
|
| 1231 | + $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
|
| 1237 | 1232 | |
| 1238 | - $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' ); |
|
| 1239 | - $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service ); |
|
| 1240 | - $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service ); |
|
| 1241 | - $this->user_service = new Wordlift_User_Service( $this->sparql_service, $this->entity_service ); |
|
| 1233 | + $this->sparql_service = new Wordlift_Sparql_Service(); |
|
| 1234 | + $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 1235 | + $this->notice_service = new Wordlift_Notice_Service(); |
|
| 1236 | + $this->relation_service = new Wordlift_Relation_Service(); |
|
| 1242 | 1237 | |
| 1243 | - // Instantiate the JSON-LD service. |
|
| 1244 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1238 | + $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' ); |
|
| 1239 | + $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service ); |
|
| 1240 | + $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service ); |
|
| 1241 | + $this->user_service = new Wordlift_User_Service( $this->sparql_service, $this->entity_service ); |
|
| 1245 | 1242 | |
| 1246 | - /** Linked Data. */ |
|
| 1247 | - $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
|
| 1248 | - $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
|
| 1243 | + // Instantiate the JSON-LD service. |
|
| 1244 | + $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1249 | 1245 | |
| 1250 | - $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
|
| 1246 | + /** Linked Data. */ |
|
| 1247 | + $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
|
| 1248 | + $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
|
| 1251 | 1249 | |
| 1252 | - // Create a new instance of the Redirect service. |
|
| 1253 | - $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_uri_service ); |
|
| 1254 | - $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 1250 | + $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
|
| 1255 | 1251 | |
| 1256 | - // Create a new instance of the Timeline service and Timeline shortcode. |
|
| 1257 | - $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
|
| 1252 | + // Create a new instance of the Redirect service. |
|
| 1253 | + $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_uri_service ); |
|
| 1254 | + $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 1258 | 1255 | |
| 1259 | - $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
|
| 1256 | + // Create a new instance of the Timeline service and Timeline shortcode. |
|
| 1257 | + $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
|
| 1260 | 1258 | |
| 1261 | - $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
|
| 1262 | - $this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service(); |
|
| 1259 | + $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
|
| 1263 | 1260 | |
| 1264 | - // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
|
| 1265 | - $this->sharethis_service = new Wordlift_ShareThis_Service(); |
|
| 1261 | + $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
|
| 1262 | + $this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service(); |
|
| 1266 | 1263 | |
| 1267 | - // Create an instance of the PrimaShop adapter. |
|
| 1268 | - $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
|
| 1264 | + // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
|
| 1265 | + $this->sharethis_service = new Wordlift_ShareThis_Service(); |
|
| 1269 | 1266 | |
| 1270 | - // Create an import service instance to hook later to WP's import function. |
|
| 1271 | - $this->import_service = new Wordlift_Import_Service( $this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri() ); |
|
| 1267 | + // Create an instance of the PrimaShop adapter. |
|
| 1268 | + $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
|
| 1272 | 1269 | |
| 1273 | - $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1270 | + // Create an import service instance to hook later to WP's import function. |
|
| 1271 | + $this->import_service = new Wordlift_Import_Service( $this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri() ); |
|
| 1274 | 1272 | |
| 1275 | - // Create the entity rating service. |
|
| 1276 | - $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 1273 | + $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1277 | 1274 | |
| 1278 | - // Create entity list customization (wp-admin/edit.php). |
|
| 1279 | - $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 1275 | + // Create the entity rating service. |
|
| 1276 | + $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 1280 | 1277 | |
| 1281 | - // Create a new instance of the Redirect service. |
|
| 1282 | - $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
|
| 1278 | + // Create entity list customization (wp-admin/edit.php). |
|
| 1279 | + $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 1283 | 1280 | |
| 1284 | - // Create an instance of the Publisher Service and the AJAX Adapter. |
|
| 1285 | - $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service ); |
|
| 1286 | - $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1287 | - $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1281 | + // Create a new instance of the Redirect service. |
|
| 1282 | + $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
|
| 1288 | 1283 | |
| 1289 | - $attachment_service = new Wordlift_Attachment_Service(); |
|
| 1284 | + // Create an instance of the Publisher Service and the AJAX Adapter. |
|
| 1285 | + $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service ); |
|
| 1286 | + $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1287 | + $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1290 | 1288 | |
| 1291 | - // Instantiate the JSON-LD service. |
|
| 1292 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1293 | - $this->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
|
| 1294 | - $this->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $this->post_to_jsonld_converter ); |
|
| 1295 | - $this->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter( $this->entity_service, $this->entity_post_to_jsonld_converter, $this->post_to_jsonld_converter ); |
|
| 1296 | - $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
|
| 1289 | + $attachment_service = new Wordlift_Attachment_Service(); |
|
| 1297 | 1290 | |
| 1298 | - $jsonld_cache = new Ttl_Cache( 'jsonld', 86400 ); |
|
| 1299 | - $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache ); |
|
| 1300 | - $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter ); |
|
| 1291 | + // Instantiate the JSON-LD service. |
|
| 1292 | + $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1293 | + $this->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
|
| 1294 | + $this->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $this->post_to_jsonld_converter ); |
|
| 1295 | + $this->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter( $this->entity_service, $this->entity_post_to_jsonld_converter, $this->post_to_jsonld_converter ); |
|
| 1296 | + $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
|
| 1301 | 1297 | |
| 1302 | - /* |
|
| 1298 | + $jsonld_cache = new Ttl_Cache( 'jsonld', 86400 ); |
|
| 1299 | + $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache ); |
|
| 1300 | + $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter ); |
|
| 1301 | + |
|
| 1302 | + /* |
|
| 1303 | 1303 | * Load the `Wordlift_Term_JsonLd_Adapter`. |
| 1304 | 1304 | * |
| 1305 | 1305 | * @see https://github.com/insideout10/wordlift-plugin/issues/892 |
| 1306 | 1306 | * |
| 1307 | 1307 | * @since 3.20.0 |
| 1308 | 1308 | */ |
| 1309 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1310 | - $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->jsonld_service ); |
|
| 1311 | - $jsonld_service = new Jsonld_Service( |
|
| 1312 | - $this->jsonld_service, |
|
| 1313 | - $term_jsonld_adapter, |
|
| 1314 | - new Jsonld_User_Service( $this->user_service ) ); |
|
| 1315 | - new Jsonld_Endpoint( $jsonld_service, $this->entity_uri_service ); |
|
| 1316 | - |
|
| 1317 | - // Prints the JSON-LD in the head. |
|
| 1318 | - new Jsonld_Adapter( $this->jsonld_service ); |
|
| 1319 | - |
|
| 1320 | - new Jsonld_By_Id_Endpoint( $this->jsonld_service, $this->entity_uri_service ); |
|
| 1321 | - |
|
| 1322 | - $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
|
| 1323 | - $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service ); |
|
| 1324 | - // Creating Faq Content filter service. |
|
| 1325 | - $this->faq_content_filter_service = new Faq_Content_Filter(); |
|
| 1326 | - $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
|
| 1327 | - $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service ); |
|
| 1328 | - $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
|
| 1329 | - $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->entity_service ); |
|
| 1330 | - |
|
| 1331 | - $this->loader->add_action( 'enqueue_block_editor_assets', $this, 'add_wl_enabled_blocks' ); |
|
| 1332 | - $this->loader->add_action( 'admin_enqueue_scripts', $this, 'add_wl_enabled_blocks' ); |
|
| 1333 | - |
|
| 1334 | - /** |
|
| 1335 | - * Filter: wl_feature__enable__blocks. |
|
| 1336 | - * |
|
| 1337 | - * @param bool whether the blocks needed to be registered, defaults to true. |
|
| 1338 | - * |
|
| 1339 | - * @return bool |
|
| 1340 | - * @since 3.27.6 |
|
| 1341 | - */ |
|
| 1342 | - if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 1343 | - // Initialize the short-codes. |
|
| 1344 | - new Async_Template_Decorator( new Wordlift_Navigator_Shortcode() ); |
|
| 1345 | - new Wordlift_Chord_Shortcode(); |
|
| 1346 | - new Wordlift_Geomap_Shortcode(); |
|
| 1347 | - new Wordlift_Timeline_Shortcode(); |
|
| 1348 | - new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
|
| 1349 | - new Wordlift_Vocabulary_Shortcode( $this->configuration_service ); |
|
| 1350 | - new Async_Template_Decorator( new Wordlift_Faceted_Search_Shortcode() ); |
|
| 1351 | - } |
|
| 1352 | - |
|
| 1353 | - new Wordlift_Products_Navigator_Shortcode(); |
|
| 1354 | - |
|
| 1355 | - |
|
| 1356 | - // Initialize the Context Cards Service |
|
| 1357 | - $this->context_cards_service = new Wordlift_Context_Cards_Service(); |
|
| 1358 | - |
|
| 1359 | - // Initialize the SEO service. |
|
| 1360 | - new Wordlift_Seo_Service(); |
|
| 1361 | - |
|
| 1362 | - // Initialize the AMP service. |
|
| 1363 | - new Wordlift_AMP_Service( $this->jsonld_service ); |
|
| 1364 | - |
|
| 1365 | - /** Services. */ |
|
| 1366 | - $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
|
| 1367 | - new Wordlift_Image_Service(); |
|
| 1368 | - |
|
| 1369 | - /** Adapters. */ |
|
| 1370 | - $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
|
| 1371 | - $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service ); |
|
| 1372 | - $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 1373 | - //$this->faq_tinymce_adapter = new Faq_Tinymce_Adapter(); |
|
| 1374 | - $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
|
| 1375 | - |
|
| 1376 | - /* |
|
| 1309 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1310 | + $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->jsonld_service ); |
|
| 1311 | + $jsonld_service = new Jsonld_Service( |
|
| 1312 | + $this->jsonld_service, |
|
| 1313 | + $term_jsonld_adapter, |
|
| 1314 | + new Jsonld_User_Service( $this->user_service ) ); |
|
| 1315 | + new Jsonld_Endpoint( $jsonld_service, $this->entity_uri_service ); |
|
| 1316 | + |
|
| 1317 | + // Prints the JSON-LD in the head. |
|
| 1318 | + new Jsonld_Adapter( $this->jsonld_service ); |
|
| 1319 | + |
|
| 1320 | + new Jsonld_By_Id_Endpoint( $this->jsonld_service, $this->entity_uri_service ); |
|
| 1321 | + |
|
| 1322 | + $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
|
| 1323 | + $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service ); |
|
| 1324 | + // Creating Faq Content filter service. |
|
| 1325 | + $this->faq_content_filter_service = new Faq_Content_Filter(); |
|
| 1326 | + $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
|
| 1327 | + $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service ); |
|
| 1328 | + $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
|
| 1329 | + $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->entity_service ); |
|
| 1330 | + |
|
| 1331 | + $this->loader->add_action( 'enqueue_block_editor_assets', $this, 'add_wl_enabled_blocks' ); |
|
| 1332 | + $this->loader->add_action( 'admin_enqueue_scripts', $this, 'add_wl_enabled_blocks' ); |
|
| 1333 | + |
|
| 1334 | + /** |
|
| 1335 | + * Filter: wl_feature__enable__blocks. |
|
| 1336 | + * |
|
| 1337 | + * @param bool whether the blocks needed to be registered, defaults to true. |
|
| 1338 | + * |
|
| 1339 | + * @return bool |
|
| 1340 | + * @since 3.27.6 |
|
| 1341 | + */ |
|
| 1342 | + if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 1343 | + // Initialize the short-codes. |
|
| 1344 | + new Async_Template_Decorator( new Wordlift_Navigator_Shortcode() ); |
|
| 1345 | + new Wordlift_Chord_Shortcode(); |
|
| 1346 | + new Wordlift_Geomap_Shortcode(); |
|
| 1347 | + new Wordlift_Timeline_Shortcode(); |
|
| 1348 | + new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
|
| 1349 | + new Wordlift_Vocabulary_Shortcode( $this->configuration_service ); |
|
| 1350 | + new Async_Template_Decorator( new Wordlift_Faceted_Search_Shortcode() ); |
|
| 1351 | + } |
|
| 1352 | + |
|
| 1353 | + new Wordlift_Products_Navigator_Shortcode(); |
|
| 1354 | + |
|
| 1355 | + |
|
| 1356 | + // Initialize the Context Cards Service |
|
| 1357 | + $this->context_cards_service = new Wordlift_Context_Cards_Service(); |
|
| 1358 | + |
|
| 1359 | + // Initialize the SEO service. |
|
| 1360 | + new Wordlift_Seo_Service(); |
|
| 1361 | + |
|
| 1362 | + // Initialize the AMP service. |
|
| 1363 | + new Wordlift_AMP_Service( $this->jsonld_service ); |
|
| 1364 | + |
|
| 1365 | + /** Services. */ |
|
| 1366 | + $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
|
| 1367 | + new Wordlift_Image_Service(); |
|
| 1368 | + |
|
| 1369 | + /** Adapters. */ |
|
| 1370 | + $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
|
| 1371 | + $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service ); |
|
| 1372 | + $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 1373 | + //$this->faq_tinymce_adapter = new Faq_Tinymce_Adapter(); |
|
| 1374 | + $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
|
| 1375 | + |
|
| 1376 | + /* |
|
| 1377 | 1377 | * Exclude our public js from WP-Rocket. |
| 1378 | 1378 | * |
| 1379 | 1379 | * @since 3.19.4 |
| 1380 | 1380 | * |
| 1381 | 1381 | * @see https://github.com/insideout10/wordlift-plugin/issues/842. |
| 1382 | 1382 | */ |
| 1383 | - new Wordlift_WpRocket_Adapter(); |
|
| 1384 | - |
|
| 1385 | - // Create a Rebuild Service instance, which we'll later bound to an ajax call. |
|
| 1386 | - $this->rebuild_service = new Wordlift_Rebuild_Service( |
|
| 1387 | - $this->sparql_service, |
|
| 1388 | - $uri_service |
|
| 1389 | - ); |
|
| 1390 | - |
|
| 1391 | - $that = $this; |
|
| 1392 | - add_action( 'plugins_loaded', function () use ( $that ) { |
|
| 1393 | - if ( ! apply_filters( 'wl_feature__enable__dataset-ng', false ) ) { |
|
| 1394 | - new Wordlift_Linked_Data_Service( $that->entity_service, $that->entity_type_service, $that->schema_service, $that->sparql_service ); |
|
| 1395 | - new Wordlift_Sparql_Query_Async_Task(); |
|
| 1396 | - new Wordlift_Push_References_Async_Task(); |
|
| 1397 | - } |
|
| 1398 | - } ); |
|
| 1399 | - |
|
| 1400 | - /** WordPress Admin UI. */ |
|
| 1401 | - |
|
| 1402 | - // UI elements. |
|
| 1403 | - $this->input_element = new Wordlift_Admin_Input_Element(); |
|
| 1404 | - $this->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
|
| 1405 | - $this->select2_element = new Wordlift_Admin_Select2_Element(); |
|
| 1406 | - $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
|
| 1407 | - $this->country_select_element = new Wordlift_Admin_Country_Select_Element(); |
|
| 1408 | - $tabs_element = new Wordlift_Admin_Tabs_Element(); |
|
| 1409 | - $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element ); |
|
| 1410 | - $this->author_element = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element ); |
|
| 1411 | - |
|
| 1412 | - $this->settings_page = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->country_select_element, $this->publisher_element, $this->radio_input_element ); |
|
| 1413 | - $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 1414 | - |
|
| 1415 | - $this->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element ); |
|
| 1416 | - $this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page ); |
|
| 1417 | - $this->analytics_connect = new Wordlift_Analytics_Connect(); |
|
| 1418 | - |
|
| 1419 | - // Pages. |
|
| 1420 | - /* |
|
| 1383 | + new Wordlift_WpRocket_Adapter(); |
|
| 1384 | + |
|
| 1385 | + // Create a Rebuild Service instance, which we'll later bound to an ajax call. |
|
| 1386 | + $this->rebuild_service = new Wordlift_Rebuild_Service( |
|
| 1387 | + $this->sparql_service, |
|
| 1388 | + $uri_service |
|
| 1389 | + ); |
|
| 1390 | + |
|
| 1391 | + $that = $this; |
|
| 1392 | + add_action( 'plugins_loaded', function () use ( $that ) { |
|
| 1393 | + if ( ! apply_filters( 'wl_feature__enable__dataset-ng', false ) ) { |
|
| 1394 | + new Wordlift_Linked_Data_Service( $that->entity_service, $that->entity_type_service, $that->schema_service, $that->sparql_service ); |
|
| 1395 | + new Wordlift_Sparql_Query_Async_Task(); |
|
| 1396 | + new Wordlift_Push_References_Async_Task(); |
|
| 1397 | + } |
|
| 1398 | + } ); |
|
| 1399 | + |
|
| 1400 | + /** WordPress Admin UI. */ |
|
| 1401 | + |
|
| 1402 | + // UI elements. |
|
| 1403 | + $this->input_element = new Wordlift_Admin_Input_Element(); |
|
| 1404 | + $this->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
|
| 1405 | + $this->select2_element = new Wordlift_Admin_Select2_Element(); |
|
| 1406 | + $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
|
| 1407 | + $this->country_select_element = new Wordlift_Admin_Country_Select_Element(); |
|
| 1408 | + $tabs_element = new Wordlift_Admin_Tabs_Element(); |
|
| 1409 | + $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element ); |
|
| 1410 | + $this->author_element = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element ); |
|
| 1411 | + |
|
| 1412 | + $this->settings_page = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->country_select_element, $this->publisher_element, $this->radio_input_element ); |
|
| 1413 | + $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 1414 | + |
|
| 1415 | + $this->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element ); |
|
| 1416 | + $this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page ); |
|
| 1417 | + $this->analytics_connect = new Wordlift_Analytics_Connect(); |
|
| 1418 | + |
|
| 1419 | + // Pages. |
|
| 1420 | + /* |
|
| 1421 | 1421 | * Call the `wl_can_see_classification_box` filter to determine whether we can display the classification box. |
| 1422 | 1422 | * |
| 1423 | 1423 | * @since 3.20.3 |
| 1424 | 1424 | * |
| 1425 | 1425 | * @see https://github.com/insideout10/wordlift-plugin/issues/914 |
| 1426 | 1426 | */ |
| 1427 | - if ( apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 1428 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1429 | - new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 1430 | - } |
|
| 1431 | - new Wordlift_Entity_Type_Admin_Service(); |
|
| 1427 | + if ( apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 1428 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1429 | + new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 1430 | + } |
|
| 1431 | + new Wordlift_Entity_Type_Admin_Service(); |
|
| 1432 | 1432 | |
| 1433 | - // create an instance of the entity type list admin page controller. |
|
| 1434 | - $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
|
| 1433 | + // create an instance of the entity type list admin page controller. |
|
| 1434 | + $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
|
| 1435 | 1435 | |
| 1436 | - // create an instance of the entity type setting admin page controller. |
|
| 1437 | - $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
|
| 1436 | + // create an instance of the entity type setting admin page controller. |
|
| 1437 | + $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
|
| 1438 | 1438 | |
| 1439 | - /** Widgets */ |
|
| 1440 | - $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
|
| 1439 | + /** Widgets */ |
|
| 1440 | + $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
|
| 1441 | 1441 | |
| 1442 | - /* WordPress Admin. */ |
|
| 1443 | - $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 1444 | - $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 1442 | + /* WordPress Admin. */ |
|
| 1443 | + $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 1444 | + $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 1445 | 1445 | |
| 1446 | - // Create an instance of the install wizard. |
|
| 1447 | - $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service, $this->language_select_element, $this->country_select_element ); |
|
| 1446 | + // Create an instance of the install wizard. |
|
| 1447 | + $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service, $this->language_select_element, $this->country_select_element ); |
|
| 1448 | 1448 | |
| 1449 | - $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1449 | + $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1450 | 1450 | |
| 1451 | - // User Profile. |
|
| 1452 | - new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1451 | + // User Profile. |
|
| 1452 | + new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1453 | 1453 | |
| 1454 | - $this->entity_page_service = new Wordlift_Entity_Page_Service(); |
|
| 1454 | + $this->entity_page_service = new Wordlift_Entity_Page_Service(); |
|
| 1455 | 1455 | |
| 1456 | - // Load the debug service if WP is in debug mode. |
|
| 1457 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1458 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1459 | - new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1460 | - } |
|
| 1456 | + // Load the debug service if WP is in debug mode. |
|
| 1457 | + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1458 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1459 | + new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1460 | + } |
|
| 1461 | 1461 | |
| 1462 | - // Remote Image Service. |
|
| 1463 | - new Wordlift_Remote_Image_Service(); |
|
| 1462 | + // Remote Image Service. |
|
| 1463 | + new Wordlift_Remote_Image_Service(); |
|
| 1464 | 1464 | |
| 1465 | - /* |
|
| 1465 | + /* |
|
| 1466 | 1466 | * Provides mappings between post types and entity types. |
| 1467 | 1467 | * |
| 1468 | 1468 | * @since 3.20.0 |
| 1469 | 1469 | * |
| 1470 | 1470 | * @see https://github.com/insideout10/wordlift-plugin/issues/852. |
| 1471 | 1471 | */ |
| 1472 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php'; |
|
| 1473 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1474 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1472 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php'; |
|
| 1473 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1474 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1475 | 1475 | |
| 1476 | - // Create an instance of the Mapping Service and assign it to the Ajax Adapter. |
|
| 1477 | - new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) ); |
|
| 1476 | + // Create an instance of the Mapping Service and assign it to the Ajax Adapter. |
|
| 1477 | + new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) ); |
|
| 1478 | 1478 | |
| 1479 | - /* |
|
| 1479 | + /* |
|
| 1480 | 1480 | * Batch Operations. They're similar to Batch Actions but do not require working on post types. |
| 1481 | 1481 | * |
| 1482 | 1482 | * Eventually Batch Actions will become Batch Operations. |
| 1483 | 1483 | * |
| 1484 | 1484 | * @since 3.20.0 |
| 1485 | 1485 | */ |
| 1486 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1487 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1486 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1487 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1488 | 1488 | |
| 1489 | - /* |
|
| 1489 | + /* |
|
| 1490 | 1490 | * Add the Search Keywords taxonomy to manage the Search Keywords on WLS. |
| 1491 | 1491 | * |
| 1492 | 1492 | * @link https://github.com/insideout10/wordlift-plugin/issues/761 |
| 1493 | 1493 | * |
| 1494 | 1494 | * @since 3.20.0 |
| 1495 | 1495 | */ |
| 1496 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php'; |
|
| 1497 | - new Wordlift_Search_Keyword_Taxonomy( $api_service ); |
|
| 1496 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php'; |
|
| 1497 | + new Wordlift_Search_Keyword_Taxonomy( $api_service ); |
|
| 1498 | 1498 | |
| 1499 | - /* |
|
| 1499 | + /* |
|
| 1500 | 1500 | * Load the Mappings JSON-LD post processing. |
| 1501 | 1501 | * |
| 1502 | 1502 | * @since 3.25.0 |
| 1503 | 1503 | */ |
| 1504 | 1504 | |
| 1505 | - $mappings_dbo = new Mappings_DBO(); |
|
| 1506 | - $default_rule_validator = new Taxonomy_Rule_Validator(); |
|
| 1507 | - new Post_Type_Rule_Validator(); |
|
| 1508 | - // Taxonomy term rule validator for validating rules for term pages. |
|
| 1509 | - new Taxonomy_Term_Rule_Validator(); |
|
| 1510 | - new Post_Taxonomy_Term_Rule_Validator(); |
|
| 1511 | - $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator ); |
|
| 1512 | - $rule_groups_validator = new Rule_Groups_Validator( $rule_validators_registry ); |
|
| 1513 | - $mappings_validator = new Mappings_Validator( $mappings_dbo, $rule_groups_validator ); |
|
| 1514 | - |
|
| 1515 | - new Url_To_Entity_Transform_Function( $this->entity_uri_service ); |
|
| 1516 | - new Taxonomy_To_Terms_Transform_Function(); |
|
| 1517 | - new Post_Id_To_Entity_Transform_Function(); |
|
| 1518 | - $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry(); |
|
| 1519 | - |
|
| 1520 | - /** |
|
| 1521 | - * @since 3.27.1 |
|
| 1522 | - * Intiailize the acf group data formatter. |
|
| 1523 | - */ |
|
| 1524 | - new Acf_Group_Formatter(); |
|
| 1525 | - new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry ); |
|
| 1526 | - |
|
| 1527 | - /** |
|
| 1528 | - * @since 3.26.0 |
|
| 1529 | - * Initialize the Faq JSON LD converter here - disabled. |
|
| 1530 | - */ |
|
| 1531 | - // new Faq_To_Jsonld_Converter(); |
|
| 1532 | - /* |
|
| 1505 | + $mappings_dbo = new Mappings_DBO(); |
|
| 1506 | + $default_rule_validator = new Taxonomy_Rule_Validator(); |
|
| 1507 | + new Post_Type_Rule_Validator(); |
|
| 1508 | + // Taxonomy term rule validator for validating rules for term pages. |
|
| 1509 | + new Taxonomy_Term_Rule_Validator(); |
|
| 1510 | + new Post_Taxonomy_Term_Rule_Validator(); |
|
| 1511 | + $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator ); |
|
| 1512 | + $rule_groups_validator = new Rule_Groups_Validator( $rule_validators_registry ); |
|
| 1513 | + $mappings_validator = new Mappings_Validator( $mappings_dbo, $rule_groups_validator ); |
|
| 1514 | + |
|
| 1515 | + new Url_To_Entity_Transform_Function( $this->entity_uri_service ); |
|
| 1516 | + new Taxonomy_To_Terms_Transform_Function(); |
|
| 1517 | + new Post_Id_To_Entity_Transform_Function(); |
|
| 1518 | + $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry(); |
|
| 1519 | + |
|
| 1520 | + /** |
|
| 1521 | + * @since 3.27.1 |
|
| 1522 | + * Intiailize the acf group data formatter. |
|
| 1523 | + */ |
|
| 1524 | + new Acf_Group_Formatter(); |
|
| 1525 | + new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry ); |
|
| 1526 | + |
|
| 1527 | + /** |
|
| 1528 | + * @since 3.26.0 |
|
| 1529 | + * Initialize the Faq JSON LD converter here - disabled. |
|
| 1530 | + */ |
|
| 1531 | + // new Faq_To_Jsonld_Converter(); |
|
| 1532 | + /* |
|
| 1533 | 1533 | * Use the Templates Ajax Endpoint to load HTML templates for the legacy Angular app via admin-ajax.php |
| 1534 | 1534 | * end-point. |
| 1535 | 1535 | * |
| 1536 | 1536 | * @see https://github.com/insideout10/wordlift-plugin/issues/834 |
| 1537 | 1537 | * @since 3.24.4 |
| 1538 | 1538 | */ |
| 1539 | - new Templates_Ajax_Endpoint(); |
|
| 1540 | - // Call this static method to register FAQ routes to rest api - disabled |
|
| 1541 | - //Faq_Rest_Controller::register_routes(); |
|
| 1539 | + new Templates_Ajax_Endpoint(); |
|
| 1540 | + // Call this static method to register FAQ routes to rest api - disabled |
|
| 1541 | + //Faq_Rest_Controller::register_routes(); |
|
| 1542 | 1542 | |
| 1543 | - /* |
|
| 1543 | + /* |
|
| 1544 | 1544 | * Create a singleton for the Analysis_Response_Ops_Factory. |
| 1545 | 1545 | */ |
| 1546 | - $entity_helper = new Entity_Helper( $this->entity_uri_service, $this->entity_service ); |
|
| 1547 | - new Analysis_Response_Ops_Factory( |
|
| 1548 | - $this->entity_uri_service, |
|
| 1549 | - $this->entity_service, |
|
| 1550 | - $this->entity_type_service, |
|
| 1551 | - $this->storage_factory->post_images(), |
|
| 1552 | - $entity_helper |
|
| 1553 | - ); |
|
| 1554 | - |
|
| 1555 | - /** WL Autocomplete. */ |
|
| 1556 | - $autocomplete_service = new All_Autocomplete_Service( array( |
|
| 1557 | - new Local_Autocomplete_Service(), |
|
| 1558 | - new Linked_Data_Autocomplete_Service( $this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service ), |
|
| 1559 | - ) ); |
|
| 1560 | - $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service ); |
|
| 1561 | - |
|
| 1562 | - /** |
|
| 1563 | - * @since 3.27.2 |
|
| 1564 | - * Integrate the recipe maker jsonld & set recipe |
|
| 1565 | - * as default entity type to the wprm_recipe CPT. |
|
| 1566 | - */ |
|
| 1567 | - new Recipe_Maker_Post_Type_Hook(); |
|
| 1568 | - $recipe_maker_validation_service = new Recipe_Maker_Validation_Service(); |
|
| 1569 | - new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service ); |
|
| 1570 | - new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service ); |
|
| 1571 | - new Recipe_Maker_Warning( $recipe_maker_validation_service ); |
|
| 1572 | - new Yoast_Jsonld( $recipe_maker_validation_service ); |
|
| 1573 | - |
|
| 1574 | - /** |
|
| 1575 | - * @since 3.27.4 |
|
| 1576 | - * Add the faq duplicate markup hook. |
|
| 1577 | - */ |
|
| 1578 | - new Faq_Duplicate_Markup_Remover(); |
|
| 1579 | - /** |
|
| 1580 | - * @since 3.27.8 |
|
| 1581 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1248 |
|
| 1582 | - */ |
|
| 1583 | - new Key_Validation_Notice( $this->key_validation_service, $this->configuration_service ); |
|
| 1584 | - /** |
|
| 1585 | - * @since 3.28.0 |
|
| 1586 | - * @see https://github.com/insideout10/wordlift-plugin/issues?q=assignee%3Anaveen17797+is%3Aopen |
|
| 1587 | - */ |
|
| 1588 | - new Entity_No_Index_Flag(); |
|
| 1589 | - |
|
| 1590 | - /** |
|
| 1591 | - * @since 3.29.0 |
|
| 1592 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1304 |
|
| 1593 | - */ |
|
| 1594 | - new Entity_Rest_Service( $this->entity_type_service ); |
|
| 1595 | - |
|
| 1596 | - /** |
|
| 1597 | - * Expand author in to references. |
|
| 1598 | - * @since 3.30.0 |
|
| 1599 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1318 |
|
| 1600 | - */ |
|
| 1601 | - |
|
| 1602 | - add_action( 'plugins_loaded', function () use ( $that ) { |
|
| 1603 | - |
|
| 1604 | - if ( apply_filters( 'wl_feature__enable__article-wrapper', false ) ) { |
|
| 1605 | - new Jsonld_Article_Wrapper( Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter ); |
|
| 1606 | - } |
|
| 1607 | - |
|
| 1608 | - if ( apply_filters( 'wl_feature__enable__match-terms', false ) ) { |
|
| 1609 | - $vocabulary_loader = new Vocabulary_Loader(); |
|
| 1610 | - $vocabulary_loader->init_vocabulary(); |
|
| 1611 | - } |
|
| 1612 | - |
|
| 1613 | - } ); |
|
| 1614 | - |
|
| 1615 | - /** |
|
| 1616 | - * @since 3.30.0 |
|
| 1617 | - * Add a checkbox to user option screen for wordlift admin. |
|
| 1618 | - */ |
|
| 1619 | - $wordlift_admin_checkbox = new Admin_User_Option(); |
|
| 1620 | - $wordlift_admin_checkbox->connect_hook(); |
|
| 1621 | - /** |
|
| 1622 | - * @since 3.31.0 |
|
| 1623 | - * Init loader class for videoobject. |
|
| 1624 | - */ |
|
| 1625 | - $videoobject_loader = new Loader(); |
|
| 1626 | - $videoobject_loader->init_feature(); |
|
| 1627 | - } |
|
| 1628 | - |
|
| 1629 | - /** |
|
| 1630 | - * Define the locale for this plugin for internationalization. |
|
| 1631 | - * |
|
| 1632 | - * Uses the Wordlift_i18n class in order to set the domain and to register the hook |
|
| 1633 | - * with WordPress. |
|
| 1634 | - * |
|
| 1635 | - * @since 1.0.0 |
|
| 1636 | - * @access private |
|
| 1637 | - */ |
|
| 1638 | - private function set_locale() { |
|
| 1639 | - |
|
| 1640 | - $plugin_i18n = new Wordlift_i18n(); |
|
| 1641 | - $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1642 | - |
|
| 1643 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1644 | - |
|
| 1645 | - } |
|
| 1646 | - |
|
| 1647 | - /** |
|
| 1648 | - * Register all of the hooks related to the admin area functionality |
|
| 1649 | - * of the plugin. |
|
| 1650 | - * |
|
| 1651 | - * @since 1.0.0 |
|
| 1652 | - * @access private |
|
| 1653 | - */ |
|
| 1654 | - private function define_admin_hooks() { |
|
| 1655 | - $that = $this; |
|
| 1656 | - $plugin_admin = new Wordlift_Admin( |
|
| 1657 | - $this->get_plugin_name(), |
|
| 1658 | - $this->get_version(), |
|
| 1659 | - $this->configuration_service, |
|
| 1660 | - $this->notice_service, |
|
| 1661 | - $this->user_service |
|
| 1662 | - ); |
|
| 1663 | - |
|
| 1664 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1665 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 ); |
|
| 1666 | - |
|
| 1667 | - // Hook the init action to taxonomy services. |
|
| 1668 | - $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1669 | - $this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 ); |
|
| 1670 | - |
|
| 1671 | - // Hook the deleted_post_meta action to the Thumbnail service. |
|
| 1672 | - $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1673 | - |
|
| 1674 | - // Hook the added_post_meta action to the Thumbnail service. |
|
| 1675 | - $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1676 | - |
|
| 1677 | - // Hook the updated_post_meta action to the Thumbnail service. |
|
| 1678 | - $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1679 | - |
|
| 1680 | - // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1681 | - $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1682 | - |
|
| 1683 | - // Register custom allowed redirect hosts. |
|
| 1684 | - $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1685 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1686 | - $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1687 | - |
|
| 1688 | - /* |
|
| 1546 | + $entity_helper = new Entity_Helper( $this->entity_uri_service, $this->entity_service ); |
|
| 1547 | + new Analysis_Response_Ops_Factory( |
|
| 1548 | + $this->entity_uri_service, |
|
| 1549 | + $this->entity_service, |
|
| 1550 | + $this->entity_type_service, |
|
| 1551 | + $this->storage_factory->post_images(), |
|
| 1552 | + $entity_helper |
|
| 1553 | + ); |
|
| 1554 | + |
|
| 1555 | + /** WL Autocomplete. */ |
|
| 1556 | + $autocomplete_service = new All_Autocomplete_Service( array( |
|
| 1557 | + new Local_Autocomplete_Service(), |
|
| 1558 | + new Linked_Data_Autocomplete_Service( $this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service ), |
|
| 1559 | + ) ); |
|
| 1560 | + $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service ); |
|
| 1561 | + |
|
| 1562 | + /** |
|
| 1563 | + * @since 3.27.2 |
|
| 1564 | + * Integrate the recipe maker jsonld & set recipe |
|
| 1565 | + * as default entity type to the wprm_recipe CPT. |
|
| 1566 | + */ |
|
| 1567 | + new Recipe_Maker_Post_Type_Hook(); |
|
| 1568 | + $recipe_maker_validation_service = new Recipe_Maker_Validation_Service(); |
|
| 1569 | + new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service ); |
|
| 1570 | + new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service ); |
|
| 1571 | + new Recipe_Maker_Warning( $recipe_maker_validation_service ); |
|
| 1572 | + new Yoast_Jsonld( $recipe_maker_validation_service ); |
|
| 1573 | + |
|
| 1574 | + /** |
|
| 1575 | + * @since 3.27.4 |
|
| 1576 | + * Add the faq duplicate markup hook. |
|
| 1577 | + */ |
|
| 1578 | + new Faq_Duplicate_Markup_Remover(); |
|
| 1579 | + /** |
|
| 1580 | + * @since 3.27.8 |
|
| 1581 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1248 |
|
| 1582 | + */ |
|
| 1583 | + new Key_Validation_Notice( $this->key_validation_service, $this->configuration_service ); |
|
| 1584 | + /** |
|
| 1585 | + * @since 3.28.0 |
|
| 1586 | + * @see https://github.com/insideout10/wordlift-plugin/issues?q=assignee%3Anaveen17797+is%3Aopen |
|
| 1587 | + */ |
|
| 1588 | + new Entity_No_Index_Flag(); |
|
| 1589 | + |
|
| 1590 | + /** |
|
| 1591 | + * @since 3.29.0 |
|
| 1592 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1304 |
|
| 1593 | + */ |
|
| 1594 | + new Entity_Rest_Service( $this->entity_type_service ); |
|
| 1595 | + |
|
| 1596 | + /** |
|
| 1597 | + * Expand author in to references. |
|
| 1598 | + * @since 3.30.0 |
|
| 1599 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1318 |
|
| 1600 | + */ |
|
| 1601 | + |
|
| 1602 | + add_action( 'plugins_loaded', function () use ( $that ) { |
|
| 1603 | + |
|
| 1604 | + if ( apply_filters( 'wl_feature__enable__article-wrapper', false ) ) { |
|
| 1605 | + new Jsonld_Article_Wrapper( Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter ); |
|
| 1606 | + } |
|
| 1607 | + |
|
| 1608 | + if ( apply_filters( 'wl_feature__enable__match-terms', false ) ) { |
|
| 1609 | + $vocabulary_loader = new Vocabulary_Loader(); |
|
| 1610 | + $vocabulary_loader->init_vocabulary(); |
|
| 1611 | + } |
|
| 1612 | + |
|
| 1613 | + } ); |
|
| 1614 | + |
|
| 1615 | + /** |
|
| 1616 | + * @since 3.30.0 |
|
| 1617 | + * Add a checkbox to user option screen for wordlift admin. |
|
| 1618 | + */ |
|
| 1619 | + $wordlift_admin_checkbox = new Admin_User_Option(); |
|
| 1620 | + $wordlift_admin_checkbox->connect_hook(); |
|
| 1621 | + /** |
|
| 1622 | + * @since 3.31.0 |
|
| 1623 | + * Init loader class for videoobject. |
|
| 1624 | + */ |
|
| 1625 | + $videoobject_loader = new Loader(); |
|
| 1626 | + $videoobject_loader->init_feature(); |
|
| 1627 | + } |
|
| 1628 | + |
|
| 1629 | + /** |
|
| 1630 | + * Define the locale for this plugin for internationalization. |
|
| 1631 | + * |
|
| 1632 | + * Uses the Wordlift_i18n class in order to set the domain and to register the hook |
|
| 1633 | + * with WordPress. |
|
| 1634 | + * |
|
| 1635 | + * @since 1.0.0 |
|
| 1636 | + * @access private |
|
| 1637 | + */ |
|
| 1638 | + private function set_locale() { |
|
| 1639 | + |
|
| 1640 | + $plugin_i18n = new Wordlift_i18n(); |
|
| 1641 | + $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1642 | + |
|
| 1643 | + $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1644 | + |
|
| 1645 | + } |
|
| 1646 | + |
|
| 1647 | + /** |
|
| 1648 | + * Register all of the hooks related to the admin area functionality |
|
| 1649 | + * of the plugin. |
|
| 1650 | + * |
|
| 1651 | + * @since 1.0.0 |
|
| 1652 | + * @access private |
|
| 1653 | + */ |
|
| 1654 | + private function define_admin_hooks() { |
|
| 1655 | + $that = $this; |
|
| 1656 | + $plugin_admin = new Wordlift_Admin( |
|
| 1657 | + $this->get_plugin_name(), |
|
| 1658 | + $this->get_version(), |
|
| 1659 | + $this->configuration_service, |
|
| 1660 | + $this->notice_service, |
|
| 1661 | + $this->user_service |
|
| 1662 | + ); |
|
| 1663 | + |
|
| 1664 | + $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1665 | + $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 ); |
|
| 1666 | + |
|
| 1667 | + // Hook the init action to taxonomy services. |
|
| 1668 | + $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1669 | + $this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 ); |
|
| 1670 | + |
|
| 1671 | + // Hook the deleted_post_meta action to the Thumbnail service. |
|
| 1672 | + $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1673 | + |
|
| 1674 | + // Hook the added_post_meta action to the Thumbnail service. |
|
| 1675 | + $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1676 | + |
|
| 1677 | + // Hook the updated_post_meta action to the Thumbnail service. |
|
| 1678 | + $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1679 | + |
|
| 1680 | + // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1681 | + $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1682 | + |
|
| 1683 | + // Register custom allowed redirect hosts. |
|
| 1684 | + $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1685 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1686 | + $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1687 | + |
|
| 1688 | + /* |
|
| 1689 | 1689 | * The old dashboard is replaced with dashboard v2. |
| 1690 | 1690 | * |
| 1691 | 1691 | * The old dashboard service is still loaded because its functions are used. |
@@ -1694,391 +1694,391 @@ discard block |
||
| 1694 | 1694 | * |
| 1695 | 1695 | * @since 3.20.0 |
| 1696 | 1696 | */ |
| 1697 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1698 | - // $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' ); |
|
| 1699 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1700 | - // $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' ); |
|
| 1701 | - |
|
| 1702 | - // Hook save_post to the entity service to update custom fields (such as alternate labels). |
|
| 1703 | - // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
|
| 1704 | - $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1705 | - $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1706 | - |
|
| 1707 | - $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1708 | - $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1709 | - |
|
| 1710 | - // Entity listing customization (wp-admin/edit.php) |
|
| 1711 | - // Add custom columns. |
|
| 1712 | - $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1713 | - // no explicit entity as it prevents handling of other post types. |
|
| 1714 | - $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1715 | - // Add 4W selection. |
|
| 1716 | - $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1717 | - $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1718 | - $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' ); |
|
| 1719 | - $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' ); |
|
| 1720 | - |
|
| 1721 | - /* |
|
| 1697 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1698 | + // $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' ); |
|
| 1699 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1700 | + // $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' ); |
|
| 1701 | + |
|
| 1702 | + // Hook save_post to the entity service to update custom fields (such as alternate labels). |
|
| 1703 | + // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
|
| 1704 | + $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1705 | + $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1706 | + |
|
| 1707 | + $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1708 | + $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1709 | + |
|
| 1710 | + // Entity listing customization (wp-admin/edit.php) |
|
| 1711 | + // Add custom columns. |
|
| 1712 | + $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1713 | + // no explicit entity as it prevents handling of other post types. |
|
| 1714 | + $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1715 | + // Add 4W selection. |
|
| 1716 | + $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1717 | + $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1718 | + $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' ); |
|
| 1719 | + $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' ); |
|
| 1720 | + |
|
| 1721 | + /* |
|
| 1722 | 1722 | * If `All Entity Types` is disable, use the radio button Walker. |
| 1723 | 1723 | * |
| 1724 | 1724 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1725 | 1725 | */ |
| 1726 | - if ( ! WL_ALL_ENTITY_TYPES ) { |
|
| 1727 | - $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1728 | - } |
|
| 1729 | - |
|
| 1730 | - // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
|
| 1731 | - // entities. |
|
| 1732 | - $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1733 | - |
|
| 1734 | - // Filter imported post meta. |
|
| 1735 | - $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1736 | - |
|
| 1737 | - // Notify the import service when an import starts and ends. |
|
| 1738 | - $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1739 | - $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1740 | - |
|
| 1741 | - // Hook the AJAX wl_rebuild action to the Rebuild Service. |
|
| 1742 | - $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1743 | - $this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' ); |
|
| 1744 | - |
|
| 1745 | - /** |
|
| 1746 | - * Filter: wl_feature__enable__settings-download. |
|
| 1747 | - * |
|
| 1748 | - * @param bool whether the screens needed to be registered, defaults to true. |
|
| 1749 | - * |
|
| 1750 | - * @return bool |
|
| 1751 | - * @since 3.27.6 |
|
| 1752 | - */ |
|
| 1753 | - $this->features_registry->register_feature_from_slug( 'settings-download', true, array( |
|
| 1754 | - $this, |
|
| 1755 | - 'register_screens' |
|
| 1756 | - ) ); |
|
| 1757 | - |
|
| 1758 | - |
|
| 1759 | - // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
|
| 1760 | - $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1761 | - |
|
| 1762 | - // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1763 | - $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1764 | - $this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1765 | - $this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1766 | - |
|
| 1767 | - // Hook the AJAX wl_validate_key action to the Key Validation service. |
|
| 1768 | - $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1769 | - |
|
| 1770 | - // Hook the AJAX wl_update_country_options action to the countries. |
|
| 1771 | - $this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' ); |
|
| 1772 | - |
|
| 1773 | - // Hook the `admin_init` function to the Admin Setup. |
|
| 1774 | - $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1775 | - |
|
| 1776 | - // Hook the admin_init to the settings page. |
|
| 1777 | - $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1778 | - $this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' ); |
|
| 1779 | - |
|
| 1780 | - $this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' ); |
|
| 1781 | - |
|
| 1782 | - // Hook the menu creation on the general wordlift menu creation. |
|
| 1783 | - /** |
|
| 1784 | - * Filter: wl_feature__enable__screens. |
|
| 1785 | - * |
|
| 1786 | - * @param bool whether the screens needed to be registered, defaults to true. |
|
| 1787 | - * |
|
| 1788 | - * @return bool |
|
| 1789 | - * @since 3.27.6 |
|
| 1790 | - * |
|
| 1791 | - * Since 3.30.0 this feature is registered using registry. |
|
| 1792 | - */ |
|
| 1793 | - add_action( 'plugins_loaded', function () use ( $that ) { |
|
| 1794 | - if ( apply_filters( 'wl_feature__enable__settings-screen', true ) || Admin_User_Option::is_wordlift_admin() ) { |
|
| 1795 | - add_action( 'wl_admin_menu', array( $that->settings_page, 'admin_menu' ), 10, 2 ); |
|
| 1796 | - } |
|
| 1797 | - } ); |
|
| 1798 | - |
|
| 1799 | - // Hook key update. |
|
| 1800 | - $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1801 | - $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1802 | - |
|
| 1803 | - // Add additional action links to the WordLift plugin in the plugins page. |
|
| 1804 | - $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1805 | - |
|
| 1806 | - /* |
|
| 1726 | + if ( ! WL_ALL_ENTITY_TYPES ) { |
|
| 1727 | + $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1728 | + } |
|
| 1729 | + |
|
| 1730 | + // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
|
| 1731 | + // entities. |
|
| 1732 | + $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1733 | + |
|
| 1734 | + // Filter imported post meta. |
|
| 1735 | + $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1736 | + |
|
| 1737 | + // Notify the import service when an import starts and ends. |
|
| 1738 | + $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1739 | + $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1740 | + |
|
| 1741 | + // Hook the AJAX wl_rebuild action to the Rebuild Service. |
|
| 1742 | + $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1743 | + $this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' ); |
|
| 1744 | + |
|
| 1745 | + /** |
|
| 1746 | + * Filter: wl_feature__enable__settings-download. |
|
| 1747 | + * |
|
| 1748 | + * @param bool whether the screens needed to be registered, defaults to true. |
|
| 1749 | + * |
|
| 1750 | + * @return bool |
|
| 1751 | + * @since 3.27.6 |
|
| 1752 | + */ |
|
| 1753 | + $this->features_registry->register_feature_from_slug( 'settings-download', true, array( |
|
| 1754 | + $this, |
|
| 1755 | + 'register_screens' |
|
| 1756 | + ) ); |
|
| 1757 | + |
|
| 1758 | + |
|
| 1759 | + // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
|
| 1760 | + $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1761 | + |
|
| 1762 | + // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1763 | + $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1764 | + $this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1765 | + $this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1766 | + |
|
| 1767 | + // Hook the AJAX wl_validate_key action to the Key Validation service. |
|
| 1768 | + $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1769 | + |
|
| 1770 | + // Hook the AJAX wl_update_country_options action to the countries. |
|
| 1771 | + $this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' ); |
|
| 1772 | + |
|
| 1773 | + // Hook the `admin_init` function to the Admin Setup. |
|
| 1774 | + $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1775 | + |
|
| 1776 | + // Hook the admin_init to the settings page. |
|
| 1777 | + $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1778 | + $this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' ); |
|
| 1779 | + |
|
| 1780 | + $this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' ); |
|
| 1781 | + |
|
| 1782 | + // Hook the menu creation on the general wordlift menu creation. |
|
| 1783 | + /** |
|
| 1784 | + * Filter: wl_feature__enable__screens. |
|
| 1785 | + * |
|
| 1786 | + * @param bool whether the screens needed to be registered, defaults to true. |
|
| 1787 | + * |
|
| 1788 | + * @return bool |
|
| 1789 | + * @since 3.27.6 |
|
| 1790 | + * |
|
| 1791 | + * Since 3.30.0 this feature is registered using registry. |
|
| 1792 | + */ |
|
| 1793 | + add_action( 'plugins_loaded', function () use ( $that ) { |
|
| 1794 | + if ( apply_filters( 'wl_feature__enable__settings-screen', true ) || Admin_User_Option::is_wordlift_admin() ) { |
|
| 1795 | + add_action( 'wl_admin_menu', array( $that->settings_page, 'admin_menu' ), 10, 2 ); |
|
| 1796 | + } |
|
| 1797 | + } ); |
|
| 1798 | + |
|
| 1799 | + // Hook key update. |
|
| 1800 | + $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1801 | + $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1802 | + |
|
| 1803 | + // Add additional action links to the WordLift plugin in the plugins page. |
|
| 1804 | + $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1805 | + |
|
| 1806 | + /* |
|
| 1807 | 1807 | * Remove the Analytics Settings link from the plugin page. |
| 1808 | 1808 | * |
| 1809 | 1809 | * @see https://github.com/insideout10/wordlift-plugin/issues/932 |
| 1810 | 1810 | * @since 3.21.1 |
| 1811 | 1811 | */ |
| 1812 | - // $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1813 | - |
|
| 1814 | - // Hook the AJAX `wl_publisher` action name. |
|
| 1815 | - $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1816 | - |
|
| 1817 | - // Hook row actions for the entity type list admin. |
|
| 1818 | - $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1819 | - |
|
| 1820 | - /** Ajax actions. */ |
|
| 1821 | - $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' ); |
|
| 1822 | - |
|
| 1823 | - // Hook capabilities manipulation to allow access to entity type admin |
|
| 1824 | - // page on WordPress versions before 4.7. |
|
| 1825 | - global $wp_version; |
|
| 1826 | - if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1827 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1828 | - } |
|
| 1829 | - |
|
| 1830 | - $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1831 | - |
|
| 1832 | - /** Adapters. */ |
|
| 1833 | - $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1834 | - /** |
|
| 1835 | - * Disabling Faq temporarily. |
|
| 1836 | - * Load the tinymce editor button on the tool bar. |
|
| 1837 | - * @since 3.26.0 |
|
| 1838 | - */ |
|
| 1839 | - //$this->loader->add_filter( 'tiny_mce_before_init', $this->faq_tinymce_adapter, 'register_custom_tags' ); |
|
| 1840 | - //$this->loader->add_filter( 'mce_buttons', $this->faq_tinymce_adapter, 'register_faq_toolbar_button', 10, 1 ); |
|
| 1841 | - //$this->loader->add_filter( 'mce_external_plugins', $this->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 ); |
|
| 1842 | - |
|
| 1843 | - |
|
| 1844 | - $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' ); |
|
| 1845 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' ); |
|
| 1846 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' ); |
|
| 1847 | - /** |
|
| 1848 | - * @since 3.26.0 |
|
| 1849 | - */ |
|
| 1850 | - $excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter(); |
|
| 1851 | - $this->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' ); |
|
| 1852 | - // Adding Rest route for the post excerpt |
|
| 1853 | - Post_Excerpt_Rest_Controller::register_routes(); |
|
| 1854 | - |
|
| 1855 | - $this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 ); |
|
| 1856 | - $this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 ); |
|
| 1857 | - |
|
| 1858 | - // Handle the autocomplete request. |
|
| 1859 | - add_action( 'wp_ajax_wl_autocomplete', array( |
|
| 1860 | - $this->autocomplete_adapter, |
|
| 1861 | - 'wl_autocomplete', |
|
| 1862 | - ) ); |
|
| 1863 | - add_action( 'wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1864 | - $this->autocomplete_adapter, |
|
| 1865 | - 'wl_autocomplete', |
|
| 1866 | - ) ); |
|
| 1867 | - |
|
| 1868 | - // Hooks to restrict multisite super admin from manipulating entity types. |
|
| 1869 | - if ( is_multisite() ) { |
|
| 1870 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1871 | - } |
|
| 1872 | - |
|
| 1873 | - $deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service ); |
|
| 1874 | - |
|
| 1875 | - add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) ); |
|
| 1876 | - add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) ); |
|
| 1877 | - add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) ); |
|
| 1878 | - |
|
| 1879 | - /** |
|
| 1880 | - * Always allow the `wordlift/classification` block. |
|
| 1881 | - * |
|
| 1882 | - * @since 3.23.0 |
|
| 1883 | - */ |
|
| 1884 | - add_filter( 'allowed_block_types', function ( $value ) { |
|
| 1885 | - |
|
| 1886 | - if ( true === $value ) { |
|
| 1887 | - return $value; |
|
| 1888 | - } |
|
| 1889 | - |
|
| 1890 | - return array_merge( (array) $value, array( 'wordlift/classification' ) ); |
|
| 1891 | - }, PHP_INT_MAX ); |
|
| 1892 | - |
|
| 1893 | - /** |
|
| 1894 | - * @since 3.27.7 |
|
| 1895 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
| 1896 | - */ |
|
| 1897 | - new Top_Entities(); |
|
| 1898 | - } |
|
| 1899 | - |
|
| 1900 | - /** |
|
| 1901 | - * Register all of the hooks related to the public-facing functionality |
|
| 1902 | - * of the plugin. |
|
| 1903 | - * |
|
| 1904 | - * @since 1.0.0 |
|
| 1905 | - * @access private |
|
| 1906 | - */ |
|
| 1907 | - private function define_public_hooks() { |
|
| 1908 | - |
|
| 1909 | - $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1910 | - |
|
| 1911 | - // Register the entity post type. |
|
| 1912 | - $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1913 | - |
|
| 1914 | - // Bind the link generation and handling hooks to the entity link service. |
|
| 1915 | - $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1916 | - $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1917 | - // $this->loader->add_filter( 'wp_unique_post_slug_is_bad_flat_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3 ); |
|
| 1918 | - // $this->loader->add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4 ); |
|
| 1919 | - |
|
| 1920 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1921 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1922 | - $this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' ); |
|
| 1923 | - |
|
| 1924 | - // Registering Faq_Content_Filter service used for removing faq question and answer tags from the html. |
|
| 1925 | - $this->loader->add_filter( 'the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' ); |
|
| 1926 | - // Hook the content filter service to add entity links. |
|
| 1927 | - if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) { |
|
| 1928 | - $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1929 | - } |
|
| 1930 | - |
|
| 1931 | - // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1932 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1933 | - |
|
| 1934 | - // Hook the ShareThis service. |
|
| 1935 | - $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1936 | - $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1937 | - |
|
| 1938 | - // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1939 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1940 | - |
|
| 1941 | - // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
|
| 1942 | - // in order to tweak WP's `WP_Query` to include entities in queries related |
|
| 1943 | - // to categories. |
|
| 1944 | - $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1945 | - |
|
| 1946 | - /* |
|
| 1812 | + // $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1813 | + |
|
| 1814 | + // Hook the AJAX `wl_publisher` action name. |
|
| 1815 | + $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1816 | + |
|
| 1817 | + // Hook row actions for the entity type list admin. |
|
| 1818 | + $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1819 | + |
|
| 1820 | + /** Ajax actions. */ |
|
| 1821 | + $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' ); |
|
| 1822 | + |
|
| 1823 | + // Hook capabilities manipulation to allow access to entity type admin |
|
| 1824 | + // page on WordPress versions before 4.7. |
|
| 1825 | + global $wp_version; |
|
| 1826 | + if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1827 | + $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1828 | + } |
|
| 1829 | + |
|
| 1830 | + $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1831 | + |
|
| 1832 | + /** Adapters. */ |
|
| 1833 | + $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1834 | + /** |
|
| 1835 | + * Disabling Faq temporarily. |
|
| 1836 | + * Load the tinymce editor button on the tool bar. |
|
| 1837 | + * @since 3.26.0 |
|
| 1838 | + */ |
|
| 1839 | + //$this->loader->add_filter( 'tiny_mce_before_init', $this->faq_tinymce_adapter, 'register_custom_tags' ); |
|
| 1840 | + //$this->loader->add_filter( 'mce_buttons', $this->faq_tinymce_adapter, 'register_faq_toolbar_button', 10, 1 ); |
|
| 1841 | + //$this->loader->add_filter( 'mce_external_plugins', $this->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 ); |
|
| 1842 | + |
|
| 1843 | + |
|
| 1844 | + $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' ); |
|
| 1845 | + $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' ); |
|
| 1846 | + $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' ); |
|
| 1847 | + /** |
|
| 1848 | + * @since 3.26.0 |
|
| 1849 | + */ |
|
| 1850 | + $excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter(); |
|
| 1851 | + $this->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' ); |
|
| 1852 | + // Adding Rest route for the post excerpt |
|
| 1853 | + Post_Excerpt_Rest_Controller::register_routes(); |
|
| 1854 | + |
|
| 1855 | + $this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 ); |
|
| 1856 | + $this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 ); |
|
| 1857 | + |
|
| 1858 | + // Handle the autocomplete request. |
|
| 1859 | + add_action( 'wp_ajax_wl_autocomplete', array( |
|
| 1860 | + $this->autocomplete_adapter, |
|
| 1861 | + 'wl_autocomplete', |
|
| 1862 | + ) ); |
|
| 1863 | + add_action( 'wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1864 | + $this->autocomplete_adapter, |
|
| 1865 | + 'wl_autocomplete', |
|
| 1866 | + ) ); |
|
| 1867 | + |
|
| 1868 | + // Hooks to restrict multisite super admin from manipulating entity types. |
|
| 1869 | + if ( is_multisite() ) { |
|
| 1870 | + $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1871 | + } |
|
| 1872 | + |
|
| 1873 | + $deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service ); |
|
| 1874 | + |
|
| 1875 | + add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) ); |
|
| 1876 | + add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) ); |
|
| 1877 | + add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) ); |
|
| 1878 | + |
|
| 1879 | + /** |
|
| 1880 | + * Always allow the `wordlift/classification` block. |
|
| 1881 | + * |
|
| 1882 | + * @since 3.23.0 |
|
| 1883 | + */ |
|
| 1884 | + add_filter( 'allowed_block_types', function ( $value ) { |
|
| 1885 | + |
|
| 1886 | + if ( true === $value ) { |
|
| 1887 | + return $value; |
|
| 1888 | + } |
|
| 1889 | + |
|
| 1890 | + return array_merge( (array) $value, array( 'wordlift/classification' ) ); |
|
| 1891 | + }, PHP_INT_MAX ); |
|
| 1892 | + |
|
| 1893 | + /** |
|
| 1894 | + * @since 3.27.7 |
|
| 1895 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
| 1896 | + */ |
|
| 1897 | + new Top_Entities(); |
|
| 1898 | + } |
|
| 1899 | + |
|
| 1900 | + /** |
|
| 1901 | + * Register all of the hooks related to the public-facing functionality |
|
| 1902 | + * of the plugin. |
|
| 1903 | + * |
|
| 1904 | + * @since 1.0.0 |
|
| 1905 | + * @access private |
|
| 1906 | + */ |
|
| 1907 | + private function define_public_hooks() { |
|
| 1908 | + |
|
| 1909 | + $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1910 | + |
|
| 1911 | + // Register the entity post type. |
|
| 1912 | + $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1913 | + |
|
| 1914 | + // Bind the link generation and handling hooks to the entity link service. |
|
| 1915 | + $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1916 | + $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1917 | + // $this->loader->add_filter( 'wp_unique_post_slug_is_bad_flat_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3 ); |
|
| 1918 | + // $this->loader->add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4 ); |
|
| 1919 | + |
|
| 1920 | + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1921 | + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1922 | + $this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' ); |
|
| 1923 | + |
|
| 1924 | + // Registering Faq_Content_Filter service used for removing faq question and answer tags from the html. |
|
| 1925 | + $this->loader->add_filter( 'the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' ); |
|
| 1926 | + // Hook the content filter service to add entity links. |
|
| 1927 | + if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) { |
|
| 1928 | + $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1929 | + } |
|
| 1930 | + |
|
| 1931 | + // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1932 | + $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1933 | + |
|
| 1934 | + // Hook the ShareThis service. |
|
| 1935 | + $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1936 | + $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1937 | + |
|
| 1938 | + // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1939 | + $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1940 | + |
|
| 1941 | + // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
|
| 1942 | + // in order to tweak WP's `WP_Query` to include entities in queries related |
|
| 1943 | + // to categories. |
|
| 1944 | + $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1945 | + |
|
| 1946 | + /* |
|
| 1947 | 1947 | * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service` |
| 1948 | 1948 | * in order to tweak WP's `WP_Query` to show event related entities in reverse |
| 1949 | 1949 | * order of start time. |
| 1950 | 1950 | */ |
| 1951 | - $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1952 | - |
|
| 1953 | - $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1954 | - |
|
| 1955 | - // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
|
| 1956 | - $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1957 | - |
|
| 1958 | - // Analytics Script Frontend. |
|
| 1959 | - if ( $this->configuration_service->is_analytics_enable() ) { |
|
| 1960 | - $this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 ); |
|
| 1961 | - } |
|
| 1962 | - |
|
| 1963 | - } |
|
| 1964 | - |
|
| 1965 | - /** |
|
| 1966 | - * Run the loader to execute all of the hooks with WordPress. |
|
| 1967 | - * |
|
| 1968 | - * @since 1.0.0 |
|
| 1969 | - */ |
|
| 1970 | - public function run() { |
|
| 1971 | - $this->loader->run(); |
|
| 1972 | - } |
|
| 1973 | - |
|
| 1974 | - /** |
|
| 1975 | - * The name of the plugin used to uniquely identify it within the context of |
|
| 1976 | - * WordPress and to define internationalization functionality. |
|
| 1977 | - * |
|
| 1978 | - * @return string The name of the plugin. |
|
| 1979 | - * @since 1.0.0 |
|
| 1980 | - */ |
|
| 1981 | - public function get_plugin_name() { |
|
| 1982 | - return $this->plugin_name; |
|
| 1983 | - } |
|
| 1984 | - |
|
| 1985 | - /** |
|
| 1986 | - * The reference to the class that orchestrates the hooks with the plugin. |
|
| 1987 | - * |
|
| 1988 | - * @return Wordlift_Loader Orchestrates the hooks of the plugin. |
|
| 1989 | - * @since 1.0.0 |
|
| 1990 | - */ |
|
| 1991 | - public function get_loader() { |
|
| 1992 | - return $this->loader; |
|
| 1993 | - } |
|
| 1994 | - |
|
| 1995 | - /** |
|
| 1996 | - * Retrieve the version number of the plugin. |
|
| 1997 | - * |
|
| 1998 | - * @return string The version number of the plugin. |
|
| 1999 | - * @since 1.0.0 |
|
| 2000 | - */ |
|
| 2001 | - public function get_version() { |
|
| 2002 | - return $this->version; |
|
| 2003 | - } |
|
| 2004 | - |
|
| 2005 | - /** |
|
| 2006 | - * Load dependencies for WP-CLI. |
|
| 2007 | - * |
|
| 2008 | - * @throws Exception |
|
| 2009 | - * @since 3.18.0 |
|
| 2010 | - */ |
|
| 2011 | - private function load_cli_dependencies() { |
|
| 2012 | - |
|
| 2013 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php'; |
|
| 2014 | - |
|
| 2015 | - $push_reference_data_command = new Wordlift_Push_Reference_Data_Command( $this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service ); |
|
| 2016 | - |
|
| 2017 | - WP_CLI::add_command( 'wl references push', $push_reference_data_command ); |
|
| 2018 | - |
|
| 2019 | - } |
|
| 2020 | - |
|
| 2021 | - /** |
|
| 2022 | - * Get the {@link \Wordlift_Dashboard_Service} to allow others to use its functions. |
|
| 2023 | - * |
|
| 2024 | - * @return \Wordlift_Dashboard_Service The {@link \Wordlift_Dashboard_Service} instance. |
|
| 2025 | - * @since 3.20.0 |
|
| 2026 | - */ |
|
| 2027 | - public function get_dashboard_service() { |
|
| 2028 | - |
|
| 2029 | - return $this->dashboard_service; |
|
| 2030 | - } |
|
| 2031 | - |
|
| 2032 | - public function add_wl_enabled_blocks() { |
|
| 2033 | - /** |
|
| 2034 | - * Filter: wl_feature__enable__blocks. |
|
| 2035 | - * |
|
| 2036 | - * @param bool whether the blocks needed to be registered, defaults to true. |
|
| 2037 | - * |
|
| 2038 | - * @return bool |
|
| 2039 | - * @since 3.27.6 |
|
| 2040 | - */ |
|
| 2041 | - |
|
| 2042 | - wp_register_script( 'wl_enabled_blocks', false ); |
|
| 2043 | - |
|
| 2044 | - $enabled_blocks = array(); |
|
| 2045 | - |
|
| 2046 | - /** |
|
| 2047 | - * Filter name: wl_feature_enable__product_navigator |
|
| 2048 | - * @since 3.30.0 |
|
| 2049 | - */ |
|
| 2050 | - if ( apply_filters( 'wl_feature_enable__product-navigator', true ) ) { |
|
| 2051 | - $enabled_blocks[] = 'wordlift/products-navigator'; |
|
| 2052 | - } |
|
| 2053 | - |
|
| 2054 | - if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 2055 | - // To intimate JS |
|
| 2056 | - $enabled_blocks = array_merge( $enabled_blocks, array( |
|
| 2057 | - 'wordlift/navigator', |
|
| 2058 | - 'wordlift/chord', |
|
| 2059 | - 'wordlift/geomap', |
|
| 2060 | - 'wordlift/timeline', |
|
| 2061 | - 'wordlift/cloud', |
|
| 2062 | - 'wordlift/vocabulary', |
|
| 2063 | - 'wordlift/faceted-search' |
|
| 2064 | - ) ); |
|
| 2065 | - } |
|
| 2066 | - |
|
| 2067 | - wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks ); |
|
| 2068 | - wp_enqueue_script( 'wl_enabled_blocks' ); |
|
| 2069 | - } |
|
| 2070 | - |
|
| 2071 | - /** |
|
| 2072 | - * Register screens based on the filter. |
|
| 2073 | - */ |
|
| 2074 | - public function register_screens() { |
|
| 2075 | - // Hook the menu to the Download Your Data page. |
|
| 2076 | - if ( apply_filters( 'wl_feature__enable__settings-download', true ) ) { |
|
| 2077 | - add_action( 'admin_menu', array( $this->download_your_data_page, 'admin_menu' ), 100, 0 ); |
|
| 2078 | - } |
|
| 2079 | - add_action( 'admin_menu', array( $this->status_page, 'admin_menu' ), 100, 0 ); |
|
| 2080 | - add_action( 'admin_menu', array( $this->entity_type_settings_admin_page, 'admin_menu' ), 100, 0 ); |
|
| 2081 | - |
|
| 2082 | - } |
|
| 1951 | + $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1952 | + |
|
| 1953 | + $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1954 | + |
|
| 1955 | + // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
|
| 1956 | + $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1957 | + |
|
| 1958 | + // Analytics Script Frontend. |
|
| 1959 | + if ( $this->configuration_service->is_analytics_enable() ) { |
|
| 1960 | + $this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 ); |
|
| 1961 | + } |
|
| 1962 | + |
|
| 1963 | + } |
|
| 1964 | + |
|
| 1965 | + /** |
|
| 1966 | + * Run the loader to execute all of the hooks with WordPress. |
|
| 1967 | + * |
|
| 1968 | + * @since 1.0.0 |
|
| 1969 | + */ |
|
| 1970 | + public function run() { |
|
| 1971 | + $this->loader->run(); |
|
| 1972 | + } |
|
| 1973 | + |
|
| 1974 | + /** |
|
| 1975 | + * The name of the plugin used to uniquely identify it within the context of |
|
| 1976 | + * WordPress and to define internationalization functionality. |
|
| 1977 | + * |
|
| 1978 | + * @return string The name of the plugin. |
|
| 1979 | + * @since 1.0.0 |
|
| 1980 | + */ |
|
| 1981 | + public function get_plugin_name() { |
|
| 1982 | + return $this->plugin_name; |
|
| 1983 | + } |
|
| 1984 | + |
|
| 1985 | + /** |
|
| 1986 | + * The reference to the class that orchestrates the hooks with the plugin. |
|
| 1987 | + * |
|
| 1988 | + * @return Wordlift_Loader Orchestrates the hooks of the plugin. |
|
| 1989 | + * @since 1.0.0 |
|
| 1990 | + */ |
|
| 1991 | + public function get_loader() { |
|
| 1992 | + return $this->loader; |
|
| 1993 | + } |
|
| 1994 | + |
|
| 1995 | + /** |
|
| 1996 | + * Retrieve the version number of the plugin. |
|
| 1997 | + * |
|
| 1998 | + * @return string The version number of the plugin. |
|
| 1999 | + * @since 1.0.0 |
|
| 2000 | + */ |
|
| 2001 | + public function get_version() { |
|
| 2002 | + return $this->version; |
|
| 2003 | + } |
|
| 2004 | + |
|
| 2005 | + /** |
|
| 2006 | + * Load dependencies for WP-CLI. |
|
| 2007 | + * |
|
| 2008 | + * @throws Exception |
|
| 2009 | + * @since 3.18.0 |
|
| 2010 | + */ |
|
| 2011 | + private function load_cli_dependencies() { |
|
| 2012 | + |
|
| 2013 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php'; |
|
| 2014 | + |
|
| 2015 | + $push_reference_data_command = new Wordlift_Push_Reference_Data_Command( $this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service ); |
|
| 2016 | + |
|
| 2017 | + WP_CLI::add_command( 'wl references push', $push_reference_data_command ); |
|
| 2018 | + |
|
| 2019 | + } |
|
| 2020 | + |
|
| 2021 | + /** |
|
| 2022 | + * Get the {@link \Wordlift_Dashboard_Service} to allow others to use its functions. |
|
| 2023 | + * |
|
| 2024 | + * @return \Wordlift_Dashboard_Service The {@link \Wordlift_Dashboard_Service} instance. |
|
| 2025 | + * @since 3.20.0 |
|
| 2026 | + */ |
|
| 2027 | + public function get_dashboard_service() { |
|
| 2028 | + |
|
| 2029 | + return $this->dashboard_service; |
|
| 2030 | + } |
|
| 2031 | + |
|
| 2032 | + public function add_wl_enabled_blocks() { |
|
| 2033 | + /** |
|
| 2034 | + * Filter: wl_feature__enable__blocks. |
|
| 2035 | + * |
|
| 2036 | + * @param bool whether the blocks needed to be registered, defaults to true. |
|
| 2037 | + * |
|
| 2038 | + * @return bool |
|
| 2039 | + * @since 3.27.6 |
|
| 2040 | + */ |
|
| 2041 | + |
|
| 2042 | + wp_register_script( 'wl_enabled_blocks', false ); |
|
| 2043 | + |
|
| 2044 | + $enabled_blocks = array(); |
|
| 2045 | + |
|
| 2046 | + /** |
|
| 2047 | + * Filter name: wl_feature_enable__product_navigator |
|
| 2048 | + * @since 3.30.0 |
|
| 2049 | + */ |
|
| 2050 | + if ( apply_filters( 'wl_feature_enable__product-navigator', true ) ) { |
|
| 2051 | + $enabled_blocks[] = 'wordlift/products-navigator'; |
|
| 2052 | + } |
|
| 2053 | + |
|
| 2054 | + if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 2055 | + // To intimate JS |
|
| 2056 | + $enabled_blocks = array_merge( $enabled_blocks, array( |
|
| 2057 | + 'wordlift/navigator', |
|
| 2058 | + 'wordlift/chord', |
|
| 2059 | + 'wordlift/geomap', |
|
| 2060 | + 'wordlift/timeline', |
|
| 2061 | + 'wordlift/cloud', |
|
| 2062 | + 'wordlift/vocabulary', |
|
| 2063 | + 'wordlift/faceted-search' |
|
| 2064 | + ) ); |
|
| 2065 | + } |
|
| 2066 | + |
|
| 2067 | + wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks ); |
|
| 2068 | + wp_enqueue_script( 'wl_enabled_blocks' ); |
|
| 2069 | + } |
|
| 2070 | + |
|
| 2071 | + /** |
|
| 2072 | + * Register screens based on the filter. |
|
| 2073 | + */ |
|
| 2074 | + public function register_screens() { |
|
| 2075 | + // Hook the menu to the Download Your Data page. |
|
| 2076 | + if ( apply_filters( 'wl_feature__enable__settings-download', true ) ) { |
|
| 2077 | + add_action( 'admin_menu', array( $this->download_your_data_page, 'admin_menu' ), 100, 0 ); |
|
| 2078 | + } |
|
| 2079 | + add_action( 'admin_menu', array( $this->status_page, 'admin_menu' ), 100, 0 ); |
|
| 2080 | + add_action( 'admin_menu', array( $this->entity_type_settings_admin_page, 'admin_menu' ), 100, 0 ); |
|
| 2081 | + |
|
| 2082 | + } |
|
| 2083 | 2083 | |
| 2084 | 2084 | } |
@@ -773,7 +773,7 @@ discard block |
||
| 773 | 773 | $this->define_public_hooks(); |
| 774 | 774 | |
| 775 | 775 | // If we're in `WP_CLI` load the related files. |
| 776 | - if ( class_exists( 'WP_CLI' ) ) { |
|
| 776 | + if (class_exists('WP_CLI')) { |
|
| 777 | 777 | $this->load_cli_dependencies(); |
| 778 | 778 | } |
| 779 | 779 | |
@@ -814,381 +814,381 @@ discard block |
||
| 814 | 814 | * The class responsible for orchestrating the actions and filters of the |
| 815 | 815 | * core plugin. |
| 816 | 816 | */ |
| 817 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 817 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-loader.php'; |
|
| 818 | 818 | |
| 819 | 819 | // The class responsible for plugin uninstall. |
| 820 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
|
| 820 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-deactivator-feedback.php'; |
|
| 821 | 821 | |
| 822 | 822 | /** |
| 823 | 823 | * The class responsible for defining internationalization functionality |
| 824 | 824 | * of the plugin. |
| 825 | 825 | */ |
| 826 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 826 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-i18n.php'; |
|
| 827 | 827 | |
| 828 | 828 | /** |
| 829 | 829 | * WordLift's supported languages. |
| 830 | 830 | */ |
| 831 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 831 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-languages.php'; |
|
| 832 | 832 | |
| 833 | 833 | /** |
| 834 | 834 | * WordLift's supported countries. |
| 835 | 835 | */ |
| 836 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php'; |
|
| 836 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-countries.php'; |
|
| 837 | 837 | |
| 838 | 838 | /** |
| 839 | 839 | * Provide support functions to sanitize data. |
| 840 | 840 | */ |
| 841 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 841 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sanitizer.php'; |
|
| 842 | 842 | |
| 843 | 843 | /** Services. */ |
| 844 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 845 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
|
| 846 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 847 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 848 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 849 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 850 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 851 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
|
| 852 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 853 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php'; |
|
| 844 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-log-service.php'; |
|
| 845 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-http-api.php'; |
|
| 846 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-redirect-service.php'; |
|
| 847 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-configuration-service.php'; |
|
| 848 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-type-service.php'; |
|
| 849 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-service.php'; |
|
| 850 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-link-service.php'; |
|
| 851 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-linked-data-service.php'; |
|
| 852 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-relation-service.php'; |
|
| 853 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-image-service.php'; |
|
| 854 | 854 | |
| 855 | 855 | /** |
| 856 | 856 | * The Query builder. |
| 857 | 857 | */ |
| 858 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 858 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-query-builder.php'; |
|
| 859 | 859 | |
| 860 | 860 | /** |
| 861 | 861 | * The Schema service. |
| 862 | 862 | */ |
| 863 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 863 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-service.php'; |
|
| 864 | 864 | |
| 865 | 865 | /** |
| 866 | 866 | * The schema:url property service. |
| 867 | 867 | */ |
| 868 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 869 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 868 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-service.php'; |
|
| 869 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-url-property-service.php'; |
|
| 870 | 870 | |
| 871 | 871 | /** |
| 872 | 872 | * The UI service. |
| 873 | 873 | */ |
| 874 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 874 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-ui-service.php'; |
|
| 875 | 875 | |
| 876 | 876 | /** |
| 877 | 877 | * The Thumbnail service. |
| 878 | 878 | */ |
| 879 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 879 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-thumbnail-service.php'; |
|
| 880 | 880 | |
| 881 | 881 | /** |
| 882 | 882 | * The Entity Types Taxonomy service. |
| 883 | 883 | */ |
| 884 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 884 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 885 | 885 | |
| 886 | 886 | /** |
| 887 | 887 | * The Entity service. |
| 888 | 888 | */ |
| 889 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
|
| 890 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 889 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-uri-service.php'; |
|
| 890 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-service.php'; |
|
| 891 | 891 | |
| 892 | 892 | // Add the entity rating service. |
| 893 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 893 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rating-service.php'; |
|
| 894 | 894 | |
| 895 | 895 | /** |
| 896 | 896 | * The User service. |
| 897 | 897 | */ |
| 898 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 898 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-user-service.php'; |
|
| 899 | 899 | |
| 900 | 900 | /** |
| 901 | 901 | * The Timeline service. |
| 902 | 902 | */ |
| 903 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 903 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-timeline-service.php'; |
|
| 904 | 904 | |
| 905 | 905 | /** |
| 906 | 906 | * The Topic Taxonomy service. |
| 907 | 907 | */ |
| 908 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 908 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 909 | 909 | |
| 910 | 910 | /** |
| 911 | 911 | * The SPARQL service. |
| 912 | 912 | */ |
| 913 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 913 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sparql-service.php'; |
|
| 914 | 914 | |
| 915 | 915 | /** |
| 916 | 916 | * The WordLift import service. |
| 917 | 917 | */ |
| 918 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 918 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-import-service.php'; |
|
| 919 | 919 | |
| 920 | 920 | /** |
| 921 | 921 | * The WordLift URI service. |
| 922 | 922 | */ |
| 923 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 924 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 925 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 923 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-uri-service.php'; |
|
| 924 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-factory.php'; |
|
| 925 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-service.php'; |
|
| 926 | 926 | |
| 927 | 927 | /** |
| 928 | 928 | * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
| 929 | 929 | */ |
| 930 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php'; |
|
| 931 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php'; |
|
| 932 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php'; |
|
| 933 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php'; |
|
| 934 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php'; |
|
| 930 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-listable.php'; |
|
| 931 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-rebuild-service.php'; |
|
| 932 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-reference-rebuild-service.php'; |
|
| 933 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-relation-rebuild-service.php'; |
|
| 934 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-relation-rebuild-adapter.php'; |
|
| 935 | 935 | |
| 936 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 937 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 936 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 937 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-attachment-service.php'; |
|
| 938 | 938 | |
| 939 | 939 | /** |
| 940 | 940 | * Load the converters. |
| 941 | 941 | */ |
| 942 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 943 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 944 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 945 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 946 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 947 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 942 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/intf-wordlift-post-converter.php'; |
|
| 943 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 944 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 945 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 946 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 947 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 948 | 948 | |
| 949 | 949 | /** |
| 950 | 950 | * Load cache-related files. |
| 951 | 951 | */ |
| 952 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
|
| 952 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/cache/require.php'; |
|
| 953 | 953 | |
| 954 | 954 | /** |
| 955 | 955 | * Load the content filter. |
| 956 | 956 | */ |
| 957 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 957 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-content-filter-service.php'; |
|
| 958 | 958 | |
| 959 | 959 | /* |
| 960 | 960 | * Load the excerpt helper. |
| 961 | 961 | */ |
| 962 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 962 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 963 | 963 | |
| 964 | 964 | /** |
| 965 | 965 | * Load the JSON-LD service to publish entities using JSON-LD.s |
| 966 | 966 | * |
| 967 | 967 | * @since 3.8.0 |
| 968 | 968 | */ |
| 969 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 969 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-service.php'; |
|
| 970 | 970 | |
| 971 | 971 | // The Publisher Service and the AJAX adapter. |
| 972 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 973 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 972 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-service.php'; |
|
| 973 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 974 | 974 | |
| 975 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 975 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-adapter.php'; |
|
| 976 | 976 | |
| 977 | 977 | /** |
| 978 | 978 | * Load the WordLift key validation service. |
| 979 | 979 | */ |
| 980 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 980 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-key-validation-service.php'; |
|
| 981 | 981 | |
| 982 | 982 | // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
| 983 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 983 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 984 | 984 | |
| 985 | 985 | // Load the `Wordlift_Entity_Page_Service` class definition. |
| 986 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
| 986 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-page-service.php'; |
|
| 987 | 987 | |
| 988 | 988 | /** Linked Data. */ |
| 989 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 990 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 991 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 992 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 993 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 994 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 995 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 996 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 997 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 998 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 999 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 989 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 990 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 991 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 992 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 993 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 994 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 995 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 996 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 997 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 998 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 999 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 1000 | 1000 | |
| 1001 | 1001 | /** Linked Data Rendition. */ |
| 1002 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php'; |
|
| 1003 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php'; |
|
| 1004 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php'; |
|
| 1005 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 1002 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php'; |
|
| 1003 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php'; |
|
| 1004 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php'; |
|
| 1005 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 1006 | 1006 | |
| 1007 | 1007 | /** Services. */ |
| 1008 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 1009 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php'; |
|
| 1008 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 1009 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-api-service.php'; |
|
| 1010 | 1010 | |
| 1011 | 1011 | /** Adapters. */ |
| 1012 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 1013 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 1014 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 1015 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 1016 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php'; |
|
| 1012 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-tinymce-adapter.php'; |
|
| 1013 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-newrelic-adapter.php'; |
|
| 1014 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 1015 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-adapter.php'; |
|
| 1016 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-wprocket-adapter.php'; |
|
| 1017 | 1017 | |
| 1018 | 1018 | /** Async Tasks. */ |
| 1019 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php'; |
|
| 1020 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 1021 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php'; |
|
| 1019 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-async-task.php'; |
|
| 1020 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 1021 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-push-references-async-task.php'; |
|
| 1022 | 1022 | |
| 1023 | 1023 | /** Autocomplete. */ |
| 1024 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 1024 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 1025 | 1025 | |
| 1026 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
|
| 1026 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-remote-image-service.php'; |
|
| 1027 | 1027 | |
| 1028 | 1028 | /** Analytics */ |
| 1029 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 1029 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 1030 | 1030 | |
| 1031 | 1031 | /** |
| 1032 | 1032 | * The class responsible for defining all actions that occur in the admin area. |
| 1033 | 1033 | */ |
| 1034 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 1034 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin.php'; |
|
| 1035 | 1035 | |
| 1036 | 1036 | /** |
| 1037 | 1037 | * The class to customize the entity list admin page. |
| 1038 | 1038 | */ |
| 1039 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 1039 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-list.php'; |
|
| 1040 | 1040 | |
| 1041 | 1041 | /** |
| 1042 | 1042 | * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
| 1043 | 1043 | */ |
| 1044 | 1044 | global $wp_version; |
| 1045 | - if ( version_compare( $wp_version, '5.3', '<' ) ) { |
|
| 1046 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 1045 | + if (version_compare($wp_version, '5.3', '<')) { |
|
| 1046 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 1047 | 1047 | } else { |
| 1048 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
| 1048 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
| 1049 | 1049 | } |
| 1050 | 1050 | |
| 1051 | 1051 | /** |
| 1052 | 1052 | * The Notice service. |
| 1053 | 1053 | */ |
| 1054 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 1054 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-notice-service.php'; |
|
| 1055 | 1055 | |
| 1056 | 1056 | /** |
| 1057 | 1057 | * The PrimaShop adapter. |
| 1058 | 1058 | */ |
| 1059 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 1059 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-primashop-adapter.php'; |
|
| 1060 | 1060 | |
| 1061 | 1061 | /** |
| 1062 | 1062 | * The WordLift Dashboard service. |
| 1063 | 1063 | */ |
| 1064 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 1064 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard.php'; |
|
| 1065 | 1065 | |
| 1066 | 1066 | /** |
| 1067 | 1067 | * The admin 'Install wizard' page. |
| 1068 | 1068 | */ |
| 1069 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 1069 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-setup.php'; |
|
| 1070 | 1070 | |
| 1071 | 1071 | /** |
| 1072 | 1072 | * The WordLift entity type list admin page controller. |
| 1073 | 1073 | */ |
| 1074 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 1074 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 1075 | 1075 | |
| 1076 | 1076 | /** |
| 1077 | 1077 | * The WordLift entity type settings admin page controller. |
| 1078 | 1078 | */ |
| 1079 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 1079 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-settings.php'; |
|
| 1080 | 1080 | |
| 1081 | 1081 | /** |
| 1082 | 1082 | * The admin 'Download Your Data' page. |
| 1083 | 1083 | */ |
| 1084 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 1084 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-download-your-data-page.php'; |
|
| 1085 | 1085 | |
| 1086 | 1086 | /** |
| 1087 | 1087 | * The admin 'WordLift Settings' page. |
| 1088 | 1088 | */ |
| 1089 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php'; |
|
| 1090 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 1091 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 1092 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 1093 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 1094 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 1095 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 1096 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 1097 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 1098 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 1099 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 1100 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 1101 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
| 1102 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 1103 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
| 1089 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/intf-wordlift-admin-element.php'; |
|
| 1090 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 1091 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 1092 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 1093 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 1094 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 1095 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 1096 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 1097 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 1098 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 1099 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-page.php'; |
|
| 1100 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page.php'; |
|
| 1101 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
| 1102 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 1103 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
| 1104 | 1104 | |
| 1105 | 1105 | /** Admin Pages */ |
| 1106 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 1107 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 1108 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-page.php'; |
|
| 1109 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 1106 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 1107 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-status-page.php'; |
|
| 1108 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-search-rankings-page.php'; |
|
| 1109 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 1110 | 1110 | |
| 1111 | 1111 | /** |
| 1112 | 1112 | * The class responsible for defining all actions that occur in the public-facing |
| 1113 | 1113 | * side of the site. |
| 1114 | 1114 | */ |
| 1115 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 1115 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-public.php'; |
|
| 1116 | 1116 | |
| 1117 | 1117 | /** |
| 1118 | 1118 | * The shortcode abstract class. |
| 1119 | 1119 | */ |
| 1120 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 1120 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-shortcode.php'; |
|
| 1121 | 1121 | |
| 1122 | 1122 | /** |
| 1123 | 1123 | * The Timeline shortcode. |
| 1124 | 1124 | */ |
| 1125 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 1125 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-timeline-shortcode.php'; |
|
| 1126 | 1126 | |
| 1127 | 1127 | /** |
| 1128 | 1128 | * The Navigator shortcode. |
| 1129 | 1129 | */ |
| 1130 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 1130 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-navigator-shortcode.php'; |
|
| 1131 | 1131 | |
| 1132 | 1132 | /** |
| 1133 | 1133 | * The Products Navigator shortcode. |
| 1134 | 1134 | */ |
| 1135 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php'; |
|
| 1135 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-products-navigator-shortcode.php'; |
|
| 1136 | 1136 | |
| 1137 | 1137 | /** |
| 1138 | 1138 | * The chord shortcode. |
| 1139 | 1139 | */ |
| 1140 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 1140 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-chord-shortcode.php'; |
|
| 1141 | 1141 | |
| 1142 | 1142 | /** |
| 1143 | 1143 | * The geomap shortcode. |
| 1144 | 1144 | */ |
| 1145 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 1145 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-geomap-shortcode.php'; |
|
| 1146 | 1146 | |
| 1147 | 1147 | /** |
| 1148 | 1148 | * The entity cloud shortcode. |
| 1149 | 1149 | */ |
| 1150 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 1150 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 1151 | 1151 | |
| 1152 | 1152 | /** |
| 1153 | 1153 | * The entity glossary shortcode. |
| 1154 | 1154 | */ |
| 1155 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
|
| 1156 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 1155 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-alphabet-service.php'; |
|
| 1156 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 1157 | 1157 | |
| 1158 | 1158 | /** |
| 1159 | 1159 | * Faceted Search shortcode. |
| 1160 | 1160 | */ |
| 1161 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 1161 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 1162 | 1162 | |
| 1163 | 1163 | /** |
| 1164 | 1164 | * The ShareThis service. |
| 1165 | 1165 | */ |
| 1166 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 1166 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-sharethis-service.php'; |
|
| 1167 | 1167 | |
| 1168 | 1168 | /** |
| 1169 | 1169 | * The SEO service. |
| 1170 | 1170 | */ |
| 1171 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 1171 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-seo-service.php'; |
|
| 1172 | 1172 | |
| 1173 | 1173 | /** |
| 1174 | 1174 | * The AMP service. |
| 1175 | 1175 | */ |
| 1176 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1176 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-amp-service.php'; |
|
| 1177 | 1177 | |
| 1178 | 1178 | /** Widgets */ |
| 1179 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1180 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1181 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php'; |
|
| 1179 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-widget.php'; |
|
| 1180 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1181 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-context-cards.php'; |
|
| 1182 | 1182 | |
| 1183 | 1183 | /* |
| 1184 | 1184 | * Schema.org Services. |
| 1185 | 1185 | * |
| 1186 | 1186 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1187 | 1187 | */ |
| 1188 | - if ( WL_ALL_ENTITY_TYPES ) { |
|
| 1189 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1190 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1191 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1188 | + if (WL_ALL_ENTITY_TYPES) { |
|
| 1189 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1190 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1191 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1192 | 1192 | new Wordlift_Schemaorg_Sync_Service(); |
| 1193 | 1193 | $schemaorg_property_service = new Wordlift_Schemaorg_Property_Service(); |
| 1194 | 1194 | new Wordlift_Schemaorg_Class_Service(); |
@@ -1204,25 +1204,25 @@ discard block |
||
| 1204 | 1204 | |
| 1205 | 1205 | // Instantiate a global logger. |
| 1206 | 1206 | global $wl_logger; |
| 1207 | - $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1207 | + $wl_logger = Wordlift_Log_Service::get_logger('WordLift'); |
|
| 1208 | 1208 | |
| 1209 | 1209 | // Load the `wl-api` end-point. |
| 1210 | 1210 | new Wordlift_Http_Api(); |
| 1211 | 1211 | |
| 1212 | 1212 | // Load the Install Service. |
| 1213 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
|
| 1213 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-service.php'; |
|
| 1214 | 1214 | $this->install_service = new Wordlift_Install_Service(); |
| 1215 | 1215 | |
| 1216 | 1216 | /** Services. */ |
| 1217 | 1217 | // Create the configuration service. |
| 1218 | 1218 | $this->configuration_service = new Wordlift_Configuration_Service(); |
| 1219 | - $api_service = new Wordlift_Api_Service( $this->configuration_service ); |
|
| 1219 | + $api_service = new Wordlift_Api_Service($this->configuration_service); |
|
| 1220 | 1220 | |
| 1221 | 1221 | // Create an entity type service instance. It'll be later bound to the init action. |
| 1222 | - $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 1222 | + $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service(Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path()); |
|
| 1223 | 1223 | |
| 1224 | 1224 | // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
| 1225 | - $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 1225 | + $this->entity_link_service = new Wordlift_Entity_Link_Service($this->entity_post_type_service, $this->configuration_service->get_entity_base_path()); |
|
| 1226 | 1226 | |
| 1227 | 1227 | // Create an instance of the UI service. |
| 1228 | 1228 | $this->ui_service = new Wordlift_UI_Service(); |
@@ -1231,30 +1231,30 @@ discard block |
||
| 1231 | 1231 | $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
| 1232 | 1232 | |
| 1233 | 1233 | $this->sparql_service = new Wordlift_Sparql_Service(); |
| 1234 | - $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 1234 | + $schema_url_property_service = new Wordlift_Schema_Url_Property_Service($this->sparql_service); |
|
| 1235 | 1235 | $this->notice_service = new Wordlift_Notice_Service(); |
| 1236 | 1236 | $this->relation_service = new Wordlift_Relation_Service(); |
| 1237 | 1237 | |
| 1238 | - $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' ); |
|
| 1239 | - $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service ); |
|
| 1240 | - $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service ); |
|
| 1241 | - $this->user_service = new Wordlift_User_Service( $this->sparql_service, $this->entity_service ); |
|
| 1238 | + $entity_uri_cache_service = new Wordlift_File_Cache_Service(WL_TEMP_DIR.'entity_uri/'); |
|
| 1239 | + $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service($this->configuration_service, $entity_uri_cache_service); |
|
| 1240 | + $this->entity_service = new Wordlift_Entity_Service($this->ui_service, $this->relation_service, $this->entity_uri_service); |
|
| 1241 | + $this->user_service = new Wordlift_User_Service($this->sparql_service, $this->entity_service); |
|
| 1242 | 1242 | |
| 1243 | 1243 | // Instantiate the JSON-LD service. |
| 1244 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1244 | + $property_getter = Wordlift_Property_Getter_Factory::create($this->entity_service); |
|
| 1245 | 1245 | |
| 1246 | 1246 | /** Linked Data. */ |
| 1247 | - $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
|
| 1248 | - $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
|
| 1247 | + $this->storage_factory = new Wordlift_Storage_Factory($this->entity_service, $this->user_service, $property_getter); |
|
| 1248 | + $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory($this->entity_service); |
|
| 1249 | 1249 | |
| 1250 | - $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
|
| 1250 | + $this->schema_service = new Wordlift_Schema_Service($this->storage_factory, $this->rendition_factory, $this->configuration_service); |
|
| 1251 | 1251 | |
| 1252 | 1252 | // Create a new instance of the Redirect service. |
| 1253 | - $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_uri_service ); |
|
| 1254 | - $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 1253 | + $this->redirect_service = new Wordlift_Redirect_Service($this->entity_uri_service); |
|
| 1254 | + $this->entity_type_service = new Wordlift_Entity_Type_Service($this->schema_service); |
|
| 1255 | 1255 | |
| 1256 | 1256 | // Create a new instance of the Timeline service and Timeline shortcode. |
| 1257 | - $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
|
| 1257 | + $this->timeline_service = new Wordlift_Timeline_Service($this->entity_service, $this->entity_type_service); |
|
| 1258 | 1258 | |
| 1259 | 1259 | $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
| 1260 | 1260 | |
@@ -1268,36 +1268,36 @@ discard block |
||
| 1268 | 1268 | $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
| 1269 | 1269 | |
| 1270 | 1270 | // Create an import service instance to hook later to WP's import function. |
| 1271 | - $this->import_service = new Wordlift_Import_Service( $this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri() ); |
|
| 1271 | + $this->import_service = new Wordlift_Import_Service($this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri()); |
|
| 1272 | 1272 | |
| 1273 | - $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1273 | + $uri_service = new Wordlift_Uri_Service($GLOBALS['wpdb']); |
|
| 1274 | 1274 | |
| 1275 | 1275 | // Create the entity rating service. |
| 1276 | - $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 1276 | + $this->rating_service = new Wordlift_Rating_Service($this->entity_service, $this->entity_type_service, $this->notice_service); |
|
| 1277 | 1277 | |
| 1278 | 1278 | // Create entity list customization (wp-admin/edit.php). |
| 1279 | - $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 1279 | + $this->entity_list_service = new Wordlift_Entity_List_Service($this->rating_service); |
|
| 1280 | 1280 | |
| 1281 | 1281 | // Create a new instance of the Redirect service. |
| 1282 | - $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
|
| 1282 | + $this->dashboard_service = new Wordlift_Dashboard_Service($this->rating_service, $this->entity_service); |
|
| 1283 | 1283 | |
| 1284 | 1284 | // Create an instance of the Publisher Service and the AJAX Adapter. |
| 1285 | - $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service ); |
|
| 1286 | - $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1287 | - $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1285 | + $this->publisher_service = new Wordlift_Publisher_Service($this->configuration_service); |
|
| 1286 | + $this->property_factory = new Wordlift_Property_Factory($schema_url_property_service); |
|
| 1287 | + $this->property_factory->register(Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service); |
|
| 1288 | 1288 | |
| 1289 | 1289 | $attachment_service = new Wordlift_Attachment_Service(); |
| 1290 | 1290 | |
| 1291 | 1291 | // Instantiate the JSON-LD service. |
| 1292 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1293 | - $this->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
|
| 1294 | - $this->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $this->post_to_jsonld_converter ); |
|
| 1295 | - $this->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter( $this->entity_service, $this->entity_post_to_jsonld_converter, $this->post_to_jsonld_converter ); |
|
| 1296 | - $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
|
| 1292 | + $property_getter = Wordlift_Property_Getter_Factory::create($this->entity_service); |
|
| 1293 | + $this->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service); |
|
| 1294 | + $this->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $this->post_to_jsonld_converter); |
|
| 1295 | + $this->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter($this->entity_service, $this->entity_post_to_jsonld_converter, $this->post_to_jsonld_converter); |
|
| 1296 | + $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service); |
|
| 1297 | 1297 | |
| 1298 | - $jsonld_cache = new Ttl_Cache( 'jsonld', 86400 ); |
|
| 1299 | - $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache ); |
|
| 1300 | - $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter ); |
|
| 1298 | + $jsonld_cache = new Ttl_Cache('jsonld', 86400); |
|
| 1299 | + $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter($this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache); |
|
| 1300 | + $this->jsonld_service = new Wordlift_Jsonld_Service($this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter); |
|
| 1301 | 1301 | |
| 1302 | 1302 | /* |
| 1303 | 1303 | * Load the `Wordlift_Term_JsonLd_Adapter`. |
@@ -1306,30 +1306,30 @@ discard block |
||
| 1306 | 1306 | * |
| 1307 | 1307 | * @since 3.20.0 |
| 1308 | 1308 | */ |
| 1309 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1310 | - $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->jsonld_service ); |
|
| 1309 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1310 | + $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter($this->entity_uri_service, $this->jsonld_service); |
|
| 1311 | 1311 | $jsonld_service = new Jsonld_Service( |
| 1312 | 1312 | $this->jsonld_service, |
| 1313 | 1313 | $term_jsonld_adapter, |
| 1314 | - new Jsonld_User_Service( $this->user_service ) ); |
|
| 1315 | - new Jsonld_Endpoint( $jsonld_service, $this->entity_uri_service ); |
|
| 1314 | + new Jsonld_User_Service($this->user_service) ); |
|
| 1315 | + new Jsonld_Endpoint($jsonld_service, $this->entity_uri_service); |
|
| 1316 | 1316 | |
| 1317 | 1317 | // Prints the JSON-LD in the head. |
| 1318 | - new Jsonld_Adapter( $this->jsonld_service ); |
|
| 1318 | + new Jsonld_Adapter($this->jsonld_service); |
|
| 1319 | 1319 | |
| 1320 | - new Jsonld_By_Id_Endpoint( $this->jsonld_service, $this->entity_uri_service ); |
|
| 1320 | + new Jsonld_By_Id_Endpoint($this->jsonld_service, $this->entity_uri_service); |
|
| 1321 | 1321 | |
| 1322 | - $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
|
| 1323 | - $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service ); |
|
| 1322 | + $this->key_validation_service = new Wordlift_Key_Validation_Service($this->configuration_service); |
|
| 1323 | + $this->content_filter_service = new Wordlift_Content_Filter_Service($this->entity_service, $this->configuration_service, $this->entity_uri_service); |
|
| 1324 | 1324 | // Creating Faq Content filter service. |
| 1325 | 1325 | $this->faq_content_filter_service = new Faq_Content_Filter(); |
| 1326 | - $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
|
| 1327 | - $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service ); |
|
| 1328 | - $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
|
| 1329 | - $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->entity_service ); |
|
| 1326 | + $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service($this->content_filter_service, $this->entity_service); |
|
| 1327 | + $this->sample_data_service = new Wordlift_Sample_Data_Service($this->entity_type_service, $this->configuration_service, $this->user_service); |
|
| 1328 | + $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter($this->sample_data_service); |
|
| 1329 | + $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service($this->entity_service); |
|
| 1330 | 1330 | |
| 1331 | - $this->loader->add_action( 'enqueue_block_editor_assets', $this, 'add_wl_enabled_blocks' ); |
|
| 1332 | - $this->loader->add_action( 'admin_enqueue_scripts', $this, 'add_wl_enabled_blocks' ); |
|
| 1331 | + $this->loader->add_action('enqueue_block_editor_assets', $this, 'add_wl_enabled_blocks'); |
|
| 1332 | + $this->loader->add_action('admin_enqueue_scripts', $this, 'add_wl_enabled_blocks'); |
|
| 1333 | 1333 | |
| 1334 | 1334 | /** |
| 1335 | 1335 | * Filter: wl_feature__enable__blocks. |
@@ -1339,15 +1339,15 @@ discard block |
||
| 1339 | 1339 | * @return bool |
| 1340 | 1340 | * @since 3.27.6 |
| 1341 | 1341 | */ |
| 1342 | - if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 1342 | + if (apply_filters('wl_feature__enable__blocks', true)) { |
|
| 1343 | 1343 | // Initialize the short-codes. |
| 1344 | - new Async_Template_Decorator( new Wordlift_Navigator_Shortcode() ); |
|
| 1344 | + new Async_Template_Decorator(new Wordlift_Navigator_Shortcode()); |
|
| 1345 | 1345 | new Wordlift_Chord_Shortcode(); |
| 1346 | 1346 | new Wordlift_Geomap_Shortcode(); |
| 1347 | 1347 | new Wordlift_Timeline_Shortcode(); |
| 1348 | - new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
|
| 1349 | - new Wordlift_Vocabulary_Shortcode( $this->configuration_service ); |
|
| 1350 | - new Async_Template_Decorator( new Wordlift_Faceted_Search_Shortcode() ); |
|
| 1348 | + new Wordlift_Related_Entities_Cloud_Shortcode($this->relation_service); |
|
| 1349 | + new Wordlift_Vocabulary_Shortcode($this->configuration_service); |
|
| 1350 | + new Async_Template_Decorator(new Wordlift_Faceted_Search_Shortcode()); |
|
| 1351 | 1351 | } |
| 1352 | 1352 | |
| 1353 | 1353 | new Wordlift_Products_Navigator_Shortcode(); |
@@ -1360,18 +1360,18 @@ discard block |
||
| 1360 | 1360 | new Wordlift_Seo_Service(); |
| 1361 | 1361 | |
| 1362 | 1362 | // Initialize the AMP service. |
| 1363 | - new Wordlift_AMP_Service( $this->jsonld_service ); |
|
| 1363 | + new Wordlift_AMP_Service($this->jsonld_service); |
|
| 1364 | 1364 | |
| 1365 | 1365 | /** Services. */ |
| 1366 | 1366 | $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
| 1367 | 1367 | new Wordlift_Image_Service(); |
| 1368 | 1368 | |
| 1369 | 1369 | /** Adapters. */ |
| 1370 | - $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
|
| 1371 | - $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service ); |
|
| 1372 | - $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 1370 | + $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter($this->entity_type_service); |
|
| 1371 | + $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter($this->publisher_service); |
|
| 1372 | + $this->tinymce_adapter = new Wordlift_Tinymce_Adapter($this); |
|
| 1373 | 1373 | //$this->faq_tinymce_adapter = new Faq_Tinymce_Adapter(); |
| 1374 | - $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
|
| 1374 | + $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter($this->relation_rebuild_service); |
|
| 1375 | 1375 | |
| 1376 | 1376 | /* |
| 1377 | 1377 | * Exclude our public js from WP-Rocket. |
@@ -1389,9 +1389,9 @@ discard block |
||
| 1389 | 1389 | ); |
| 1390 | 1390 | |
| 1391 | 1391 | $that = $this; |
| 1392 | - add_action( 'plugins_loaded', function () use ( $that ) { |
|
| 1393 | - if ( ! apply_filters( 'wl_feature__enable__dataset-ng', false ) ) { |
|
| 1394 | - new Wordlift_Linked_Data_Service( $that->entity_service, $that->entity_type_service, $that->schema_service, $that->sparql_service ); |
|
| 1392 | + add_action('plugins_loaded', function() use ($that) { |
|
| 1393 | + if ( ! apply_filters('wl_feature__enable__dataset-ng', false)) { |
|
| 1394 | + new Wordlift_Linked_Data_Service($that->entity_service, $that->entity_type_service, $that->schema_service, $that->sparql_service); |
|
| 1395 | 1395 | new Wordlift_Sparql_Query_Async_Task(); |
| 1396 | 1396 | new Wordlift_Push_References_Async_Task(); |
| 1397 | 1397 | } |
@@ -1406,14 +1406,14 @@ discard block |
||
| 1406 | 1406 | $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
| 1407 | 1407 | $this->country_select_element = new Wordlift_Admin_Country_Select_Element(); |
| 1408 | 1408 | $tabs_element = new Wordlift_Admin_Tabs_Element(); |
| 1409 | - $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element ); |
|
| 1410 | - $this->author_element = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element ); |
|
| 1409 | + $this->publisher_element = new Wordlift_Admin_Publisher_Element($this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element); |
|
| 1410 | + $this->author_element = new Wordlift_Admin_Author_Element($this->publisher_service, $this->select2_element); |
|
| 1411 | 1411 | |
| 1412 | - $this->settings_page = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->country_select_element, $this->publisher_element, $this->radio_input_element ); |
|
| 1413 | - $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 1412 | + $this->settings_page = new Wordlift_Admin_Settings_Page($this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->country_select_element, $this->publisher_element, $this->radio_input_element); |
|
| 1413 | + $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link($this->settings_page); |
|
| 1414 | 1414 | |
| 1415 | - $this->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element ); |
|
| 1416 | - $this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page ); |
|
| 1415 | + $this->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page($this->configuration_service, $this->input_element, $this->radio_input_element); |
|
| 1416 | + $this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link($this->analytics_settings_page); |
|
| 1417 | 1417 | $this->analytics_connect = new Wordlift_Analytics_Connect(); |
| 1418 | 1418 | |
| 1419 | 1419 | // Pages. |
@@ -1424,9 +1424,9 @@ discard block |
||
| 1424 | 1424 | * |
| 1425 | 1425 | * @see https://github.com/insideout10/wordlift-plugin/issues/914 |
| 1426 | 1426 | */ |
| 1427 | - if ( apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 1428 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1429 | - new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 1427 | + if (apply_filters('wl_can_see_classification_box', true)) { |
|
| 1428 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1429 | + new Wordlift_Admin_Post_Edit_Page($this); |
|
| 1430 | 1430 | } |
| 1431 | 1431 | new Wordlift_Entity_Type_Admin_Service(); |
| 1432 | 1432 | |
@@ -1440,23 +1440,23 @@ discard block |
||
| 1440 | 1440 | $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
| 1441 | 1441 | |
| 1442 | 1442 | /* WordPress Admin. */ |
| 1443 | - $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 1444 | - $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 1443 | + $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page($this->configuration_service); |
|
| 1444 | + $this->status_page = new Wordlift_Admin_Status_Page($this->entity_service, $this->sparql_service); |
|
| 1445 | 1445 | |
| 1446 | 1446 | // Create an instance of the install wizard. |
| 1447 | - $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service, $this->language_select_element, $this->country_select_element ); |
|
| 1447 | + $this->admin_setup = new Wordlift_Admin_Setup($this->configuration_service, $this->key_validation_service, $this->entity_service, $this->language_select_element, $this->country_select_element); |
|
| 1448 | 1448 | |
| 1449 | - $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1449 | + $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service($this->entity_post_type_service); |
|
| 1450 | 1450 | |
| 1451 | 1451 | // User Profile. |
| 1452 | - new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1452 | + new Wordlift_Admin_User_Profile_Page($this->author_element, $this->user_service); |
|
| 1453 | 1453 | |
| 1454 | 1454 | $this->entity_page_service = new Wordlift_Entity_Page_Service(); |
| 1455 | 1455 | |
| 1456 | 1456 | // Load the debug service if WP is in debug mode. |
| 1457 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1458 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1459 | - new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1457 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
| 1458 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-debug-service.php'; |
|
| 1459 | + new Wordlift_Debug_Service($this->entity_service, $uri_service); |
|
| 1460 | 1460 | } |
| 1461 | 1461 | |
| 1462 | 1462 | // Remote Image Service. |
@@ -1469,12 +1469,12 @@ discard block |
||
| 1469 | 1469 | * |
| 1470 | 1470 | * @see https://github.com/insideout10/wordlift-plugin/issues/852. |
| 1471 | 1471 | */ |
| 1472 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php'; |
|
| 1473 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1474 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1472 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-batch-action.php'; |
|
| 1473 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1474 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1475 | 1475 | |
| 1476 | 1476 | // Create an instance of the Mapping Service and assign it to the Ajax Adapter. |
| 1477 | - new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) ); |
|
| 1477 | + new Wordlift_Mapping_Ajax_Adapter(new Wordlift_Mapping_Service(Wordlift_Entity_Type_Service::get_instance())); |
|
| 1478 | 1478 | |
| 1479 | 1479 | /* |
| 1480 | 1480 | * Batch Operations. They're similar to Batch Actions but do not require working on post types. |
@@ -1483,8 +1483,8 @@ discard block |
||
| 1483 | 1483 | * |
| 1484 | 1484 | * @since 3.20.0 |
| 1485 | 1485 | */ |
| 1486 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1487 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1486 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1487 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1488 | 1488 | |
| 1489 | 1489 | /* |
| 1490 | 1490 | * Add the Search Keywords taxonomy to manage the Search Keywords on WLS. |
@@ -1493,8 +1493,8 @@ discard block |
||
| 1493 | 1493 | * |
| 1494 | 1494 | * @since 3.20.0 |
| 1495 | 1495 | */ |
| 1496 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php'; |
|
| 1497 | - new Wordlift_Search_Keyword_Taxonomy( $api_service ); |
|
| 1496 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php'; |
|
| 1497 | + new Wordlift_Search_Keyword_Taxonomy($api_service); |
|
| 1498 | 1498 | |
| 1499 | 1499 | /* |
| 1500 | 1500 | * Load the Mappings JSON-LD post processing. |
@@ -1508,11 +1508,11 @@ discard block |
||
| 1508 | 1508 | // Taxonomy term rule validator for validating rules for term pages. |
| 1509 | 1509 | new Taxonomy_Term_Rule_Validator(); |
| 1510 | 1510 | new Post_Taxonomy_Term_Rule_Validator(); |
| 1511 | - $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator ); |
|
| 1512 | - $rule_groups_validator = new Rule_Groups_Validator( $rule_validators_registry ); |
|
| 1513 | - $mappings_validator = new Mappings_Validator( $mappings_dbo, $rule_groups_validator ); |
|
| 1511 | + $rule_validators_registry = new Rule_Validators_Registry($default_rule_validator); |
|
| 1512 | + $rule_groups_validator = new Rule_Groups_Validator($rule_validators_registry); |
|
| 1513 | + $mappings_validator = new Mappings_Validator($mappings_dbo, $rule_groups_validator); |
|
| 1514 | 1514 | |
| 1515 | - new Url_To_Entity_Transform_Function( $this->entity_uri_service ); |
|
| 1515 | + new Url_To_Entity_Transform_Function($this->entity_uri_service); |
|
| 1516 | 1516 | new Taxonomy_To_Terms_Transform_Function(); |
| 1517 | 1517 | new Post_Id_To_Entity_Transform_Function(); |
| 1518 | 1518 | $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry(); |
@@ -1522,7 +1522,7 @@ discard block |
||
| 1522 | 1522 | * Intiailize the acf group data formatter. |
| 1523 | 1523 | */ |
| 1524 | 1524 | new Acf_Group_Formatter(); |
| 1525 | - new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry ); |
|
| 1525 | + new Jsonld_Converter($mappings_validator, $mappings_transform_functions_registry); |
|
| 1526 | 1526 | |
| 1527 | 1527 | /** |
| 1528 | 1528 | * @since 3.26.0 |
@@ -1543,7 +1543,7 @@ discard block |
||
| 1543 | 1543 | /* |
| 1544 | 1544 | * Create a singleton for the Analysis_Response_Ops_Factory. |
| 1545 | 1545 | */ |
| 1546 | - $entity_helper = new Entity_Helper( $this->entity_uri_service, $this->entity_service ); |
|
| 1546 | + $entity_helper = new Entity_Helper($this->entity_uri_service, $this->entity_service); |
|
| 1547 | 1547 | new Analysis_Response_Ops_Factory( |
| 1548 | 1548 | $this->entity_uri_service, |
| 1549 | 1549 | $this->entity_service, |
@@ -1553,11 +1553,11 @@ discard block |
||
| 1553 | 1553 | ); |
| 1554 | 1554 | |
| 1555 | 1555 | /** WL Autocomplete. */ |
| 1556 | - $autocomplete_service = new All_Autocomplete_Service( array( |
|
| 1556 | + $autocomplete_service = new All_Autocomplete_Service(array( |
|
| 1557 | 1557 | new Local_Autocomplete_Service(), |
| 1558 | - new Linked_Data_Autocomplete_Service( $this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service ), |
|
| 1559 | - ) ); |
|
| 1560 | - $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service ); |
|
| 1558 | + new Linked_Data_Autocomplete_Service($this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service), |
|
| 1559 | + )); |
|
| 1560 | + $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter($autocomplete_service); |
|
| 1561 | 1561 | |
| 1562 | 1562 | /** |
| 1563 | 1563 | * @since 3.27.2 |
@@ -1566,10 +1566,10 @@ discard block |
||
| 1566 | 1566 | */ |
| 1567 | 1567 | new Recipe_Maker_Post_Type_Hook(); |
| 1568 | 1568 | $recipe_maker_validation_service = new Recipe_Maker_Validation_Service(); |
| 1569 | - new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service ); |
|
| 1570 | - new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service ); |
|
| 1571 | - new Recipe_Maker_Warning( $recipe_maker_validation_service ); |
|
| 1572 | - new Yoast_Jsonld( $recipe_maker_validation_service ); |
|
| 1569 | + new Recipe_Maker_Jsonld_Hook($attachment_service, $recipe_maker_validation_service); |
|
| 1570 | + new Recipe_Maker_After_Get_Jsonld_Hook($recipe_maker_validation_service); |
|
| 1571 | + new Recipe_Maker_Warning($recipe_maker_validation_service); |
|
| 1572 | + new Yoast_Jsonld($recipe_maker_validation_service); |
|
| 1573 | 1573 | |
| 1574 | 1574 | /** |
| 1575 | 1575 | * @since 3.27.4 |
@@ -1580,7 +1580,7 @@ discard block |
||
| 1580 | 1580 | * @since 3.27.8 |
| 1581 | 1581 | * @see https://github.com/insideout10/wordlift-plugin/issues/1248 |
| 1582 | 1582 | */ |
| 1583 | - new Key_Validation_Notice( $this->key_validation_service, $this->configuration_service ); |
|
| 1583 | + new Key_Validation_Notice($this->key_validation_service, $this->configuration_service); |
|
| 1584 | 1584 | /** |
| 1585 | 1585 | * @since 3.28.0 |
| 1586 | 1586 | * @see https://github.com/insideout10/wordlift-plugin/issues?q=assignee%3Anaveen17797+is%3Aopen |
@@ -1591,7 +1591,7 @@ discard block |
||
| 1591 | 1591 | * @since 3.29.0 |
| 1592 | 1592 | * @see https://github.com/insideout10/wordlift-plugin/issues/1304 |
| 1593 | 1593 | */ |
| 1594 | - new Entity_Rest_Service( $this->entity_type_service ); |
|
| 1594 | + new Entity_Rest_Service($this->entity_type_service); |
|
| 1595 | 1595 | |
| 1596 | 1596 | /** |
| 1597 | 1597 | * Expand author in to references. |
@@ -1599,13 +1599,13 @@ discard block |
||
| 1599 | 1599 | * @see https://github.com/insideout10/wordlift-plugin/issues/1318 |
| 1600 | 1600 | */ |
| 1601 | 1601 | |
| 1602 | - add_action( 'plugins_loaded', function () use ( $that ) { |
|
| 1602 | + add_action('plugins_loaded', function() use ($that) { |
|
| 1603 | 1603 | |
| 1604 | - if ( apply_filters( 'wl_feature__enable__article-wrapper', false ) ) { |
|
| 1605 | - new Jsonld_Article_Wrapper( Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter ); |
|
| 1604 | + if (apply_filters('wl_feature__enable__article-wrapper', false)) { |
|
| 1605 | + new Jsonld_Article_Wrapper(Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter); |
|
| 1606 | 1606 | } |
| 1607 | 1607 | |
| 1608 | - if ( apply_filters( 'wl_feature__enable__match-terms', false ) ) { |
|
| 1608 | + if (apply_filters('wl_feature__enable__match-terms', false)) { |
|
| 1609 | 1609 | $vocabulary_loader = new Vocabulary_Loader(); |
| 1610 | 1610 | $vocabulary_loader->init_vocabulary(); |
| 1611 | 1611 | } |
@@ -1638,9 +1638,9 @@ discard block |
||
| 1638 | 1638 | private function set_locale() { |
| 1639 | 1639 | |
| 1640 | 1640 | $plugin_i18n = new Wordlift_i18n(); |
| 1641 | - $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1641 | + $plugin_i18n->set_domain($this->get_plugin_name()); |
|
| 1642 | 1642 | |
| 1643 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1643 | + $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain'); |
|
| 1644 | 1644 | |
| 1645 | 1645 | } |
| 1646 | 1646 | |
@@ -1661,29 +1661,29 @@ discard block |
||
| 1661 | 1661 | $this->user_service |
| 1662 | 1662 | ); |
| 1663 | 1663 | |
| 1664 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1665 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 ); |
|
| 1664 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles'); |
|
| 1665 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11); |
|
| 1666 | 1666 | |
| 1667 | 1667 | // Hook the init action to taxonomy services. |
| 1668 | - $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1669 | - $this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 ); |
|
| 1668 | + $this->loader->add_action('init', $this->topic_taxonomy_service, 'init', 0); |
|
| 1669 | + $this->loader->add_action('init', $this->entity_types_taxonomy_service, 'init', 0); |
|
| 1670 | 1670 | |
| 1671 | 1671 | // Hook the deleted_post_meta action to the Thumbnail service. |
| 1672 | - $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1672 | + $this->loader->add_action('deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4); |
|
| 1673 | 1673 | |
| 1674 | 1674 | // Hook the added_post_meta action to the Thumbnail service. |
| 1675 | - $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1675 | + $this->loader->add_action('added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4); |
|
| 1676 | 1676 | |
| 1677 | 1677 | // Hook the updated_post_meta action to the Thumbnail service. |
| 1678 | - $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1678 | + $this->loader->add_action('updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4); |
|
| 1679 | 1679 | |
| 1680 | 1680 | // Hook the AJAX wl_timeline action to the Timeline service. |
| 1681 | - $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1681 | + $this->loader->add_action('wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline'); |
|
| 1682 | 1682 | |
| 1683 | 1683 | // Register custom allowed redirect hosts. |
| 1684 | - $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1684 | + $this->loader->add_filter('allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts'); |
|
| 1685 | 1685 | // Hook the AJAX wordlift_redirect action to the Redirect service. |
| 1686 | - $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1686 | + $this->loader->add_action('wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect'); |
|
| 1687 | 1687 | |
| 1688 | 1688 | /* |
| 1689 | 1689 | * The old dashboard is replaced with dashboard v2. |
@@ -1701,46 +1701,46 @@ discard block |
||
| 1701 | 1701 | |
| 1702 | 1702 | // Hook save_post to the entity service to update custom fields (such as alternate labels). |
| 1703 | 1703 | // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
| 1704 | - $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1705 | - $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1704 | + $this->loader->add_action('save_post', $this->entity_service, 'save_post', 9, 3); |
|
| 1705 | + $this->loader->add_action('save_post', $this->rating_service, 'set_rating_for', 20, 1); |
|
| 1706 | 1706 | |
| 1707 | - $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1708 | - $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1707 | + $this->loader->add_action('edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1); |
|
| 1708 | + $this->loader->add_action('in_admin_header', $this->rating_service, 'in_admin_header'); |
|
| 1709 | 1709 | |
| 1710 | 1710 | // Entity listing customization (wp-admin/edit.php) |
| 1711 | 1711 | // Add custom columns. |
| 1712 | - $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1712 | + $this->loader->add_filter('manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns'); |
|
| 1713 | 1713 | // no explicit entity as it prevents handling of other post types. |
| 1714 | - $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1714 | + $this->loader->add_filter('manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2); |
|
| 1715 | 1715 | // Add 4W selection. |
| 1716 | - $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1717 | - $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1718 | - $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' ); |
|
| 1719 | - $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' ); |
|
| 1716 | + $this->loader->add_action('restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope'); |
|
| 1717 | + $this->loader->add_filter('posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope'); |
|
| 1718 | + $this->loader->add_action('pre_get_posts', $this->entity_list_service, 'pre_get_posts'); |
|
| 1719 | + $this->loader->add_action('load-edit.php', $this->entity_list_service, 'load_edit'); |
|
| 1720 | 1720 | |
| 1721 | 1721 | /* |
| 1722 | 1722 | * If `All Entity Types` is disable, use the radio button Walker. |
| 1723 | 1723 | * |
| 1724 | 1724 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1725 | 1725 | */ |
| 1726 | - if ( ! WL_ALL_ENTITY_TYPES ) { |
|
| 1727 | - $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1726 | + if ( ! WL_ALL_ENTITY_TYPES) { |
|
| 1727 | + $this->loader->add_filter('wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args'); |
|
| 1728 | 1728 | } |
| 1729 | 1729 | |
| 1730 | 1730 | // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
| 1731 | 1731 | // entities. |
| 1732 | - $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1732 | + $this->loader->add_filter('prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2); |
|
| 1733 | 1733 | |
| 1734 | 1734 | // Filter imported post meta. |
| 1735 | - $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1735 | + $this->loader->add_filter('wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3); |
|
| 1736 | 1736 | |
| 1737 | 1737 | // Notify the import service when an import starts and ends. |
| 1738 | - $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1739 | - $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1738 | + $this->loader->add_action('import_start', $this->import_service, 'import_start', 10, 0); |
|
| 1739 | + $this->loader->add_action('import_end', $this->import_service, 'import_end', 10, 0); |
|
| 1740 | 1740 | |
| 1741 | 1741 | // Hook the AJAX wl_rebuild action to the Rebuild Service. |
| 1742 | - $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1743 | - $this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' ); |
|
| 1742 | + $this->loader->add_action('wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild'); |
|
| 1743 | + $this->loader->add_action('wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild'); |
|
| 1744 | 1744 | |
| 1745 | 1745 | /** |
| 1746 | 1746 | * Filter: wl_feature__enable__settings-download. |
@@ -1750,34 +1750,34 @@ discard block |
||
| 1750 | 1750 | * @return bool |
| 1751 | 1751 | * @since 3.27.6 |
| 1752 | 1752 | */ |
| 1753 | - $this->features_registry->register_feature_from_slug( 'settings-download', true, array( |
|
| 1753 | + $this->features_registry->register_feature_from_slug('settings-download', true, array( |
|
| 1754 | 1754 | $this, |
| 1755 | 1755 | 'register_screens' |
| 1756 | - ) ); |
|
| 1756 | + )); |
|
| 1757 | 1757 | |
| 1758 | 1758 | |
| 1759 | 1759 | // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
| 1760 | - $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1760 | + $this->loader->add_action('wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10); |
|
| 1761 | 1761 | |
| 1762 | 1762 | // Hook the AJAX wl_jsonld action to the JSON-LD service. |
| 1763 | - $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1764 | - $this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1765 | - $this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1763 | + $this->loader->add_action('wp_ajax_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1764 | + $this->loader->add_action('admin_post_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1765 | + $this->loader->add_action('admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1766 | 1766 | |
| 1767 | 1767 | // Hook the AJAX wl_validate_key action to the Key Validation service. |
| 1768 | - $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1768 | + $this->loader->add_action('wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key'); |
|
| 1769 | 1769 | |
| 1770 | 1770 | // Hook the AJAX wl_update_country_options action to the countries. |
| 1771 | - $this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' ); |
|
| 1771 | + $this->loader->add_action('wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html'); |
|
| 1772 | 1772 | |
| 1773 | 1773 | // Hook the `admin_init` function to the Admin Setup. |
| 1774 | - $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1774 | + $this->loader->add_action('admin_init', $this->admin_setup, 'admin_init'); |
|
| 1775 | 1775 | |
| 1776 | 1776 | // Hook the admin_init to the settings page. |
| 1777 | - $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1778 | - $this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' ); |
|
| 1777 | + $this->loader->add_action('admin_init', $this->settings_page, 'admin_init'); |
|
| 1778 | + $this->loader->add_action('admin_init', $this->analytics_settings_page, 'admin_init'); |
|
| 1779 | 1779 | |
| 1780 | - $this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' ); |
|
| 1780 | + $this->loader->add_filter('admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction'); |
|
| 1781 | 1781 | |
| 1782 | 1782 | // Hook the menu creation on the general wordlift menu creation. |
| 1783 | 1783 | /** |
@@ -1790,18 +1790,18 @@ discard block |
||
| 1790 | 1790 | * |
| 1791 | 1791 | * Since 3.30.0 this feature is registered using registry. |
| 1792 | 1792 | */ |
| 1793 | - add_action( 'plugins_loaded', function () use ( $that ) { |
|
| 1794 | - if ( apply_filters( 'wl_feature__enable__settings-screen', true ) || Admin_User_Option::is_wordlift_admin() ) { |
|
| 1795 | - add_action( 'wl_admin_menu', array( $that->settings_page, 'admin_menu' ), 10, 2 ); |
|
| 1793 | + add_action('plugins_loaded', function() use ($that) { |
|
| 1794 | + if (apply_filters('wl_feature__enable__settings-screen', true) || Admin_User_Option::is_wordlift_admin()) { |
|
| 1795 | + add_action('wl_admin_menu', array($that->settings_page, 'admin_menu'), 10, 2); |
|
| 1796 | 1796 | } |
| 1797 | 1797 | } ); |
| 1798 | 1798 | |
| 1799 | 1799 | // Hook key update. |
| 1800 | - $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1801 | - $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1800 | + $this->loader->add_action('pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2); |
|
| 1801 | + $this->loader->add_action('update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2); |
|
| 1802 | 1802 | |
| 1803 | 1803 | // Add additional action links to the WordLift plugin in the plugins page. |
| 1804 | - $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1804 | + $this->loader->add_filter('plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1); |
|
| 1805 | 1805 | |
| 1806 | 1806 | /* |
| 1807 | 1807 | * Remove the Analytics Settings link from the plugin page. |
@@ -1812,25 +1812,25 @@ discard block |
||
| 1812 | 1812 | // $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 ); |
| 1813 | 1813 | |
| 1814 | 1814 | // Hook the AJAX `wl_publisher` action name. |
| 1815 | - $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1815 | + $this->loader->add_action('wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher'); |
|
| 1816 | 1816 | |
| 1817 | 1817 | // Hook row actions for the entity type list admin. |
| 1818 | - $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1818 | + $this->loader->add_filter('wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2); |
|
| 1819 | 1819 | |
| 1820 | 1820 | /** Ajax actions. */ |
| 1821 | - $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' ); |
|
| 1821 | + $this->loader->add_action('wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export'); |
|
| 1822 | 1822 | |
| 1823 | 1823 | // Hook capabilities manipulation to allow access to entity type admin |
| 1824 | 1824 | // page on WordPress versions before 4.7. |
| 1825 | 1825 | global $wp_version; |
| 1826 | - if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1827 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1826 | + if (version_compare($wp_version, '4.7', '<')) { |
|
| 1827 | + $this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4); |
|
| 1828 | 1828 | } |
| 1829 | 1829 | |
| 1830 | - $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1830 | + $this->loader->add_action('wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1); |
|
| 1831 | 1831 | |
| 1832 | 1832 | /** Adapters. */ |
| 1833 | - $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1833 | + $this->loader->add_filter('mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1); |
|
| 1834 | 1834 | /** |
| 1835 | 1835 | * Disabling Faq temporarily. |
| 1836 | 1836 | * Load the tinymce editor button on the tool bar. |
@@ -1841,54 +1841,54 @@ discard block |
||
| 1841 | 1841 | //$this->loader->add_filter( 'mce_external_plugins', $this->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 ); |
| 1842 | 1842 | |
| 1843 | 1843 | |
| 1844 | - $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' ); |
|
| 1845 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' ); |
|
| 1846 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' ); |
|
| 1844 | + $this->loader->add_action('wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all'); |
|
| 1845 | + $this->loader->add_action('wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create'); |
|
| 1846 | + $this->loader->add_action('wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete'); |
|
| 1847 | 1847 | /** |
| 1848 | 1848 | * @since 3.26.0 |
| 1849 | 1849 | */ |
| 1850 | 1850 | $excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter(); |
| 1851 | - $this->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' ); |
|
| 1851 | + $this->loader->add_action('do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box'); |
|
| 1852 | 1852 | // Adding Rest route for the post excerpt |
| 1853 | 1853 | Post_Excerpt_Rest_Controller::register_routes(); |
| 1854 | 1854 | |
| 1855 | - $this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 ); |
|
| 1856 | - $this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 ); |
|
| 1855 | + $this->loader->add_action('update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5); |
|
| 1856 | + $this->loader->add_action('delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5); |
|
| 1857 | 1857 | |
| 1858 | 1858 | // Handle the autocomplete request. |
| 1859 | - add_action( 'wp_ajax_wl_autocomplete', array( |
|
| 1859 | + add_action('wp_ajax_wl_autocomplete', array( |
|
| 1860 | 1860 | $this->autocomplete_adapter, |
| 1861 | 1861 | 'wl_autocomplete', |
| 1862 | - ) ); |
|
| 1863 | - add_action( 'wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1862 | + )); |
|
| 1863 | + add_action('wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1864 | 1864 | $this->autocomplete_adapter, |
| 1865 | 1865 | 'wl_autocomplete', |
| 1866 | - ) ); |
|
| 1866 | + )); |
|
| 1867 | 1867 | |
| 1868 | 1868 | // Hooks to restrict multisite super admin from manipulating entity types. |
| 1869 | - if ( is_multisite() ) { |
|
| 1870 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1869 | + if (is_multisite()) { |
|
| 1870 | + $this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4); |
|
| 1871 | 1871 | } |
| 1872 | 1872 | |
| 1873 | - $deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service ); |
|
| 1873 | + $deactivator_feedback = new Wordlift_Deactivator_Feedback($this->configuration_service); |
|
| 1874 | 1874 | |
| 1875 | - add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) ); |
|
| 1876 | - add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) ); |
|
| 1877 | - add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) ); |
|
| 1875 | + add_action('admin_footer', array($deactivator_feedback, 'render_feedback_popup')); |
|
| 1876 | + add_action('admin_enqueue_scripts', array($deactivator_feedback, 'enqueue_popup_scripts')); |
|
| 1877 | + add_action('wp_ajax_wl_deactivation_feedback', array($deactivator_feedback, 'wl_deactivation_feedback')); |
|
| 1878 | 1878 | |
| 1879 | 1879 | /** |
| 1880 | 1880 | * Always allow the `wordlift/classification` block. |
| 1881 | 1881 | * |
| 1882 | 1882 | * @since 3.23.0 |
| 1883 | 1883 | */ |
| 1884 | - add_filter( 'allowed_block_types', function ( $value ) { |
|
| 1884 | + add_filter('allowed_block_types', function($value) { |
|
| 1885 | 1885 | |
| 1886 | - if ( true === $value ) { |
|
| 1886 | + if (true === $value) { |
|
| 1887 | 1887 | return $value; |
| 1888 | 1888 | } |
| 1889 | 1889 | |
| 1890 | - return array_merge( (array) $value, array( 'wordlift/classification' ) ); |
|
| 1891 | - }, PHP_INT_MAX ); |
|
| 1890 | + return array_merge((array) $value, array('wordlift/classification')); |
|
| 1891 | + }, PHP_INT_MAX); |
|
| 1892 | 1892 | |
| 1893 | 1893 | /** |
| 1894 | 1894 | * @since 3.27.7 |
@@ -1906,58 +1906,58 @@ discard block |
||
| 1906 | 1906 | */ |
| 1907 | 1907 | private function define_public_hooks() { |
| 1908 | 1908 | |
| 1909 | - $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1909 | + $plugin_public = new Wordlift_Public($this->get_plugin_name(), $this->get_version()); |
|
| 1910 | 1910 | |
| 1911 | 1911 | // Register the entity post type. |
| 1912 | - $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1912 | + $this->loader->add_action('init', $this->entity_post_type_service, 'register'); |
|
| 1913 | 1913 | |
| 1914 | 1914 | // Bind the link generation and handling hooks to the entity link service. |
| 1915 | - $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1916 | - $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1915 | + $this->loader->add_filter('post_type_link', $this->entity_link_service, 'post_type_link', 10, 4); |
|
| 1916 | + $this->loader->add_action('pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1); |
|
| 1917 | 1917 | // $this->loader->add_filter( 'wp_unique_post_slug_is_bad_flat_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3 ); |
| 1918 | 1918 | // $this->loader->add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4 ); |
| 1919 | 1919 | |
| 1920 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1921 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1922 | - $this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' ); |
|
| 1920 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles'); |
|
| 1921 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts'); |
|
| 1922 | + $this->loader->add_action('wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts'); |
|
| 1923 | 1923 | |
| 1924 | 1924 | // Registering Faq_Content_Filter service used for removing faq question and answer tags from the html. |
| 1925 | - $this->loader->add_filter( 'the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' ); |
|
| 1925 | + $this->loader->add_filter('the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags'); |
|
| 1926 | 1926 | // Hook the content filter service to add entity links. |
| 1927 | - if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) { |
|
| 1928 | - $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1927 | + if ( ! defined('WL_DISABLE_CONTENT_FILTER') || ! WL_DISABLE_CONTENT_FILTER) { |
|
| 1928 | + $this->loader->add_filter('the_content', $this->content_filter_service, 'the_content'); |
|
| 1929 | 1929 | } |
| 1930 | 1930 | |
| 1931 | 1931 | // Hook the AJAX wl_timeline action to the Timeline service. |
| 1932 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1932 | + $this->loader->add_action('wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline'); |
|
| 1933 | 1933 | |
| 1934 | 1934 | // Hook the ShareThis service. |
| 1935 | - $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1936 | - $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1935 | + $this->loader->add_filter('the_content', $this->sharethis_service, 'the_content', 99); |
|
| 1936 | + $this->loader->add_filter('the_excerpt', $this->sharethis_service, 'the_excerpt', 99); |
|
| 1937 | 1937 | |
| 1938 | 1938 | // Hook the AJAX wl_jsonld action to the JSON-LD service. |
| 1939 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1939 | + $this->loader->add_action('wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1940 | 1940 | |
| 1941 | 1941 | // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
| 1942 | 1942 | // in order to tweak WP's `WP_Query` to include entities in queries related |
| 1943 | 1943 | // to categories. |
| 1944 | - $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1944 | + $this->loader->add_action('pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1); |
|
| 1945 | 1945 | |
| 1946 | 1946 | /* |
| 1947 | 1947 | * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service` |
| 1948 | 1948 | * in order to tweak WP's `WP_Query` to show event related entities in reverse |
| 1949 | 1949 | * order of start time. |
| 1950 | 1950 | */ |
| 1951 | - $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1951 | + $this->loader->add_action('pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1); |
|
| 1952 | 1952 | |
| 1953 | - $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1953 | + $this->loader->add_action('wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1); |
|
| 1954 | 1954 | |
| 1955 | 1955 | // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
| 1956 | - $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1956 | + $this->loader->add_action('save_post', $this->entity_type_adapter, 'save_post', 9, 3); |
|
| 1957 | 1957 | |
| 1958 | 1958 | // Analytics Script Frontend. |
| 1959 | - if ( $this->configuration_service->is_analytics_enable() ) { |
|
| 1960 | - $this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 ); |
|
| 1959 | + if ($this->configuration_service->is_analytics_enable()) { |
|
| 1960 | + $this->loader->add_action('wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10); |
|
| 1961 | 1961 | } |
| 1962 | 1962 | |
| 1963 | 1963 | } |
@@ -2010,11 +2010,11 @@ discard block |
||
| 2010 | 2010 | */ |
| 2011 | 2011 | private function load_cli_dependencies() { |
| 2012 | 2012 | |
| 2013 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php'; |
|
| 2013 | + require_once plugin_dir_path(dirname(__FILE__)).'cli/class-wordlift-push-reference-data-command.php'; |
|
| 2014 | 2014 | |
| 2015 | - $push_reference_data_command = new Wordlift_Push_Reference_Data_Command( $this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service ); |
|
| 2015 | + $push_reference_data_command = new Wordlift_Push_Reference_Data_Command($this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service); |
|
| 2016 | 2016 | |
| 2017 | - WP_CLI::add_command( 'wl references push', $push_reference_data_command ); |
|
| 2017 | + WP_CLI::add_command('wl references push', $push_reference_data_command); |
|
| 2018 | 2018 | |
| 2019 | 2019 | } |
| 2020 | 2020 | |
@@ -2039,7 +2039,7 @@ discard block |
||
| 2039 | 2039 | * @since 3.27.6 |
| 2040 | 2040 | */ |
| 2041 | 2041 | |
| 2042 | - wp_register_script( 'wl_enabled_blocks', false ); |
|
| 2042 | + wp_register_script('wl_enabled_blocks', false); |
|
| 2043 | 2043 | |
| 2044 | 2044 | $enabled_blocks = array(); |
| 2045 | 2045 | |
@@ -2047,13 +2047,13 @@ discard block |
||
| 2047 | 2047 | * Filter name: wl_feature_enable__product_navigator |
| 2048 | 2048 | * @since 3.30.0 |
| 2049 | 2049 | */ |
| 2050 | - if ( apply_filters( 'wl_feature_enable__product-navigator', true ) ) { |
|
| 2050 | + if (apply_filters('wl_feature_enable__product-navigator', true)) { |
|
| 2051 | 2051 | $enabled_blocks[] = 'wordlift/products-navigator'; |
| 2052 | 2052 | } |
| 2053 | 2053 | |
| 2054 | - if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 2054 | + if (apply_filters('wl_feature__enable__blocks', true)) { |
|
| 2055 | 2055 | // To intimate JS |
| 2056 | - $enabled_blocks = array_merge( $enabled_blocks, array( |
|
| 2056 | + $enabled_blocks = array_merge($enabled_blocks, array( |
|
| 2057 | 2057 | 'wordlift/navigator', |
| 2058 | 2058 | 'wordlift/chord', |
| 2059 | 2059 | 'wordlift/geomap', |
@@ -2061,11 +2061,11 @@ discard block |
||
| 2061 | 2061 | 'wordlift/cloud', |
| 2062 | 2062 | 'wordlift/vocabulary', |
| 2063 | 2063 | 'wordlift/faceted-search' |
| 2064 | - ) ); |
|
| 2064 | + )); |
|
| 2065 | 2065 | } |
| 2066 | 2066 | |
| 2067 | - wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks ); |
|
| 2068 | - wp_enqueue_script( 'wl_enabled_blocks' ); |
|
| 2067 | + wp_localize_script('wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks); |
|
| 2068 | + wp_enqueue_script('wl_enabled_blocks'); |
|
| 2069 | 2069 | } |
| 2070 | 2070 | |
| 2071 | 2071 | /** |
@@ -2073,11 +2073,11 @@ discard block |
||
| 2073 | 2073 | */ |
| 2074 | 2074 | public function register_screens() { |
| 2075 | 2075 | // Hook the menu to the Download Your Data page. |
| 2076 | - if ( apply_filters( 'wl_feature__enable__settings-download', true ) ) { |
|
| 2077 | - add_action( 'admin_menu', array( $this->download_your_data_page, 'admin_menu' ), 100, 0 ); |
|
| 2076 | + if (apply_filters('wl_feature__enable__settings-download', true)) { |
|
| 2077 | + add_action('admin_menu', array($this->download_your_data_page, 'admin_menu'), 100, 0); |
|
| 2078 | 2078 | } |
| 2079 | - add_action( 'admin_menu', array( $this->status_page, 'admin_menu' ), 100, 0 ); |
|
| 2080 | - add_action( 'admin_menu', array( $this->entity_type_settings_admin_page, 'admin_menu' ), 100, 0 ); |
|
| 2079 | + add_action('admin_menu', array($this->status_page, 'admin_menu'), 100, 0); |
|
| 2080 | + add_action('admin_menu', array($this->entity_type_settings_admin_page, 'admin_menu'), 100, 0); |
|
| 2081 | 2081 | |
| 2082 | 2082 | } |
| 2083 | 2083 | |
@@ -4,18 +4,18 @@ |
||
| 4 | 4 | |
| 5 | 5 | abstract class Singleton { |
| 6 | 6 | |
| 7 | - static $instances = array(); |
|
| 7 | + static $instances = array(); |
|
| 8 | 8 | |
| 9 | - protected function __construct() { |
|
| 10 | - } |
|
| 9 | + protected function __construct() { |
|
| 10 | + } |
|
| 11 | 11 | |
| 12 | - public static function get_instance() { |
|
| 13 | - $child_class_name = get_called_class(); |
|
| 14 | - if ( ! array_key_exists( $child_class_name, self::$instances ) ) { |
|
| 15 | - self::$instances[ $child_class_name ] = new $child_class_name(); |
|
| 16 | - } |
|
| 12 | + public static function get_instance() { |
|
| 13 | + $child_class_name = get_called_class(); |
|
| 14 | + if ( ! array_key_exists( $child_class_name, self::$instances ) ) { |
|
| 15 | + self::$instances[ $child_class_name ] = new $child_class_name(); |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | - return self::$instances[ $child_class_name ]; |
|
| 19 | - } |
|
| 18 | + return self::$instances[ $child_class_name ]; |
|
| 19 | + } |
|
| 20 | 20 | |
| 21 | 21 | } |
@@ -11,11 +11,11 @@ |
||
| 11 | 11 | |
| 12 | 12 | public static function get_instance() { |
| 13 | 13 | $child_class_name = get_called_class(); |
| 14 | - if ( ! array_key_exists( $child_class_name, self::$instances ) ) { |
|
| 15 | - self::$instances[ $child_class_name ] = new $child_class_name(); |
|
| 14 | + if ( ! array_key_exists($child_class_name, self::$instances)) { |
|
| 15 | + self::$instances[$child_class_name] = new $child_class_name(); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | - return self::$instances[ $child_class_name ]; |
|
| 18 | + return self::$instances[$child_class_name]; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | } |
@@ -10,43 +10,43 @@ |
||
| 10 | 10 | use Wordlift\Features\Features_Registry; |
| 11 | 11 | |
| 12 | 12 | abstract class Default_Loader implements Loader { |
| 13 | - /** |
|
| 14 | - * @var Features_Registry |
|
| 15 | - */ |
|
| 16 | - private $features_registry; |
|
| 17 | - |
|
| 18 | - /** |
|
| 19 | - * Default_Loader constructor. |
|
| 20 | - */ |
|
| 21 | - public function __construct() { |
|
| 22 | - $this->features_registry = Features_Registry::get_instance(); |
|
| 23 | - } |
|
| 24 | - |
|
| 25 | - /** |
|
| 26 | - * Initialize all the dependencies needed by the feature inside this method. |
|
| 27 | - * @return void |
|
| 28 | - */ |
|
| 29 | - public abstract function init_all_dependencies(); |
|
| 30 | - |
|
| 31 | - protected abstract function get_feature_slug(); |
|
| 32 | - |
|
| 33 | - /** |
|
| 34 | - * @return bool true if the feature wants to be enabled by default |
|
| 35 | - */ |
|
| 36 | - protected abstract function get_feature_default_value(); |
|
| 37 | - |
|
| 38 | - /** |
|
| 39 | - * Register feature to registry. |
|
| 40 | - */ |
|
| 41 | - public function init_feature() { |
|
| 42 | - |
|
| 43 | - $this->features_registry->register_feature_from_slug( |
|
| 44 | - $this->get_feature_slug(), |
|
| 45 | - $this->get_feature_default_value(), |
|
| 46 | - array( $this, 'init_all_dependencies' ) |
|
| 47 | - ); |
|
| 48 | - |
|
| 49 | - } |
|
| 13 | + /** |
|
| 14 | + * @var Features_Registry |
|
| 15 | + */ |
|
| 16 | + private $features_registry; |
|
| 17 | + |
|
| 18 | + /** |
|
| 19 | + * Default_Loader constructor. |
|
| 20 | + */ |
|
| 21 | + public function __construct() { |
|
| 22 | + $this->features_registry = Features_Registry::get_instance(); |
|
| 23 | + } |
|
| 24 | + |
|
| 25 | + /** |
|
| 26 | + * Initialize all the dependencies needed by the feature inside this method. |
|
| 27 | + * @return void |
|
| 28 | + */ |
|
| 29 | + public abstract function init_all_dependencies(); |
|
| 30 | + |
|
| 31 | + protected abstract function get_feature_slug(); |
|
| 32 | + |
|
| 33 | + /** |
|
| 34 | + * @return bool true if the feature wants to be enabled by default |
|
| 35 | + */ |
|
| 36 | + protected abstract function get_feature_default_value(); |
|
| 37 | + |
|
| 38 | + /** |
|
| 39 | + * Register feature to registry. |
|
| 40 | + */ |
|
| 41 | + public function init_feature() { |
|
| 42 | + |
|
| 43 | + $this->features_registry->register_feature_from_slug( |
|
| 44 | + $this->get_feature_slug(), |
|
| 45 | + $this->get_feature_default_value(), |
|
| 46 | + array( $this, 'init_all_dependencies' ) |
|
| 47 | + ); |
|
| 48 | + |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | } |
| 53 | 53 | \ No newline at end of file |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | $this->features_registry->register_feature_from_slug( |
| 44 | 44 | $this->get_feature_slug(), |
| 45 | 45 | $this->get_feature_default_value(), |
| 46 | - array( $this, 'init_all_dependencies' ) |
|
| 46 | + array($this, 'init_all_dependencies') |
|
| 47 | 47 | ); |
| 48 | 48 | |
| 49 | 49 | } |
@@ -8,10 +8,10 @@ |
||
| 8 | 8 | |
| 9 | 9 | interface Loader { |
| 10 | 10 | |
| 11 | - /** |
|
| 12 | - * The loader should register the feature to feature registry. |
|
| 13 | - * @return void |
|
| 14 | - */ |
|
| 15 | - public function init_feature(); |
|
| 11 | + /** |
|
| 12 | + * The loader should register the feature to feature registry. |
|
| 13 | + * @return void |
|
| 14 | + */ |
|
| 15 | + public function init_feature(); |
|
| 16 | 16 | |
| 17 | 17 | } |