@@ -41,6 +41,10 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | private $entity_uri_service; |
| 43 | 43 | |
| 44 | + /** |
|
| 45 | + * @param Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter |
|
| 46 | + * @param \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter |
|
| 47 | + */ |
|
| 44 | 48 | public function __construct( $post_to_jsonld_converter, $cached_postid_to_jsonld_converter ) { |
| 45 | 49 | |
| 46 | 50 | $this->post_to_jsonld_converter = $post_to_jsonld_converter; |
@@ -6,137 +6,137 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Jsonld_Article_Wrapper { |
| 8 | 8 | |
| 9 | - private static $article_types = array( |
|
| 10 | - 'Article', |
|
| 11 | - 'AdvertiserContentArticle', |
|
| 12 | - 'NewsArticle', |
|
| 13 | - 'AnalysisNewsArticle', |
|
| 14 | - 'AskPublicNewsArticle', |
|
| 15 | - 'BackgroundNewsArticle', |
|
| 16 | - 'OpinionNewsArticle', |
|
| 17 | - 'ReportageNewsArticle', |
|
| 18 | - 'ReviewNewsArticle', |
|
| 19 | - 'Report', |
|
| 20 | - 'SatiricalArticle', |
|
| 21 | - 'ScholarlyArticle', |
|
| 22 | - 'MedicalScholarlyArticle', |
|
| 23 | - 'SocialMediaPosting', |
|
| 24 | - 'BlogPosting', |
|
| 25 | - 'LiveBlogPosting', |
|
| 26 | - 'DiscussionForumPosting', |
|
| 27 | - 'TechArticle', |
|
| 28 | - 'APIReference' |
|
| 29 | - ); |
|
| 9 | + private static $article_types = array( |
|
| 10 | + 'Article', |
|
| 11 | + 'AdvertiserContentArticle', |
|
| 12 | + 'NewsArticle', |
|
| 13 | + 'AnalysisNewsArticle', |
|
| 14 | + 'AskPublicNewsArticle', |
|
| 15 | + 'BackgroundNewsArticle', |
|
| 16 | + 'OpinionNewsArticle', |
|
| 17 | + 'ReportageNewsArticle', |
|
| 18 | + 'ReviewNewsArticle', |
|
| 19 | + 'Report', |
|
| 20 | + 'SatiricalArticle', |
|
| 21 | + 'ScholarlyArticle', |
|
| 22 | + 'MedicalScholarlyArticle', |
|
| 23 | + 'SocialMediaPosting', |
|
| 24 | + 'BlogPosting', |
|
| 25 | + 'LiveBlogPosting', |
|
| 26 | + 'DiscussionForumPosting', |
|
| 27 | + 'TechArticle', |
|
| 28 | + 'APIReference' |
|
| 29 | + ); |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * @var Wordlift_Post_To_Jsonld_Converter |
|
| 33 | - */ |
|
| 34 | - private $post_to_jsonld_converter; |
|
| 35 | - /** |
|
| 36 | - * @var \Wordlift_Cached_Post_Converter |
|
| 37 | - */ |
|
| 38 | - private $cached_postid_to_jsonld_converter; |
|
| 39 | - /** |
|
| 40 | - * @var \Wordlift_Entity_Uri_Service |
|
| 41 | - */ |
|
| 42 | - private $entity_uri_service; |
|
| 43 | - |
|
| 44 | - public function __construct( $post_to_jsonld_converter, $cached_postid_to_jsonld_converter ) { |
|
| 45 | - |
|
| 46 | - $this->post_to_jsonld_converter = $post_to_jsonld_converter; |
|
| 47 | - |
|
| 48 | - add_filter( 'wl_after_get_jsonld', array( $this, 'after_get_jsonld' ), 10, 3 ); |
|
| 49 | - |
|
| 50 | - $this->cached_postid_to_jsonld_converter = $cached_postid_to_jsonld_converter; |
|
| 51 | - |
|
| 52 | - $this->entity_uri_service = \Wordlift_Entity_Uri_Service::get_instance(); |
|
| 53 | - } |
|
| 54 | - |
|
| 55 | - public function after_get_jsonld( $jsonld, $post_id, $context ) { |
|
| 56 | - |
|
| 57 | - |
|
| 58 | - if ( Jsonld_Context_Enum::PAGE !== $context || ! is_array( $jsonld ) || ! isset( $jsonld[0] ) |
|
| 59 | - || ! is_array( $jsonld[0] ) ) { |
|
| 60 | - return $jsonld; |
|
| 61 | - } |
|
| 62 | - |
|
| 63 | - // Copy the 1st array element |
|
| 64 | - $post_jsonld = $jsonld[0]; |
|
| 65 | - |
|
| 66 | - // Don't wrap in article if the json-ld is already about an Article (or its descendants). `@type` must be |
|
| 67 | - // in the schema.org context, i.e. `Article`, not `http://schema.org/Article`. |
|
| 68 | - if ( ! isset( $post_jsonld['@id'] ) || ! isset( $post_jsonld['@type'] ) || $this->is_article( $post_jsonld['@type'] ) ) { |
|
| 69 | - return $jsonld; |
|
| 70 | - } |
|
| 71 | - |
|
| 72 | - // Convert the post as Article. |
|
| 73 | - $article_jsonld = $this->post_to_jsonld_converter->convert( $post_id ); |
|
| 74 | - |
|
| 75 | - $article_jsonld['@id'] = $post_jsonld['@id'] . '#article'; |
|
| 76 | - // Reset the type, since by default the type assigned via the Entity Type taxonomy is used. |
|
| 77 | - $article_jsonld['@type'] = 'Article'; |
|
| 78 | - $article_jsonld['about'] = array( '@id' => $post_jsonld['@id'] ); |
|
| 79 | - |
|
| 80 | - |
|
| 81 | - // Copy over the URLs. |
|
| 82 | - if ( isset( $post_jsonld['url'] ) ) { |
|
| 83 | - $article_jsonld['url'] = $post_jsonld['url']; |
|
| 84 | - } |
|
| 85 | - |
|
| 86 | - array_unshift( $jsonld, $article_jsonld ); |
|
| 87 | - |
|
| 88 | - $author_jsonld = $this->get_author_linked_entity( $article_jsonld ); |
|
| 89 | - |
|
| 90 | - /** |
|
| 91 | - * The author entities can be present in graph for some entity types |
|
| 92 | - * for Person and Organization, so check before we add it to graph. |
|
| 93 | - * reference : https://schema.org/author |
|
| 94 | - */ |
|
| 95 | - if ( $author_jsonld && ! $this->is_author_entity_present_in_graph( $jsonld, $article_jsonld['author']['@id'] )) { |
|
| 96 | - $jsonld[] = $author_jsonld; |
|
| 97 | - } |
|
| 98 | - |
|
| 99 | - return $jsonld; |
|
| 100 | - } |
|
| 101 | - |
|
| 102 | - private function is_article( $schema_types ) { |
|
| 103 | - |
|
| 104 | - $array_intersect = array_intersect( self::$article_types, ( array ) $schema_types ); |
|
| 105 | - |
|
| 106 | - return ! empty( $array_intersect ); |
|
| 107 | - } |
|
| 108 | - |
|
| 109 | - private function get_author_linked_entity( $article_jsonld ) { |
|
| 110 | - if ( ! array_key_exists( 'author', $article_jsonld ) ) { |
|
| 111 | - return false; |
|
| 112 | - } |
|
| 31 | + /** |
|
| 32 | + * @var Wordlift_Post_To_Jsonld_Converter |
|
| 33 | + */ |
|
| 34 | + private $post_to_jsonld_converter; |
|
| 35 | + /** |
|
| 36 | + * @var \Wordlift_Cached_Post_Converter |
|
| 37 | + */ |
|
| 38 | + private $cached_postid_to_jsonld_converter; |
|
| 39 | + /** |
|
| 40 | + * @var \Wordlift_Entity_Uri_Service |
|
| 41 | + */ |
|
| 42 | + private $entity_uri_service; |
|
| 43 | + |
|
| 44 | + public function __construct( $post_to_jsonld_converter, $cached_postid_to_jsonld_converter ) { |
|
| 45 | + |
|
| 46 | + $this->post_to_jsonld_converter = $post_to_jsonld_converter; |
|
| 47 | + |
|
| 48 | + add_filter( 'wl_after_get_jsonld', array( $this, 'after_get_jsonld' ), 10, 3 ); |
|
| 49 | + |
|
| 50 | + $this->cached_postid_to_jsonld_converter = $cached_postid_to_jsonld_converter; |
|
| 51 | + |
|
| 52 | + $this->entity_uri_service = \Wordlift_Entity_Uri_Service::get_instance(); |
|
| 53 | + } |
|
| 54 | + |
|
| 55 | + public function after_get_jsonld( $jsonld, $post_id, $context ) { |
|
| 56 | + |
|
| 57 | + |
|
| 58 | + if ( Jsonld_Context_Enum::PAGE !== $context || ! is_array( $jsonld ) || ! isset( $jsonld[0] ) |
|
| 59 | + || ! is_array( $jsonld[0] ) ) { |
|
| 60 | + return $jsonld; |
|
| 61 | + } |
|
| 62 | + |
|
| 63 | + // Copy the 1st array element |
|
| 64 | + $post_jsonld = $jsonld[0]; |
|
| 65 | + |
|
| 66 | + // Don't wrap in article if the json-ld is already about an Article (or its descendants). `@type` must be |
|
| 67 | + // in the schema.org context, i.e. `Article`, not `http://schema.org/Article`. |
|
| 68 | + if ( ! isset( $post_jsonld['@id'] ) || ! isset( $post_jsonld['@type'] ) || $this->is_article( $post_jsonld['@type'] ) ) { |
|
| 69 | + return $jsonld; |
|
| 70 | + } |
|
| 71 | + |
|
| 72 | + // Convert the post as Article. |
|
| 73 | + $article_jsonld = $this->post_to_jsonld_converter->convert( $post_id ); |
|
| 74 | + |
|
| 75 | + $article_jsonld['@id'] = $post_jsonld['@id'] . '#article'; |
|
| 76 | + // Reset the type, since by default the type assigned via the Entity Type taxonomy is used. |
|
| 77 | + $article_jsonld['@type'] = 'Article'; |
|
| 78 | + $article_jsonld['about'] = array( '@id' => $post_jsonld['@id'] ); |
|
| 79 | + |
|
| 80 | + |
|
| 81 | + // Copy over the URLs. |
|
| 82 | + if ( isset( $post_jsonld['url'] ) ) { |
|
| 83 | + $article_jsonld['url'] = $post_jsonld['url']; |
|
| 84 | + } |
|
| 85 | + |
|
| 86 | + array_unshift( $jsonld, $article_jsonld ); |
|
| 87 | + |
|
| 88 | + $author_jsonld = $this->get_author_linked_entity( $article_jsonld ); |
|
| 89 | + |
|
| 90 | + /** |
|
| 91 | + * The author entities can be present in graph for some entity types |
|
| 92 | + * for Person and Organization, so check before we add it to graph. |
|
| 93 | + * reference : https://schema.org/author |
|
| 94 | + */ |
|
| 95 | + if ( $author_jsonld && ! $this->is_author_entity_present_in_graph( $jsonld, $article_jsonld['author']['@id'] )) { |
|
| 96 | + $jsonld[] = $author_jsonld; |
|
| 97 | + } |
|
| 98 | + |
|
| 99 | + return $jsonld; |
|
| 100 | + } |
|
| 101 | + |
|
| 102 | + private function is_article( $schema_types ) { |
|
| 103 | + |
|
| 104 | + $array_intersect = array_intersect( self::$article_types, ( array ) $schema_types ); |
|
| 105 | + |
|
| 106 | + return ! empty( $array_intersect ); |
|
| 107 | + } |
|
| 108 | + |
|
| 109 | + private function get_author_linked_entity( $article_jsonld ) { |
|
| 110 | + if ( ! array_key_exists( 'author', $article_jsonld ) ) { |
|
| 111 | + return false; |
|
| 112 | + } |
|
| 113 | 113 | |
| 114 | - $author = $article_jsonld['author']; |
|
| 114 | + $author = $article_jsonld['author']; |
|
| 115 | 115 | |
| 116 | - if ( count( array_keys( $author ) ) !== 1 || ! array_key_exists( '@id', $author ) ) { |
|
| 117 | - return false; |
|
| 118 | - } |
|
| 116 | + if ( count( array_keys( $author ) ) !== 1 || ! array_key_exists( '@id', $author ) ) { |
|
| 117 | + return false; |
|
| 118 | + } |
|
| 119 | 119 | |
| 120 | - $author_linked_entity_id = $author['@id']; |
|
| 120 | + $author_linked_entity_id = $author['@id']; |
|
| 121 | 121 | |
| 122 | - $author_entity_post = $this->entity_uri_service->get_entity( $author_linked_entity_id ); |
|
| 122 | + $author_entity_post = $this->entity_uri_service->get_entity( $author_linked_entity_id ); |
|
| 123 | 123 | |
| 124 | - if ( ! $author_entity_post instanceof \WP_Post ) { |
|
| 125 | - return false; |
|
| 126 | - } |
|
| 124 | + if ( ! $author_entity_post instanceof \WP_Post ) { |
|
| 125 | + return false; |
|
| 126 | + } |
|
| 127 | 127 | |
| 128 | - return $this->cached_postid_to_jsonld_converter->convert( $author_entity_post->ID ); |
|
| 128 | + return $this->cached_postid_to_jsonld_converter->convert( $author_entity_post->ID ); |
|
| 129 | 129 | |
| 130 | - } |
|
| 130 | + } |
|
| 131 | 131 | |
| 132 | - private function is_author_entity_present_in_graph( $jsonld, $author_entity_id ) { |
|
| 132 | + private function is_author_entity_present_in_graph( $jsonld, $author_entity_id ) { |
|
| 133 | 133 | |
| 134 | - foreach ( $jsonld as $item ) { |
|
| 135 | - if ( $item && array_key_exists('@id', $item ) && $item['@id'] === $author_entity_id ) { |
|
| 136 | - return true; |
|
| 137 | - } |
|
| 138 | - } |
|
| 139 | - return false; |
|
| 140 | - } |
|
| 134 | + foreach ( $jsonld as $item ) { |
|
| 135 | + if ( $item && array_key_exists('@id', $item ) && $item['@id'] === $author_entity_id ) { |
|
| 136 | + return true; |
|
| 137 | + } |
|
| 138 | + } |
|
| 139 | + return false; |
|
| 140 | + } |
|
| 141 | 141 | |
| 142 | 142 | } |
| 143 | 143 | \ No newline at end of file |
@@ -41,22 +41,22 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | private $entity_uri_service; |
| 43 | 43 | |
| 44 | - public function __construct( $post_to_jsonld_converter, $cached_postid_to_jsonld_converter ) { |
|
| 44 | + public function __construct($post_to_jsonld_converter, $cached_postid_to_jsonld_converter) { |
|
| 45 | 45 | |
| 46 | 46 | $this->post_to_jsonld_converter = $post_to_jsonld_converter; |
| 47 | 47 | |
| 48 | - add_filter( 'wl_after_get_jsonld', array( $this, 'after_get_jsonld' ), 10, 3 ); |
|
| 48 | + add_filter('wl_after_get_jsonld', array($this, 'after_get_jsonld'), 10, 3); |
|
| 49 | 49 | |
| 50 | 50 | $this->cached_postid_to_jsonld_converter = $cached_postid_to_jsonld_converter; |
| 51 | 51 | |
| 52 | 52 | $this->entity_uri_service = \Wordlift_Entity_Uri_Service::get_instance(); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - public function after_get_jsonld( $jsonld, $post_id, $context ) { |
|
| 55 | + public function after_get_jsonld($jsonld, $post_id, $context) { |
|
| 56 | 56 | |
| 57 | 57 | |
| 58 | - if ( Jsonld_Context_Enum::PAGE !== $context || ! is_array( $jsonld ) || ! isset( $jsonld[0] ) |
|
| 59 | - || ! is_array( $jsonld[0] ) ) { |
|
| 58 | + if (Jsonld_Context_Enum::PAGE !== $context || ! is_array($jsonld) || ! isset($jsonld[0]) |
|
| 59 | + || ! is_array($jsonld[0])) { |
|
| 60 | 60 | return $jsonld; |
| 61 | 61 | } |
| 62 | 62 | |
@@ -65,74 +65,74 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | // Don't wrap in article if the json-ld is already about an Article (or its descendants). `@type` must be |
| 67 | 67 | // in the schema.org context, i.e. `Article`, not `http://schema.org/Article`. |
| 68 | - if ( ! isset( $post_jsonld['@id'] ) || ! isset( $post_jsonld['@type'] ) || $this->is_article( $post_jsonld['@type'] ) ) { |
|
| 68 | + if ( ! isset($post_jsonld['@id']) || ! isset($post_jsonld['@type']) || $this->is_article($post_jsonld['@type'])) { |
|
| 69 | 69 | return $jsonld; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | // Convert the post as Article. |
| 73 | - $article_jsonld = $this->post_to_jsonld_converter->convert( $post_id ); |
|
| 73 | + $article_jsonld = $this->post_to_jsonld_converter->convert($post_id); |
|
| 74 | 74 | |
| 75 | - $article_jsonld['@id'] = $post_jsonld['@id'] . '#article'; |
|
| 75 | + $article_jsonld['@id'] = $post_jsonld['@id'].'#article'; |
|
| 76 | 76 | // Reset the type, since by default the type assigned via the Entity Type taxonomy is used. |
| 77 | 77 | $article_jsonld['@type'] = 'Article'; |
| 78 | - $article_jsonld['about'] = array( '@id' => $post_jsonld['@id'] ); |
|
| 78 | + $article_jsonld['about'] = array('@id' => $post_jsonld['@id']); |
|
| 79 | 79 | |
| 80 | 80 | |
| 81 | 81 | // Copy over the URLs. |
| 82 | - if ( isset( $post_jsonld['url'] ) ) { |
|
| 82 | + if (isset($post_jsonld['url'])) { |
|
| 83 | 83 | $article_jsonld['url'] = $post_jsonld['url']; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - array_unshift( $jsonld, $article_jsonld ); |
|
| 86 | + array_unshift($jsonld, $article_jsonld); |
|
| 87 | 87 | |
| 88 | - $author_jsonld = $this->get_author_linked_entity( $article_jsonld ); |
|
| 88 | + $author_jsonld = $this->get_author_linked_entity($article_jsonld); |
|
| 89 | 89 | |
| 90 | 90 | /** |
| 91 | 91 | * The author entities can be present in graph for some entity types |
| 92 | 92 | * for Person and Organization, so check before we add it to graph. |
| 93 | 93 | * reference : https://schema.org/author |
| 94 | 94 | */ |
| 95 | - if ( $author_jsonld && ! $this->is_author_entity_present_in_graph( $jsonld, $article_jsonld['author']['@id'] )) { |
|
| 95 | + if ($author_jsonld && ! $this->is_author_entity_present_in_graph($jsonld, $article_jsonld['author']['@id'])) { |
|
| 96 | 96 | $jsonld[] = $author_jsonld; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | return $jsonld; |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - private function is_article( $schema_types ) { |
|
| 102 | + private function is_article($schema_types) { |
|
| 103 | 103 | |
| 104 | - $array_intersect = array_intersect( self::$article_types, ( array ) $schema_types ); |
|
| 104 | + $array_intersect = array_intersect(self::$article_types, (array) $schema_types); |
|
| 105 | 105 | |
| 106 | - return ! empty( $array_intersect ); |
|
| 106 | + return ! empty($array_intersect); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - private function get_author_linked_entity( $article_jsonld ) { |
|
| 110 | - if ( ! array_key_exists( 'author', $article_jsonld ) ) { |
|
| 109 | + private function get_author_linked_entity($article_jsonld) { |
|
| 110 | + if ( ! array_key_exists('author', $article_jsonld)) { |
|
| 111 | 111 | return false; |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | $author = $article_jsonld['author']; |
| 115 | 115 | |
| 116 | - if ( count( array_keys( $author ) ) !== 1 || ! array_key_exists( '@id', $author ) ) { |
|
| 116 | + if (count(array_keys($author)) !== 1 || ! array_key_exists('@id', $author)) { |
|
| 117 | 117 | return false; |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | $author_linked_entity_id = $author['@id']; |
| 121 | 121 | |
| 122 | - $author_entity_post = $this->entity_uri_service->get_entity( $author_linked_entity_id ); |
|
| 122 | + $author_entity_post = $this->entity_uri_service->get_entity($author_linked_entity_id); |
|
| 123 | 123 | |
| 124 | - if ( ! $author_entity_post instanceof \WP_Post ) { |
|
| 124 | + if ( ! $author_entity_post instanceof \WP_Post) { |
|
| 125 | 125 | return false; |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - return $this->cached_postid_to_jsonld_converter->convert( $author_entity_post->ID ); |
|
| 128 | + return $this->cached_postid_to_jsonld_converter->convert($author_entity_post->ID); |
|
| 129 | 129 | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - private function is_author_entity_present_in_graph( $jsonld, $author_entity_id ) { |
|
| 132 | + private function is_author_entity_present_in_graph($jsonld, $author_entity_id) { |
|
| 133 | 133 | |
| 134 | - foreach ( $jsonld as $item ) { |
|
| 135 | - if ( $item && array_key_exists('@id', $item ) && $item['@id'] === $author_entity_id ) { |
|
| 134 | + foreach ($jsonld as $item) { |
|
| 135 | + if ($item && array_key_exists('@id', $item) && $item['@id'] === $author_entity_id) { |
|
| 136 | 136 | return true; |
| 137 | 137 | } |
| 138 | 138 | } |
@@ -71,1581 +71,1581 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | class Wordlift { |
| 73 | 73 | |
| 74 | - //<editor-fold desc="## FIELDS"> |
|
| 75 | - |
|
| 76 | - /** |
|
| 77 | - * The loader that's responsible for maintaining and registering all hooks that power |
|
| 78 | - * the plugin. |
|
| 79 | - * |
|
| 80 | - * @since 1.0.0 |
|
| 81 | - * @access protected |
|
| 82 | - * @var Wordlift_Loader $loader Maintains and registers all hooks for the plugin. |
|
| 83 | - */ |
|
| 84 | - protected $loader; |
|
| 85 | - |
|
| 86 | - /** |
|
| 87 | - * The unique identifier of this plugin. |
|
| 88 | - * |
|
| 89 | - * @since 1.0.0 |
|
| 90 | - * @access protected |
|
| 91 | - * @var string $plugin_name The string used to uniquely identify this plugin. |
|
| 92 | - */ |
|
| 93 | - protected $plugin_name; |
|
| 94 | - |
|
| 95 | - /** |
|
| 96 | - * The current version of the plugin. |
|
| 97 | - * |
|
| 98 | - * @since 1.0.0 |
|
| 99 | - * @access protected |
|
| 100 | - * @var string $version The current version of the plugin. |
|
| 101 | - */ |
|
| 102 | - protected $version; |
|
| 103 | - |
|
| 104 | - /** |
|
| 105 | - * The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 106 | - * |
|
| 107 | - * @since 3.12.0 |
|
| 108 | - * @access protected |
|
| 109 | - * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 110 | - */ |
|
| 111 | - protected $tinymce_adapter; |
|
| 112 | - |
|
| 113 | - /** |
|
| 114 | - * The {@link Faq_Tinymce_Adapter} instance |
|
| 115 | - * @since 3.26.0 |
|
| 116 | - * @access protected |
|
| 117 | - * @var Faq_Tinymce_Adapter $faq_tinymce_adapter . |
|
| 118 | - */ |
|
| 119 | - //protected $faq_tinymce_adapter; |
|
| 120 | - |
|
| 121 | - /** |
|
| 122 | - * The Thumbnail service. |
|
| 123 | - * |
|
| 124 | - * @since 3.1.5 |
|
| 125 | - * @access private |
|
| 126 | - * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service. |
|
| 127 | - */ |
|
| 128 | - private $thumbnail_service; |
|
| 129 | - |
|
| 130 | - /** |
|
| 131 | - * The UI service. |
|
| 132 | - * |
|
| 133 | - * @since 3.2.0 |
|
| 134 | - * @access private |
|
| 135 | - * @var \Wordlift_UI_Service $ui_service The UI service. |
|
| 136 | - */ |
|
| 137 | - private $ui_service; |
|
| 138 | - |
|
| 139 | - /** |
|
| 140 | - * The Schema service. |
|
| 141 | - * |
|
| 142 | - * @since 3.3.0 |
|
| 143 | - * @access protected |
|
| 144 | - * @var \Wordlift_Schema_Service $schema_service The Schema service. |
|
| 145 | - */ |
|
| 146 | - protected $schema_service; |
|
| 147 | - |
|
| 148 | - /** |
|
| 149 | - * The Entity service. |
|
| 150 | - * |
|
| 151 | - * @since 3.1.0 |
|
| 152 | - * @access protected |
|
| 153 | - * @var \Wordlift_Entity_Service $entity_service The Entity service. |
|
| 154 | - */ |
|
| 155 | - protected $entity_service; |
|
| 156 | - |
|
| 157 | - /** |
|
| 158 | - * The Topic Taxonomy service. |
|
| 159 | - * |
|
| 160 | - * @since 3.5.0 |
|
| 161 | - * @access private |
|
| 162 | - * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service. |
|
| 163 | - */ |
|
| 164 | - private $topic_taxonomy_service; |
|
| 165 | - |
|
| 166 | - /** |
|
| 167 | - * The Entity Types Taxonomy service. |
|
| 168 | - * |
|
| 169 | - * @since 3.18.0 |
|
| 170 | - * @access private |
|
| 171 | - * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service. |
|
| 172 | - */ |
|
| 173 | - private $entity_types_taxonomy_service; |
|
| 174 | - |
|
| 175 | - /** |
|
| 176 | - * The User service. |
|
| 177 | - * |
|
| 178 | - * @since 3.1.7 |
|
| 179 | - * @access protected |
|
| 180 | - * @var \Wordlift_User_Service $user_service The User service. |
|
| 181 | - */ |
|
| 182 | - protected $user_service; |
|
| 183 | - |
|
| 184 | - /** |
|
| 185 | - * The Timeline service. |
|
| 186 | - * |
|
| 187 | - * @since 3.1.0 |
|
| 188 | - * @access private |
|
| 189 | - * @var \Wordlift_Timeline_Service $timeline_service The Timeline service. |
|
| 190 | - */ |
|
| 191 | - private $timeline_service; |
|
| 192 | - |
|
| 193 | - /** |
|
| 194 | - * The Redirect service. |
|
| 195 | - * |
|
| 196 | - * @since 3.2.0 |
|
| 197 | - * @access private |
|
| 198 | - * @var \Wordlift_Redirect_Service $redirect_service The Redirect service. |
|
| 199 | - */ |
|
| 200 | - private $redirect_service; |
|
| 201 | - |
|
| 202 | - /** |
|
| 203 | - * The Notice service. |
|
| 204 | - * |
|
| 205 | - * @since 3.3.0 |
|
| 206 | - * @access private |
|
| 207 | - * @var \Wordlift_Notice_Service $notice_service The Notice service. |
|
| 208 | - */ |
|
| 209 | - private $notice_service; |
|
| 210 | - |
|
| 211 | - /** |
|
| 212 | - * The Entity list customization. |
|
| 213 | - * |
|
| 214 | - * @since 3.3.0 |
|
| 215 | - * @access protected |
|
| 216 | - * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service. |
|
| 217 | - */ |
|
| 218 | - protected $entity_list_service; |
|
| 219 | - |
|
| 220 | - /** |
|
| 221 | - * The Entity Types Taxonomy Walker. |
|
| 222 | - * |
|
| 223 | - * @since 3.1.0 |
|
| 224 | - * @access private |
|
| 225 | - * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker |
|
| 226 | - */ |
|
| 227 | - private $entity_types_taxonomy_walker; |
|
| 228 | - |
|
| 229 | - /** |
|
| 230 | - * The ShareThis service. |
|
| 231 | - * |
|
| 232 | - * @since 3.2.0 |
|
| 233 | - * @access private |
|
| 234 | - * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service. |
|
| 235 | - */ |
|
| 236 | - private $sharethis_service; |
|
| 237 | - |
|
| 238 | - /** |
|
| 239 | - * The PrimaShop adapter. |
|
| 240 | - * |
|
| 241 | - * @since 3.2.3 |
|
| 242 | - * @access private |
|
| 243 | - * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter. |
|
| 244 | - */ |
|
| 245 | - private $primashop_adapter; |
|
| 246 | - |
|
| 247 | - /** |
|
| 248 | - * The WordLift Dashboard adapter. |
|
| 249 | - * |
|
| 250 | - * @since 3.4.0 |
|
| 251 | - * @access private |
|
| 252 | - * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service; |
|
| 253 | - */ |
|
| 254 | - private $dashboard_service; |
|
| 255 | - |
|
| 256 | - /** |
|
| 257 | - * The entity type service. |
|
| 258 | - * |
|
| 259 | - * @since 3.6.0 |
|
| 260 | - * @access private |
|
| 261 | - * @var \Wordlift_Entity_Post_Type_Service |
|
| 262 | - */ |
|
| 263 | - private $entity_post_type_service; |
|
| 264 | - |
|
| 265 | - /** |
|
| 266 | - * The entity link service used to mangle links to entities with a custom slug or even w/o a slug. |
|
| 267 | - * |
|
| 268 | - * @since 3.6.0 |
|
| 269 | - * @access private |
|
| 270 | - * @var \Wordlift_Entity_Link_Service $entity_link_service The {@link Wordlift_Entity_Link_Service} instance. |
|
| 271 | - */ |
|
| 272 | - private $entity_link_service; |
|
| 273 | - |
|
| 274 | - /** |
|
| 275 | - * A {@link Wordlift_Sparql_Service} instance. |
|
| 276 | - * |
|
| 277 | - * @since 3.6.0 |
|
| 278 | - * @access protected |
|
| 279 | - * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance. |
|
| 280 | - */ |
|
| 281 | - protected $sparql_service; |
|
| 282 | - |
|
| 283 | - /** |
|
| 284 | - * A {@link Wordlift_Import_Service} instance. |
|
| 285 | - * |
|
| 286 | - * @since 3.6.0 |
|
| 287 | - * @access private |
|
| 288 | - * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance. |
|
| 289 | - */ |
|
| 290 | - private $import_service; |
|
| 291 | - |
|
| 292 | - /** |
|
| 293 | - * A {@link Wordlift_Rebuild_Service} instance. |
|
| 294 | - * |
|
| 295 | - * @since 3.6.0 |
|
| 296 | - * @access private |
|
| 297 | - * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance. |
|
| 298 | - */ |
|
| 299 | - private $rebuild_service; |
|
| 300 | - |
|
| 301 | - /** |
|
| 302 | - * A {@link Wordlift_Jsonld_Service} instance. |
|
| 303 | - * |
|
| 304 | - * @since 3.7.0 |
|
| 305 | - * @access protected |
|
| 306 | - * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance. |
|
| 307 | - */ |
|
| 308 | - protected $jsonld_service; |
|
| 309 | - |
|
| 310 | - /** |
|
| 311 | - * A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 312 | - * |
|
| 313 | - * @since 3.14.0 |
|
| 314 | - * @access protected |
|
| 315 | - * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 316 | - */ |
|
| 317 | - protected $jsonld_website_converter; |
|
| 318 | - |
|
| 319 | - /** |
|
| 320 | - * A {@link Wordlift_Property_Factory} instance. |
|
| 321 | - * |
|
| 322 | - * @since 3.7.0 |
|
| 323 | - * @access private |
|
| 324 | - * @var \Wordlift_Property_Factory $property_factory |
|
| 325 | - */ |
|
| 326 | - private $property_factory; |
|
| 327 | - |
|
| 328 | - /** |
|
| 329 | - * The 'Download Your Data' page. |
|
| 330 | - * |
|
| 331 | - * @since 3.6.0 |
|
| 332 | - * @access private |
|
| 333 | - * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page. |
|
| 334 | - */ |
|
| 335 | - private $download_your_data_page; |
|
| 336 | - |
|
| 337 | - /** |
|
| 338 | - * The 'WordLift Settings' page. |
|
| 339 | - * |
|
| 340 | - * @since 3.11.0 |
|
| 341 | - * @access protected |
|
| 342 | - * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page. |
|
| 343 | - */ |
|
| 344 | - protected $settings_page; |
|
| 345 | - |
|
| 346 | - /** |
|
| 347 | - * The install wizard page. |
|
| 348 | - * |
|
| 349 | - * @since 3.9.0 |
|
| 350 | - * @access private |
|
| 351 | - * @var \Wordlift_Admin_Setup $admin_setup The Install wizard. |
|
| 352 | - */ |
|
| 353 | - public $admin_setup; |
|
| 354 | - |
|
| 355 | - /** |
|
| 356 | - * The Content Filter Service hooks up to the 'the_content' filter and provides |
|
| 357 | - * linking of entities to their pages. |
|
| 358 | - * |
|
| 359 | - * @since 3.8.0 |
|
| 360 | - * @access private |
|
| 361 | - * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance. |
|
| 362 | - */ |
|
| 363 | - private $content_filter_service; |
|
| 364 | - |
|
| 365 | - /** |
|
| 366 | - * The Faq Content filter service |
|
| 367 | - * @since 3.26.0 |
|
| 368 | - * @access private |
|
| 369 | - * @var Faq_Content_Filter $faq_content_filter_service A {@link Faq_Content_Filter} instance. |
|
| 370 | - */ |
|
| 371 | - private $faq_content_filter_service; |
|
| 372 | - |
|
| 373 | - /** |
|
| 374 | - * A {@link Wordlift_Key_Validation_Service} instance. |
|
| 375 | - * |
|
| 376 | - * @since 3.9.0 |
|
| 377 | - * @access private |
|
| 378 | - * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance. |
|
| 379 | - */ |
|
| 380 | - private $key_validation_service; |
|
| 381 | - |
|
| 382 | - /** |
|
| 383 | - * A {@link Wordlift_Rating_Service} instance. |
|
| 384 | - * |
|
| 385 | - * @since 3.10.0 |
|
| 386 | - * @access private |
|
| 387 | - * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance. |
|
| 388 | - */ |
|
| 389 | - private $rating_service; |
|
| 390 | - |
|
| 391 | - /** |
|
| 392 | - * A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 393 | - * |
|
| 394 | - * @since 3.10.0 |
|
| 395 | - * @access protected |
|
| 396 | - * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 397 | - */ |
|
| 398 | - protected $post_to_jsonld_converter; |
|
| 399 | - |
|
| 400 | - /** |
|
| 401 | - * A {@link Wordlift_Configuration_Service} instance. |
|
| 402 | - * |
|
| 403 | - * @since 3.10.0 |
|
| 404 | - * @access protected |
|
| 405 | - * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance. |
|
| 406 | - */ |
|
| 407 | - protected $configuration_service; |
|
| 408 | - |
|
| 409 | - /** |
|
| 410 | - * A {@link Wordlift_Install_Service} instance. |
|
| 411 | - * |
|
| 412 | - * @since 3.18.0 |
|
| 413 | - * @access protected |
|
| 414 | - * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance. |
|
| 415 | - */ |
|
| 416 | - protected $install_service; |
|
| 417 | - |
|
| 418 | - /** |
|
| 419 | - * A {@link Wordlift_Entity_Type_Service} instance. |
|
| 420 | - * |
|
| 421 | - * @since 3.10.0 |
|
| 422 | - * @access protected |
|
| 423 | - * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance. |
|
| 424 | - */ |
|
| 425 | - protected $entity_type_service; |
|
| 426 | - |
|
| 427 | - /** |
|
| 428 | - * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 429 | - * |
|
| 430 | - * @since 3.10.0 |
|
| 431 | - * @access protected |
|
| 432 | - * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 433 | - */ |
|
| 434 | - protected $entity_post_to_jsonld_converter; |
|
| 435 | - |
|
| 436 | - /** |
|
| 437 | - * A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 438 | - * |
|
| 439 | - * @since 3.10.0 |
|
| 440 | - * @access protected |
|
| 441 | - * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 442 | - */ |
|
| 443 | - protected $postid_to_jsonld_converter; |
|
| 444 | - |
|
| 445 | - /** |
|
| 446 | - * The {@link Wordlift_Admin_Status_Page} class. |
|
| 447 | - * |
|
| 448 | - * @since 3.9.8 |
|
| 449 | - * @access private |
|
| 450 | - * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class. |
|
| 451 | - */ |
|
| 452 | - private $status_page; |
|
| 453 | - |
|
| 454 | - /** |
|
| 455 | - * The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 456 | - * |
|
| 457 | - * @since 3.11.0 |
|
| 458 | - * @access protected |
|
| 459 | - * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 460 | - */ |
|
| 461 | - protected $category_taxonomy_service; |
|
| 462 | - |
|
| 463 | - /** |
|
| 464 | - * The {@link Wordlift_Entity_Page_Service} instance. |
|
| 465 | - * |
|
| 466 | - * @since 3.11.0 |
|
| 467 | - * @access protected |
|
| 468 | - * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance. |
|
| 469 | - */ |
|
| 470 | - protected $entity_page_service; |
|
| 471 | - |
|
| 472 | - /** |
|
| 473 | - * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 474 | - * |
|
| 475 | - * @since 3.11.0 |
|
| 476 | - * @access protected |
|
| 477 | - * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 478 | - */ |
|
| 479 | - protected $settings_page_action_link; |
|
| 480 | - |
|
| 481 | - /** |
|
| 482 | - * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 483 | - * |
|
| 484 | - * @since 3.11.0 |
|
| 485 | - * @access protected |
|
| 486 | - * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 487 | - */ |
|
| 488 | - protected $analytics_settings_page_action_link; |
|
| 489 | - |
|
| 490 | - /** |
|
| 491 | - * The {@link Wordlift_Analytics_Connect} class. |
|
| 492 | - * |
|
| 493 | - * @since 3.11.0 |
|
| 494 | - * @access protected |
|
| 495 | - * @var \Wordlift_Analytics_Connect $analytics_connect The {@link Wordlift_Analytics_Connect} class. |
|
| 496 | - */ |
|
| 497 | - protected $analytics_connect; |
|
| 498 | - |
|
| 499 | - /** |
|
| 500 | - * The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 501 | - * |
|
| 502 | - * @since 3.11.0 |
|
| 503 | - * @access protected |
|
| 504 | - * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 505 | - */ |
|
| 506 | - protected $publisher_ajax_adapter; |
|
| 507 | - |
|
| 508 | - /** |
|
| 509 | - * The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 510 | - * |
|
| 511 | - * @since 3.11.0 |
|
| 512 | - * @access protected |
|
| 513 | - * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 514 | - */ |
|
| 515 | - protected $input_element; |
|
| 516 | - |
|
| 517 | - /** |
|
| 518 | - * The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 519 | - * |
|
| 520 | - * @since 3.13.0 |
|
| 521 | - * @access protected |
|
| 522 | - * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 523 | - */ |
|
| 524 | - protected $radio_input_element; |
|
| 525 | - |
|
| 526 | - /** |
|
| 527 | - * The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 528 | - * |
|
| 529 | - * @since 3.11.0 |
|
| 530 | - * @access protected |
|
| 531 | - * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 532 | - */ |
|
| 533 | - protected $language_select_element; |
|
| 534 | - |
|
| 535 | - /** |
|
| 536 | - * The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
| 537 | - * |
|
| 538 | - * @since 3.18.0 |
|
| 539 | - * @access protected |
|
| 540 | - * @var \Wordlift_Admin_Country_Select_Element $country_select_element The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
| 541 | - */ |
|
| 542 | - protected $country_select_element; |
|
| 543 | - |
|
| 544 | - /** |
|
| 545 | - * The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 546 | - * |
|
| 547 | - * @since 3.11.0 |
|
| 548 | - * @access protected |
|
| 549 | - * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 550 | - */ |
|
| 551 | - protected $publisher_element; |
|
| 552 | - |
|
| 553 | - /** |
|
| 554 | - * The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 555 | - * |
|
| 556 | - * @since 3.11.0 |
|
| 557 | - * @access protected |
|
| 558 | - * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 559 | - */ |
|
| 560 | - protected $select2_element; |
|
| 561 | - |
|
| 562 | - /** |
|
| 563 | - * The controller for the entity type list admin page |
|
| 564 | - * |
|
| 565 | - * @since 3.11.0 |
|
| 566 | - * @access private |
|
| 567 | - * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class. |
|
| 568 | - */ |
|
| 569 | - private $entity_type_admin_page; |
|
| 570 | - |
|
| 571 | - /** |
|
| 572 | - * The controller for the entity type settings admin page |
|
| 573 | - * |
|
| 574 | - * @since 3.11.0 |
|
| 575 | - * @access private |
|
| 576 | - * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class. |
|
| 577 | - */ |
|
| 578 | - private $entity_type_settings_admin_page; |
|
| 579 | - |
|
| 580 | - /** |
|
| 581 | - * The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 582 | - * |
|
| 583 | - * @since 3.11.0 |
|
| 584 | - * @access protected |
|
| 585 | - * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 586 | - */ |
|
| 587 | - protected $related_entities_cloud_widget; |
|
| 588 | - |
|
| 589 | - /** |
|
| 590 | - * The {@link Wordlift_Admin_Author_Element} instance. |
|
| 591 | - * |
|
| 592 | - * @since 3.14.0 |
|
| 593 | - * @access protected |
|
| 594 | - * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance. |
|
| 595 | - */ |
|
| 596 | - protected $author_element; |
|
| 597 | - |
|
| 598 | - /** |
|
| 599 | - * The {@link Wordlift_Sample_Data_Service} instance. |
|
| 600 | - * |
|
| 601 | - * @since 3.12.0 |
|
| 602 | - * @access protected |
|
| 603 | - * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance. |
|
| 604 | - */ |
|
| 605 | - protected $sample_data_service; |
|
| 606 | - |
|
| 607 | - /** |
|
| 608 | - * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 609 | - * |
|
| 610 | - * @since 3.12.0 |
|
| 611 | - * @access protected |
|
| 612 | - * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 613 | - */ |
|
| 614 | - protected $sample_data_ajax_adapter; |
|
| 615 | - |
|
| 616 | - /** |
|
| 617 | - * The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 618 | - * |
|
| 619 | - * @since 3.14.3 |
|
| 620 | - * @access private |
|
| 621 | - * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 622 | - */ |
|
| 623 | - private $relation_rebuild_service; |
|
| 624 | - |
|
| 625 | - /** |
|
| 626 | - * The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 627 | - * |
|
| 628 | - * @since 3.14.3 |
|
| 629 | - * @access private |
|
| 630 | - * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 631 | - */ |
|
| 632 | - private $relation_rebuild_adapter; |
|
| 633 | - |
|
| 634 | - /** |
|
| 635 | - * The {@link Wordlift_Reference_Rebuild_Service} instance. |
|
| 636 | - * |
|
| 637 | - * @since 3.18.0 |
|
| 638 | - * @access private |
|
| 639 | - * @var \Wordlift_Reference_Rebuild_Service $reference_rebuild_service The {@link Wordlift_Reference_Rebuild_Service} instance. |
|
| 640 | - */ |
|
| 641 | - private $reference_rebuild_service; |
|
| 642 | - |
|
| 643 | - /** |
|
| 644 | - * The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 645 | - * |
|
| 646 | - * @since 3.16.0 |
|
| 647 | - * @access protected |
|
| 648 | - * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 649 | - */ |
|
| 650 | - protected $google_analytics_export_service; |
|
| 651 | - |
|
| 652 | - /** |
|
| 653 | - * {@link Wordlift}'s singleton instance. |
|
| 654 | - * |
|
| 655 | - * @since 3.15.0 |
|
| 656 | - * @access protected |
|
| 657 | - * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance. |
|
| 658 | - */ |
|
| 659 | - protected $entity_type_adapter; |
|
| 660 | - |
|
| 661 | - /** |
|
| 662 | - * The {@link Wordlift_Storage_Factory} instance. |
|
| 663 | - * |
|
| 664 | - * @since 3.15.0 |
|
| 665 | - * @access protected |
|
| 666 | - * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance. |
|
| 667 | - */ |
|
| 668 | - protected $storage_factory; |
|
| 669 | - |
|
| 670 | - /** |
|
| 671 | - * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 672 | - * |
|
| 673 | - * @since 3.15.0 |
|
| 674 | - * @access protected |
|
| 675 | - * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 676 | - */ |
|
| 677 | - protected $rendition_factory; |
|
| 678 | - |
|
| 679 | - /** |
|
| 680 | - * The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 681 | - * |
|
| 682 | - * @since 3.15.0 |
|
| 683 | - * @access private |
|
| 684 | - * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 685 | - */ |
|
| 686 | - private $autocomplete_adapter; |
|
| 687 | - |
|
| 688 | - /** |
|
| 689 | - * The {@link Wordlift_Relation_Service} instance. |
|
| 690 | - * |
|
| 691 | - * @since 3.15.0 |
|
| 692 | - * @access protected |
|
| 693 | - * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance. |
|
| 694 | - */ |
|
| 695 | - protected $relation_service; |
|
| 696 | - |
|
| 697 | - /** |
|
| 698 | - * The {@link Wordlift_Cached_Post_Converter} instance. |
|
| 699 | - * |
|
| 700 | - * @since 3.16.0 |
|
| 701 | - * @access protected |
|
| 702 | - * @var \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance. |
|
| 703 | - * |
|
| 704 | - */ |
|
| 705 | - protected $cached_postid_to_jsonld_converter; |
|
| 706 | - |
|
| 707 | - /** |
|
| 708 | - * The {@link Wordlift_Entity_Uri_Service} instance. |
|
| 709 | - * |
|
| 710 | - * @since 3.16.3 |
|
| 711 | - * @access protected |
|
| 712 | - * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance. |
|
| 713 | - */ |
|
| 714 | - protected $entity_uri_service; |
|
| 715 | - |
|
| 716 | - /** |
|
| 717 | - * The {@link Wordlift_Publisher_Service} instance. |
|
| 718 | - * |
|
| 719 | - * @since 3.19.0 |
|
| 720 | - * @access protected |
|
| 721 | - * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance. |
|
| 722 | - */ |
|
| 723 | - protected $publisher_service; |
|
| 724 | - |
|
| 725 | - /** |
|
| 726 | - * The {@link Wordlift_Context_Cards_Service} instance. |
|
| 727 | - * |
|
| 728 | - * @var \Wordlift_Context_Cards_Service The {@link Wordlift_Context_Cards_Service} instance. |
|
| 729 | - */ |
|
| 730 | - protected $context_cards_service; |
|
| 731 | - |
|
| 732 | - /** |
|
| 733 | - * {@link Wordlift}'s singleton instance. |
|
| 734 | - * |
|
| 735 | - * @since 3.11.2 |
|
| 736 | - * @access private |
|
| 737 | - * @var Wordlift $instance {@link Wordlift}'s singleton instance. |
|
| 738 | - */ |
|
| 739 | - private static $instance; |
|
| 740 | - |
|
| 741 | - //</editor-fold> |
|
| 742 | - |
|
| 743 | - /** |
|
| 744 | - * Define the core functionality of the plugin. |
|
| 745 | - * |
|
| 746 | - * Set the plugin name and the plugin version that can be used throughout the plugin. |
|
| 747 | - * Load the dependencies, define the locale, and set the hooks for the admin area and |
|
| 748 | - * the public-facing side of the site. |
|
| 749 | - * |
|
| 750 | - * @since 1.0.0 |
|
| 751 | - */ |
|
| 752 | - public function __construct() { |
|
| 753 | - |
|
| 754 | - self::$instance = $this; |
|
| 755 | - |
|
| 756 | - $this->plugin_name = 'wordlift'; |
|
| 757 | - $this->version = '3.29.0'; |
|
| 758 | - $this->load_dependencies(); |
|
| 759 | - $this->set_locale(); |
|
| 760 | - $this->define_admin_hooks(); |
|
| 761 | - $this->define_public_hooks(); |
|
| 762 | - |
|
| 763 | - // If we're in `WP_CLI` load the related files. |
|
| 764 | - if ( class_exists( 'WP_CLI' ) ) { |
|
| 765 | - $this->load_cli_dependencies(); |
|
| 766 | - } |
|
| 767 | - |
|
| 768 | - } |
|
| 769 | - |
|
| 770 | - /** |
|
| 771 | - * Get the singleton instance. |
|
| 772 | - * |
|
| 773 | - * @return Wordlift The {@link Wordlift} singleton instance. |
|
| 774 | - * @since 3.11.2 |
|
| 775 | - * |
|
| 776 | - */ |
|
| 777 | - public static function get_instance() { |
|
| 778 | - |
|
| 779 | - return self::$instance; |
|
| 780 | - } |
|
| 781 | - |
|
| 782 | - /** |
|
| 783 | - * Load the required dependencies for this plugin. |
|
| 784 | - * |
|
| 785 | - * Include the following files that make up the plugin: |
|
| 786 | - * |
|
| 787 | - * - Wordlift_Loader. Orchestrates the hooks of the plugin. |
|
| 788 | - * - Wordlift_i18n. Defines internationalization functionality. |
|
| 789 | - * - Wordlift_Admin. Defines all hooks for the admin area. |
|
| 790 | - * - Wordlift_Public. Defines all hooks for the public side of the site. |
|
| 791 | - * |
|
| 792 | - * Create an instance of the loader which will be used to register the hooks |
|
| 793 | - * with WordPress. |
|
| 794 | - * |
|
| 795 | - * @throws Exception |
|
| 796 | - * @since 1.0.0 |
|
| 797 | - * @access private |
|
| 798 | - */ |
|
| 799 | - private function load_dependencies() { |
|
| 800 | - |
|
| 801 | - /** |
|
| 802 | - * The class responsible for orchestrating the actions and filters of the |
|
| 803 | - * core plugin. |
|
| 804 | - */ |
|
| 805 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 806 | - |
|
| 807 | - // The class responsible for plugin uninstall. |
|
| 808 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
|
| 809 | - |
|
| 810 | - /** |
|
| 811 | - * The class responsible for defining internationalization functionality |
|
| 812 | - * of the plugin. |
|
| 813 | - */ |
|
| 814 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 815 | - |
|
| 816 | - /** |
|
| 817 | - * WordLift's supported languages. |
|
| 818 | - */ |
|
| 819 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 820 | - |
|
| 821 | - /** |
|
| 822 | - * WordLift's supported countries. |
|
| 823 | - */ |
|
| 824 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php'; |
|
| 825 | - |
|
| 826 | - /** |
|
| 827 | - * Provide support functions to sanitize data. |
|
| 828 | - */ |
|
| 829 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 830 | - |
|
| 831 | - /** Services. */ |
|
| 832 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 833 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
|
| 834 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 835 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 836 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 837 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 838 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 839 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
|
| 840 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 841 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php'; |
|
| 842 | - |
|
| 843 | - /** |
|
| 844 | - * The Query builder. |
|
| 845 | - */ |
|
| 846 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 847 | - |
|
| 848 | - /** |
|
| 849 | - * The Schema service. |
|
| 850 | - */ |
|
| 851 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 852 | - |
|
| 853 | - /** |
|
| 854 | - * The schema:url property service. |
|
| 855 | - */ |
|
| 856 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 857 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 858 | - |
|
| 859 | - /** |
|
| 860 | - * The UI service. |
|
| 861 | - */ |
|
| 862 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 863 | - |
|
| 864 | - /** |
|
| 865 | - * The Thumbnail service. |
|
| 866 | - */ |
|
| 867 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 868 | - |
|
| 869 | - /** |
|
| 870 | - * The Entity Types Taxonomy service. |
|
| 871 | - */ |
|
| 872 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 873 | - |
|
| 874 | - /** |
|
| 875 | - * The Entity service. |
|
| 876 | - */ |
|
| 877 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
|
| 878 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 879 | - |
|
| 880 | - // Add the entity rating service. |
|
| 881 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 882 | - |
|
| 883 | - /** |
|
| 884 | - * The User service. |
|
| 885 | - */ |
|
| 886 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 887 | - |
|
| 888 | - /** |
|
| 889 | - * The Timeline service. |
|
| 890 | - */ |
|
| 891 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 892 | - |
|
| 893 | - /** |
|
| 894 | - * The Topic Taxonomy service. |
|
| 895 | - */ |
|
| 896 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 897 | - |
|
| 898 | - /** |
|
| 899 | - * The SPARQL service. |
|
| 900 | - */ |
|
| 901 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 902 | - |
|
| 903 | - /** |
|
| 904 | - * The WordLift import service. |
|
| 905 | - */ |
|
| 906 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 907 | - |
|
| 908 | - /** |
|
| 909 | - * The WordLift URI service. |
|
| 910 | - */ |
|
| 911 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 912 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 913 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 914 | - |
|
| 915 | - /** |
|
| 916 | - * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
|
| 917 | - */ |
|
| 918 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php'; |
|
| 919 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php'; |
|
| 920 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php'; |
|
| 921 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php'; |
|
| 922 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php'; |
|
| 923 | - |
|
| 924 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 925 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 926 | - |
|
| 927 | - /** |
|
| 928 | - * Load the converters. |
|
| 929 | - */ |
|
| 930 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 931 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 932 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 933 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 934 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 935 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 936 | - |
|
| 937 | - /** |
|
| 938 | - * Load cache-related files. |
|
| 939 | - */ |
|
| 940 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
|
| 941 | - |
|
| 942 | - /** |
|
| 943 | - * Load the content filter. |
|
| 944 | - */ |
|
| 945 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 946 | - |
|
| 947 | - /* |
|
| 74 | + //<editor-fold desc="## FIELDS"> |
|
| 75 | + |
|
| 76 | + /** |
|
| 77 | + * The loader that's responsible for maintaining and registering all hooks that power |
|
| 78 | + * the plugin. |
|
| 79 | + * |
|
| 80 | + * @since 1.0.0 |
|
| 81 | + * @access protected |
|
| 82 | + * @var Wordlift_Loader $loader Maintains and registers all hooks for the plugin. |
|
| 83 | + */ |
|
| 84 | + protected $loader; |
|
| 85 | + |
|
| 86 | + /** |
|
| 87 | + * The unique identifier of this plugin. |
|
| 88 | + * |
|
| 89 | + * @since 1.0.0 |
|
| 90 | + * @access protected |
|
| 91 | + * @var string $plugin_name The string used to uniquely identify this plugin. |
|
| 92 | + */ |
|
| 93 | + protected $plugin_name; |
|
| 94 | + |
|
| 95 | + /** |
|
| 96 | + * The current version of the plugin. |
|
| 97 | + * |
|
| 98 | + * @since 1.0.0 |
|
| 99 | + * @access protected |
|
| 100 | + * @var string $version The current version of the plugin. |
|
| 101 | + */ |
|
| 102 | + protected $version; |
|
| 103 | + |
|
| 104 | + /** |
|
| 105 | + * The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 106 | + * |
|
| 107 | + * @since 3.12.0 |
|
| 108 | + * @access protected |
|
| 109 | + * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 110 | + */ |
|
| 111 | + protected $tinymce_adapter; |
|
| 112 | + |
|
| 113 | + /** |
|
| 114 | + * The {@link Faq_Tinymce_Adapter} instance |
|
| 115 | + * @since 3.26.0 |
|
| 116 | + * @access protected |
|
| 117 | + * @var Faq_Tinymce_Adapter $faq_tinymce_adapter . |
|
| 118 | + */ |
|
| 119 | + //protected $faq_tinymce_adapter; |
|
| 120 | + |
|
| 121 | + /** |
|
| 122 | + * The Thumbnail service. |
|
| 123 | + * |
|
| 124 | + * @since 3.1.5 |
|
| 125 | + * @access private |
|
| 126 | + * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service. |
|
| 127 | + */ |
|
| 128 | + private $thumbnail_service; |
|
| 129 | + |
|
| 130 | + /** |
|
| 131 | + * The UI service. |
|
| 132 | + * |
|
| 133 | + * @since 3.2.0 |
|
| 134 | + * @access private |
|
| 135 | + * @var \Wordlift_UI_Service $ui_service The UI service. |
|
| 136 | + */ |
|
| 137 | + private $ui_service; |
|
| 138 | + |
|
| 139 | + /** |
|
| 140 | + * The Schema service. |
|
| 141 | + * |
|
| 142 | + * @since 3.3.0 |
|
| 143 | + * @access protected |
|
| 144 | + * @var \Wordlift_Schema_Service $schema_service The Schema service. |
|
| 145 | + */ |
|
| 146 | + protected $schema_service; |
|
| 147 | + |
|
| 148 | + /** |
|
| 149 | + * The Entity service. |
|
| 150 | + * |
|
| 151 | + * @since 3.1.0 |
|
| 152 | + * @access protected |
|
| 153 | + * @var \Wordlift_Entity_Service $entity_service The Entity service. |
|
| 154 | + */ |
|
| 155 | + protected $entity_service; |
|
| 156 | + |
|
| 157 | + /** |
|
| 158 | + * The Topic Taxonomy service. |
|
| 159 | + * |
|
| 160 | + * @since 3.5.0 |
|
| 161 | + * @access private |
|
| 162 | + * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service. |
|
| 163 | + */ |
|
| 164 | + private $topic_taxonomy_service; |
|
| 165 | + |
|
| 166 | + /** |
|
| 167 | + * The Entity Types Taxonomy service. |
|
| 168 | + * |
|
| 169 | + * @since 3.18.0 |
|
| 170 | + * @access private |
|
| 171 | + * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service. |
|
| 172 | + */ |
|
| 173 | + private $entity_types_taxonomy_service; |
|
| 174 | + |
|
| 175 | + /** |
|
| 176 | + * The User service. |
|
| 177 | + * |
|
| 178 | + * @since 3.1.7 |
|
| 179 | + * @access protected |
|
| 180 | + * @var \Wordlift_User_Service $user_service The User service. |
|
| 181 | + */ |
|
| 182 | + protected $user_service; |
|
| 183 | + |
|
| 184 | + /** |
|
| 185 | + * The Timeline service. |
|
| 186 | + * |
|
| 187 | + * @since 3.1.0 |
|
| 188 | + * @access private |
|
| 189 | + * @var \Wordlift_Timeline_Service $timeline_service The Timeline service. |
|
| 190 | + */ |
|
| 191 | + private $timeline_service; |
|
| 192 | + |
|
| 193 | + /** |
|
| 194 | + * The Redirect service. |
|
| 195 | + * |
|
| 196 | + * @since 3.2.0 |
|
| 197 | + * @access private |
|
| 198 | + * @var \Wordlift_Redirect_Service $redirect_service The Redirect service. |
|
| 199 | + */ |
|
| 200 | + private $redirect_service; |
|
| 201 | + |
|
| 202 | + /** |
|
| 203 | + * The Notice service. |
|
| 204 | + * |
|
| 205 | + * @since 3.3.0 |
|
| 206 | + * @access private |
|
| 207 | + * @var \Wordlift_Notice_Service $notice_service The Notice service. |
|
| 208 | + */ |
|
| 209 | + private $notice_service; |
|
| 210 | + |
|
| 211 | + /** |
|
| 212 | + * The Entity list customization. |
|
| 213 | + * |
|
| 214 | + * @since 3.3.0 |
|
| 215 | + * @access protected |
|
| 216 | + * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service. |
|
| 217 | + */ |
|
| 218 | + protected $entity_list_service; |
|
| 219 | + |
|
| 220 | + /** |
|
| 221 | + * The Entity Types Taxonomy Walker. |
|
| 222 | + * |
|
| 223 | + * @since 3.1.0 |
|
| 224 | + * @access private |
|
| 225 | + * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker |
|
| 226 | + */ |
|
| 227 | + private $entity_types_taxonomy_walker; |
|
| 228 | + |
|
| 229 | + /** |
|
| 230 | + * The ShareThis service. |
|
| 231 | + * |
|
| 232 | + * @since 3.2.0 |
|
| 233 | + * @access private |
|
| 234 | + * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service. |
|
| 235 | + */ |
|
| 236 | + private $sharethis_service; |
|
| 237 | + |
|
| 238 | + /** |
|
| 239 | + * The PrimaShop adapter. |
|
| 240 | + * |
|
| 241 | + * @since 3.2.3 |
|
| 242 | + * @access private |
|
| 243 | + * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter. |
|
| 244 | + */ |
|
| 245 | + private $primashop_adapter; |
|
| 246 | + |
|
| 247 | + /** |
|
| 248 | + * The WordLift Dashboard adapter. |
|
| 249 | + * |
|
| 250 | + * @since 3.4.0 |
|
| 251 | + * @access private |
|
| 252 | + * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service; |
|
| 253 | + */ |
|
| 254 | + private $dashboard_service; |
|
| 255 | + |
|
| 256 | + /** |
|
| 257 | + * The entity type service. |
|
| 258 | + * |
|
| 259 | + * @since 3.6.0 |
|
| 260 | + * @access private |
|
| 261 | + * @var \Wordlift_Entity_Post_Type_Service |
|
| 262 | + */ |
|
| 263 | + private $entity_post_type_service; |
|
| 264 | + |
|
| 265 | + /** |
|
| 266 | + * The entity link service used to mangle links to entities with a custom slug or even w/o a slug. |
|
| 267 | + * |
|
| 268 | + * @since 3.6.0 |
|
| 269 | + * @access private |
|
| 270 | + * @var \Wordlift_Entity_Link_Service $entity_link_service The {@link Wordlift_Entity_Link_Service} instance. |
|
| 271 | + */ |
|
| 272 | + private $entity_link_service; |
|
| 273 | + |
|
| 274 | + /** |
|
| 275 | + * A {@link Wordlift_Sparql_Service} instance. |
|
| 276 | + * |
|
| 277 | + * @since 3.6.0 |
|
| 278 | + * @access protected |
|
| 279 | + * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance. |
|
| 280 | + */ |
|
| 281 | + protected $sparql_service; |
|
| 282 | + |
|
| 283 | + /** |
|
| 284 | + * A {@link Wordlift_Import_Service} instance. |
|
| 285 | + * |
|
| 286 | + * @since 3.6.0 |
|
| 287 | + * @access private |
|
| 288 | + * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance. |
|
| 289 | + */ |
|
| 290 | + private $import_service; |
|
| 291 | + |
|
| 292 | + /** |
|
| 293 | + * A {@link Wordlift_Rebuild_Service} instance. |
|
| 294 | + * |
|
| 295 | + * @since 3.6.0 |
|
| 296 | + * @access private |
|
| 297 | + * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance. |
|
| 298 | + */ |
|
| 299 | + private $rebuild_service; |
|
| 300 | + |
|
| 301 | + /** |
|
| 302 | + * A {@link Wordlift_Jsonld_Service} instance. |
|
| 303 | + * |
|
| 304 | + * @since 3.7.0 |
|
| 305 | + * @access protected |
|
| 306 | + * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance. |
|
| 307 | + */ |
|
| 308 | + protected $jsonld_service; |
|
| 309 | + |
|
| 310 | + /** |
|
| 311 | + * A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 312 | + * |
|
| 313 | + * @since 3.14.0 |
|
| 314 | + * @access protected |
|
| 315 | + * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 316 | + */ |
|
| 317 | + protected $jsonld_website_converter; |
|
| 318 | + |
|
| 319 | + /** |
|
| 320 | + * A {@link Wordlift_Property_Factory} instance. |
|
| 321 | + * |
|
| 322 | + * @since 3.7.0 |
|
| 323 | + * @access private |
|
| 324 | + * @var \Wordlift_Property_Factory $property_factory |
|
| 325 | + */ |
|
| 326 | + private $property_factory; |
|
| 327 | + |
|
| 328 | + /** |
|
| 329 | + * The 'Download Your Data' page. |
|
| 330 | + * |
|
| 331 | + * @since 3.6.0 |
|
| 332 | + * @access private |
|
| 333 | + * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page. |
|
| 334 | + */ |
|
| 335 | + private $download_your_data_page; |
|
| 336 | + |
|
| 337 | + /** |
|
| 338 | + * The 'WordLift Settings' page. |
|
| 339 | + * |
|
| 340 | + * @since 3.11.0 |
|
| 341 | + * @access protected |
|
| 342 | + * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page. |
|
| 343 | + */ |
|
| 344 | + protected $settings_page; |
|
| 345 | + |
|
| 346 | + /** |
|
| 347 | + * The install wizard page. |
|
| 348 | + * |
|
| 349 | + * @since 3.9.0 |
|
| 350 | + * @access private |
|
| 351 | + * @var \Wordlift_Admin_Setup $admin_setup The Install wizard. |
|
| 352 | + */ |
|
| 353 | + public $admin_setup; |
|
| 354 | + |
|
| 355 | + /** |
|
| 356 | + * The Content Filter Service hooks up to the 'the_content' filter and provides |
|
| 357 | + * linking of entities to their pages. |
|
| 358 | + * |
|
| 359 | + * @since 3.8.0 |
|
| 360 | + * @access private |
|
| 361 | + * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance. |
|
| 362 | + */ |
|
| 363 | + private $content_filter_service; |
|
| 364 | + |
|
| 365 | + /** |
|
| 366 | + * The Faq Content filter service |
|
| 367 | + * @since 3.26.0 |
|
| 368 | + * @access private |
|
| 369 | + * @var Faq_Content_Filter $faq_content_filter_service A {@link Faq_Content_Filter} instance. |
|
| 370 | + */ |
|
| 371 | + private $faq_content_filter_service; |
|
| 372 | + |
|
| 373 | + /** |
|
| 374 | + * A {@link Wordlift_Key_Validation_Service} instance. |
|
| 375 | + * |
|
| 376 | + * @since 3.9.0 |
|
| 377 | + * @access private |
|
| 378 | + * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance. |
|
| 379 | + */ |
|
| 380 | + private $key_validation_service; |
|
| 381 | + |
|
| 382 | + /** |
|
| 383 | + * A {@link Wordlift_Rating_Service} instance. |
|
| 384 | + * |
|
| 385 | + * @since 3.10.0 |
|
| 386 | + * @access private |
|
| 387 | + * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance. |
|
| 388 | + */ |
|
| 389 | + private $rating_service; |
|
| 390 | + |
|
| 391 | + /** |
|
| 392 | + * A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 393 | + * |
|
| 394 | + * @since 3.10.0 |
|
| 395 | + * @access protected |
|
| 396 | + * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 397 | + */ |
|
| 398 | + protected $post_to_jsonld_converter; |
|
| 399 | + |
|
| 400 | + /** |
|
| 401 | + * A {@link Wordlift_Configuration_Service} instance. |
|
| 402 | + * |
|
| 403 | + * @since 3.10.0 |
|
| 404 | + * @access protected |
|
| 405 | + * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance. |
|
| 406 | + */ |
|
| 407 | + protected $configuration_service; |
|
| 408 | + |
|
| 409 | + /** |
|
| 410 | + * A {@link Wordlift_Install_Service} instance. |
|
| 411 | + * |
|
| 412 | + * @since 3.18.0 |
|
| 413 | + * @access protected |
|
| 414 | + * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance. |
|
| 415 | + */ |
|
| 416 | + protected $install_service; |
|
| 417 | + |
|
| 418 | + /** |
|
| 419 | + * A {@link Wordlift_Entity_Type_Service} instance. |
|
| 420 | + * |
|
| 421 | + * @since 3.10.0 |
|
| 422 | + * @access protected |
|
| 423 | + * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance. |
|
| 424 | + */ |
|
| 425 | + protected $entity_type_service; |
|
| 426 | + |
|
| 427 | + /** |
|
| 428 | + * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 429 | + * |
|
| 430 | + * @since 3.10.0 |
|
| 431 | + * @access protected |
|
| 432 | + * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 433 | + */ |
|
| 434 | + protected $entity_post_to_jsonld_converter; |
|
| 435 | + |
|
| 436 | + /** |
|
| 437 | + * A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 438 | + * |
|
| 439 | + * @since 3.10.0 |
|
| 440 | + * @access protected |
|
| 441 | + * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 442 | + */ |
|
| 443 | + protected $postid_to_jsonld_converter; |
|
| 444 | + |
|
| 445 | + /** |
|
| 446 | + * The {@link Wordlift_Admin_Status_Page} class. |
|
| 447 | + * |
|
| 448 | + * @since 3.9.8 |
|
| 449 | + * @access private |
|
| 450 | + * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class. |
|
| 451 | + */ |
|
| 452 | + private $status_page; |
|
| 453 | + |
|
| 454 | + /** |
|
| 455 | + * The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 456 | + * |
|
| 457 | + * @since 3.11.0 |
|
| 458 | + * @access protected |
|
| 459 | + * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 460 | + */ |
|
| 461 | + protected $category_taxonomy_service; |
|
| 462 | + |
|
| 463 | + /** |
|
| 464 | + * The {@link Wordlift_Entity_Page_Service} instance. |
|
| 465 | + * |
|
| 466 | + * @since 3.11.0 |
|
| 467 | + * @access protected |
|
| 468 | + * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance. |
|
| 469 | + */ |
|
| 470 | + protected $entity_page_service; |
|
| 471 | + |
|
| 472 | + /** |
|
| 473 | + * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 474 | + * |
|
| 475 | + * @since 3.11.0 |
|
| 476 | + * @access protected |
|
| 477 | + * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 478 | + */ |
|
| 479 | + protected $settings_page_action_link; |
|
| 480 | + |
|
| 481 | + /** |
|
| 482 | + * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 483 | + * |
|
| 484 | + * @since 3.11.0 |
|
| 485 | + * @access protected |
|
| 486 | + * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 487 | + */ |
|
| 488 | + protected $analytics_settings_page_action_link; |
|
| 489 | + |
|
| 490 | + /** |
|
| 491 | + * The {@link Wordlift_Analytics_Connect} class. |
|
| 492 | + * |
|
| 493 | + * @since 3.11.0 |
|
| 494 | + * @access protected |
|
| 495 | + * @var \Wordlift_Analytics_Connect $analytics_connect The {@link Wordlift_Analytics_Connect} class. |
|
| 496 | + */ |
|
| 497 | + protected $analytics_connect; |
|
| 498 | + |
|
| 499 | + /** |
|
| 500 | + * The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 501 | + * |
|
| 502 | + * @since 3.11.0 |
|
| 503 | + * @access protected |
|
| 504 | + * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 505 | + */ |
|
| 506 | + protected $publisher_ajax_adapter; |
|
| 507 | + |
|
| 508 | + /** |
|
| 509 | + * The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 510 | + * |
|
| 511 | + * @since 3.11.0 |
|
| 512 | + * @access protected |
|
| 513 | + * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 514 | + */ |
|
| 515 | + protected $input_element; |
|
| 516 | + |
|
| 517 | + /** |
|
| 518 | + * The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 519 | + * |
|
| 520 | + * @since 3.13.0 |
|
| 521 | + * @access protected |
|
| 522 | + * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 523 | + */ |
|
| 524 | + protected $radio_input_element; |
|
| 525 | + |
|
| 526 | + /** |
|
| 527 | + * The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 528 | + * |
|
| 529 | + * @since 3.11.0 |
|
| 530 | + * @access protected |
|
| 531 | + * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 532 | + */ |
|
| 533 | + protected $language_select_element; |
|
| 534 | + |
|
| 535 | + /** |
|
| 536 | + * The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
| 537 | + * |
|
| 538 | + * @since 3.18.0 |
|
| 539 | + * @access protected |
|
| 540 | + * @var \Wordlift_Admin_Country_Select_Element $country_select_element The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
| 541 | + */ |
|
| 542 | + protected $country_select_element; |
|
| 543 | + |
|
| 544 | + /** |
|
| 545 | + * The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 546 | + * |
|
| 547 | + * @since 3.11.0 |
|
| 548 | + * @access protected |
|
| 549 | + * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 550 | + */ |
|
| 551 | + protected $publisher_element; |
|
| 552 | + |
|
| 553 | + /** |
|
| 554 | + * The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 555 | + * |
|
| 556 | + * @since 3.11.0 |
|
| 557 | + * @access protected |
|
| 558 | + * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 559 | + */ |
|
| 560 | + protected $select2_element; |
|
| 561 | + |
|
| 562 | + /** |
|
| 563 | + * The controller for the entity type list admin page |
|
| 564 | + * |
|
| 565 | + * @since 3.11.0 |
|
| 566 | + * @access private |
|
| 567 | + * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class. |
|
| 568 | + */ |
|
| 569 | + private $entity_type_admin_page; |
|
| 570 | + |
|
| 571 | + /** |
|
| 572 | + * The controller for the entity type settings admin page |
|
| 573 | + * |
|
| 574 | + * @since 3.11.0 |
|
| 575 | + * @access private |
|
| 576 | + * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class. |
|
| 577 | + */ |
|
| 578 | + private $entity_type_settings_admin_page; |
|
| 579 | + |
|
| 580 | + /** |
|
| 581 | + * The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 582 | + * |
|
| 583 | + * @since 3.11.0 |
|
| 584 | + * @access protected |
|
| 585 | + * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 586 | + */ |
|
| 587 | + protected $related_entities_cloud_widget; |
|
| 588 | + |
|
| 589 | + /** |
|
| 590 | + * The {@link Wordlift_Admin_Author_Element} instance. |
|
| 591 | + * |
|
| 592 | + * @since 3.14.0 |
|
| 593 | + * @access protected |
|
| 594 | + * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance. |
|
| 595 | + */ |
|
| 596 | + protected $author_element; |
|
| 597 | + |
|
| 598 | + /** |
|
| 599 | + * The {@link Wordlift_Sample_Data_Service} instance. |
|
| 600 | + * |
|
| 601 | + * @since 3.12.0 |
|
| 602 | + * @access protected |
|
| 603 | + * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance. |
|
| 604 | + */ |
|
| 605 | + protected $sample_data_service; |
|
| 606 | + |
|
| 607 | + /** |
|
| 608 | + * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 609 | + * |
|
| 610 | + * @since 3.12.0 |
|
| 611 | + * @access protected |
|
| 612 | + * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 613 | + */ |
|
| 614 | + protected $sample_data_ajax_adapter; |
|
| 615 | + |
|
| 616 | + /** |
|
| 617 | + * The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 618 | + * |
|
| 619 | + * @since 3.14.3 |
|
| 620 | + * @access private |
|
| 621 | + * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 622 | + */ |
|
| 623 | + private $relation_rebuild_service; |
|
| 624 | + |
|
| 625 | + /** |
|
| 626 | + * The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 627 | + * |
|
| 628 | + * @since 3.14.3 |
|
| 629 | + * @access private |
|
| 630 | + * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 631 | + */ |
|
| 632 | + private $relation_rebuild_adapter; |
|
| 633 | + |
|
| 634 | + /** |
|
| 635 | + * The {@link Wordlift_Reference_Rebuild_Service} instance. |
|
| 636 | + * |
|
| 637 | + * @since 3.18.0 |
|
| 638 | + * @access private |
|
| 639 | + * @var \Wordlift_Reference_Rebuild_Service $reference_rebuild_service The {@link Wordlift_Reference_Rebuild_Service} instance. |
|
| 640 | + */ |
|
| 641 | + private $reference_rebuild_service; |
|
| 642 | + |
|
| 643 | + /** |
|
| 644 | + * The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 645 | + * |
|
| 646 | + * @since 3.16.0 |
|
| 647 | + * @access protected |
|
| 648 | + * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 649 | + */ |
|
| 650 | + protected $google_analytics_export_service; |
|
| 651 | + |
|
| 652 | + /** |
|
| 653 | + * {@link Wordlift}'s singleton instance. |
|
| 654 | + * |
|
| 655 | + * @since 3.15.0 |
|
| 656 | + * @access protected |
|
| 657 | + * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance. |
|
| 658 | + */ |
|
| 659 | + protected $entity_type_adapter; |
|
| 660 | + |
|
| 661 | + /** |
|
| 662 | + * The {@link Wordlift_Storage_Factory} instance. |
|
| 663 | + * |
|
| 664 | + * @since 3.15.0 |
|
| 665 | + * @access protected |
|
| 666 | + * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance. |
|
| 667 | + */ |
|
| 668 | + protected $storage_factory; |
|
| 669 | + |
|
| 670 | + /** |
|
| 671 | + * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 672 | + * |
|
| 673 | + * @since 3.15.0 |
|
| 674 | + * @access protected |
|
| 675 | + * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 676 | + */ |
|
| 677 | + protected $rendition_factory; |
|
| 678 | + |
|
| 679 | + /** |
|
| 680 | + * The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 681 | + * |
|
| 682 | + * @since 3.15.0 |
|
| 683 | + * @access private |
|
| 684 | + * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 685 | + */ |
|
| 686 | + private $autocomplete_adapter; |
|
| 687 | + |
|
| 688 | + /** |
|
| 689 | + * The {@link Wordlift_Relation_Service} instance. |
|
| 690 | + * |
|
| 691 | + * @since 3.15.0 |
|
| 692 | + * @access protected |
|
| 693 | + * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance. |
|
| 694 | + */ |
|
| 695 | + protected $relation_service; |
|
| 696 | + |
|
| 697 | + /** |
|
| 698 | + * The {@link Wordlift_Cached_Post_Converter} instance. |
|
| 699 | + * |
|
| 700 | + * @since 3.16.0 |
|
| 701 | + * @access protected |
|
| 702 | + * @var \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance. |
|
| 703 | + * |
|
| 704 | + */ |
|
| 705 | + protected $cached_postid_to_jsonld_converter; |
|
| 706 | + |
|
| 707 | + /** |
|
| 708 | + * The {@link Wordlift_Entity_Uri_Service} instance. |
|
| 709 | + * |
|
| 710 | + * @since 3.16.3 |
|
| 711 | + * @access protected |
|
| 712 | + * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance. |
|
| 713 | + */ |
|
| 714 | + protected $entity_uri_service; |
|
| 715 | + |
|
| 716 | + /** |
|
| 717 | + * The {@link Wordlift_Publisher_Service} instance. |
|
| 718 | + * |
|
| 719 | + * @since 3.19.0 |
|
| 720 | + * @access protected |
|
| 721 | + * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance. |
|
| 722 | + */ |
|
| 723 | + protected $publisher_service; |
|
| 724 | + |
|
| 725 | + /** |
|
| 726 | + * The {@link Wordlift_Context_Cards_Service} instance. |
|
| 727 | + * |
|
| 728 | + * @var \Wordlift_Context_Cards_Service The {@link Wordlift_Context_Cards_Service} instance. |
|
| 729 | + */ |
|
| 730 | + protected $context_cards_service; |
|
| 731 | + |
|
| 732 | + /** |
|
| 733 | + * {@link Wordlift}'s singleton instance. |
|
| 734 | + * |
|
| 735 | + * @since 3.11.2 |
|
| 736 | + * @access private |
|
| 737 | + * @var Wordlift $instance {@link Wordlift}'s singleton instance. |
|
| 738 | + */ |
|
| 739 | + private static $instance; |
|
| 740 | + |
|
| 741 | + //</editor-fold> |
|
| 742 | + |
|
| 743 | + /** |
|
| 744 | + * Define the core functionality of the plugin. |
|
| 745 | + * |
|
| 746 | + * Set the plugin name and the plugin version that can be used throughout the plugin. |
|
| 747 | + * Load the dependencies, define the locale, and set the hooks for the admin area and |
|
| 748 | + * the public-facing side of the site. |
|
| 749 | + * |
|
| 750 | + * @since 1.0.0 |
|
| 751 | + */ |
|
| 752 | + public function __construct() { |
|
| 753 | + |
|
| 754 | + self::$instance = $this; |
|
| 755 | + |
|
| 756 | + $this->plugin_name = 'wordlift'; |
|
| 757 | + $this->version = '3.29.0'; |
|
| 758 | + $this->load_dependencies(); |
|
| 759 | + $this->set_locale(); |
|
| 760 | + $this->define_admin_hooks(); |
|
| 761 | + $this->define_public_hooks(); |
|
| 762 | + |
|
| 763 | + // If we're in `WP_CLI` load the related files. |
|
| 764 | + if ( class_exists( 'WP_CLI' ) ) { |
|
| 765 | + $this->load_cli_dependencies(); |
|
| 766 | + } |
|
| 767 | + |
|
| 768 | + } |
|
| 769 | + |
|
| 770 | + /** |
|
| 771 | + * Get the singleton instance. |
|
| 772 | + * |
|
| 773 | + * @return Wordlift The {@link Wordlift} singleton instance. |
|
| 774 | + * @since 3.11.2 |
|
| 775 | + * |
|
| 776 | + */ |
|
| 777 | + public static function get_instance() { |
|
| 778 | + |
|
| 779 | + return self::$instance; |
|
| 780 | + } |
|
| 781 | + |
|
| 782 | + /** |
|
| 783 | + * Load the required dependencies for this plugin. |
|
| 784 | + * |
|
| 785 | + * Include the following files that make up the plugin: |
|
| 786 | + * |
|
| 787 | + * - Wordlift_Loader. Orchestrates the hooks of the plugin. |
|
| 788 | + * - Wordlift_i18n. Defines internationalization functionality. |
|
| 789 | + * - Wordlift_Admin. Defines all hooks for the admin area. |
|
| 790 | + * - Wordlift_Public. Defines all hooks for the public side of the site. |
|
| 791 | + * |
|
| 792 | + * Create an instance of the loader which will be used to register the hooks |
|
| 793 | + * with WordPress. |
|
| 794 | + * |
|
| 795 | + * @throws Exception |
|
| 796 | + * @since 1.0.0 |
|
| 797 | + * @access private |
|
| 798 | + */ |
|
| 799 | + private function load_dependencies() { |
|
| 800 | + |
|
| 801 | + /** |
|
| 802 | + * The class responsible for orchestrating the actions and filters of the |
|
| 803 | + * core plugin. |
|
| 804 | + */ |
|
| 805 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 806 | + |
|
| 807 | + // The class responsible for plugin uninstall. |
|
| 808 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
|
| 809 | + |
|
| 810 | + /** |
|
| 811 | + * The class responsible for defining internationalization functionality |
|
| 812 | + * of the plugin. |
|
| 813 | + */ |
|
| 814 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 815 | + |
|
| 816 | + /** |
|
| 817 | + * WordLift's supported languages. |
|
| 818 | + */ |
|
| 819 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 820 | + |
|
| 821 | + /** |
|
| 822 | + * WordLift's supported countries. |
|
| 823 | + */ |
|
| 824 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php'; |
|
| 825 | + |
|
| 826 | + /** |
|
| 827 | + * Provide support functions to sanitize data. |
|
| 828 | + */ |
|
| 829 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 830 | + |
|
| 831 | + /** Services. */ |
|
| 832 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 833 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
|
| 834 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 835 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 836 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 837 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 838 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 839 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
|
| 840 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 841 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php'; |
|
| 842 | + |
|
| 843 | + /** |
|
| 844 | + * The Query builder. |
|
| 845 | + */ |
|
| 846 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 847 | + |
|
| 848 | + /** |
|
| 849 | + * The Schema service. |
|
| 850 | + */ |
|
| 851 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 852 | + |
|
| 853 | + /** |
|
| 854 | + * The schema:url property service. |
|
| 855 | + */ |
|
| 856 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 857 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 858 | + |
|
| 859 | + /** |
|
| 860 | + * The UI service. |
|
| 861 | + */ |
|
| 862 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 863 | + |
|
| 864 | + /** |
|
| 865 | + * The Thumbnail service. |
|
| 866 | + */ |
|
| 867 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 868 | + |
|
| 869 | + /** |
|
| 870 | + * The Entity Types Taxonomy service. |
|
| 871 | + */ |
|
| 872 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 873 | + |
|
| 874 | + /** |
|
| 875 | + * The Entity service. |
|
| 876 | + */ |
|
| 877 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
|
| 878 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 879 | + |
|
| 880 | + // Add the entity rating service. |
|
| 881 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 882 | + |
|
| 883 | + /** |
|
| 884 | + * The User service. |
|
| 885 | + */ |
|
| 886 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 887 | + |
|
| 888 | + /** |
|
| 889 | + * The Timeline service. |
|
| 890 | + */ |
|
| 891 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 892 | + |
|
| 893 | + /** |
|
| 894 | + * The Topic Taxonomy service. |
|
| 895 | + */ |
|
| 896 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 897 | + |
|
| 898 | + /** |
|
| 899 | + * The SPARQL service. |
|
| 900 | + */ |
|
| 901 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 902 | + |
|
| 903 | + /** |
|
| 904 | + * The WordLift import service. |
|
| 905 | + */ |
|
| 906 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 907 | + |
|
| 908 | + /** |
|
| 909 | + * The WordLift URI service. |
|
| 910 | + */ |
|
| 911 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 912 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 913 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 914 | + |
|
| 915 | + /** |
|
| 916 | + * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
|
| 917 | + */ |
|
| 918 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php'; |
|
| 919 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php'; |
|
| 920 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php'; |
|
| 921 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php'; |
|
| 922 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php'; |
|
| 923 | + |
|
| 924 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 925 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 926 | + |
|
| 927 | + /** |
|
| 928 | + * Load the converters. |
|
| 929 | + */ |
|
| 930 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 931 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 932 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 933 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 934 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 935 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 936 | + |
|
| 937 | + /** |
|
| 938 | + * Load cache-related files. |
|
| 939 | + */ |
|
| 940 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
|
| 941 | + |
|
| 942 | + /** |
|
| 943 | + * Load the content filter. |
|
| 944 | + */ |
|
| 945 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 946 | + |
|
| 947 | + /* |
|
| 948 | 948 | * Load the excerpt helper. |
| 949 | 949 | */ |
| 950 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 951 | - |
|
| 952 | - /** |
|
| 953 | - * Load the JSON-LD service to publish entities using JSON-LD.s |
|
| 954 | - * |
|
| 955 | - * @since 3.8.0 |
|
| 956 | - */ |
|
| 957 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 958 | - |
|
| 959 | - // The Publisher Service and the AJAX adapter. |
|
| 960 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 961 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 962 | - |
|
| 963 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 964 | - |
|
| 965 | - /** |
|
| 966 | - * Load the WordLift key validation service. |
|
| 967 | - */ |
|
| 968 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 969 | - |
|
| 970 | - // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
|
| 971 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 972 | - |
|
| 973 | - // Load the `Wordlift_Entity_Page_Service` class definition. |
|
| 974 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
| 975 | - |
|
| 976 | - /** Linked Data. */ |
|
| 977 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 978 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 979 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 980 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 981 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 982 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 983 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 984 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 985 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 986 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 987 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 988 | - |
|
| 989 | - /** Linked Data Rendition. */ |
|
| 990 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php'; |
|
| 991 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php'; |
|
| 992 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php'; |
|
| 993 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 994 | - |
|
| 995 | - /** Services. */ |
|
| 996 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 997 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php'; |
|
| 998 | - |
|
| 999 | - /** Adapters. */ |
|
| 1000 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 1001 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 1002 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 1003 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 1004 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php'; |
|
| 1005 | - |
|
| 1006 | - /** Async Tasks. */ |
|
| 1007 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php'; |
|
| 1008 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 1009 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php'; |
|
| 1010 | - |
|
| 1011 | - /** Autocomplete. */ |
|
| 1012 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 1013 | - |
|
| 1014 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
|
| 1015 | - |
|
| 1016 | - /** Analytics */ |
|
| 1017 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 1018 | - |
|
| 1019 | - /** |
|
| 1020 | - * The class responsible for defining all actions that occur in the admin area. |
|
| 1021 | - */ |
|
| 1022 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 1023 | - |
|
| 1024 | - /** |
|
| 1025 | - * The class to customize the entity list admin page. |
|
| 1026 | - */ |
|
| 1027 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 1028 | - |
|
| 1029 | - /** |
|
| 1030 | - * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
|
| 1031 | - */ |
|
| 1032 | - global $wp_version; |
|
| 1033 | - if ( version_compare( $wp_version, '5.3', '<' ) ) { |
|
| 1034 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 1035 | - } else { |
|
| 1036 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
| 1037 | - } |
|
| 1038 | - |
|
| 1039 | - /** |
|
| 1040 | - * The Notice service. |
|
| 1041 | - */ |
|
| 1042 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 1043 | - |
|
| 1044 | - /** |
|
| 1045 | - * The PrimaShop adapter. |
|
| 1046 | - */ |
|
| 1047 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 1048 | - |
|
| 1049 | - /** |
|
| 1050 | - * The WordLift Dashboard service. |
|
| 1051 | - */ |
|
| 1052 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 1053 | - |
|
| 1054 | - /** |
|
| 1055 | - * The admin 'Install wizard' page. |
|
| 1056 | - */ |
|
| 1057 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 1058 | - |
|
| 1059 | - /** |
|
| 1060 | - * The WordLift entity type list admin page controller. |
|
| 1061 | - */ |
|
| 1062 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 1063 | - |
|
| 1064 | - /** |
|
| 1065 | - * The WordLift entity type settings admin page controller. |
|
| 1066 | - */ |
|
| 1067 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 1068 | - |
|
| 1069 | - /** |
|
| 1070 | - * The admin 'Download Your Data' page. |
|
| 1071 | - */ |
|
| 1072 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 1073 | - |
|
| 1074 | - /** |
|
| 1075 | - * The admin 'WordLift Settings' page. |
|
| 1076 | - */ |
|
| 1077 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php'; |
|
| 1078 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 1079 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 1080 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 1081 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 1082 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 1083 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 1084 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 1085 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 1086 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 1087 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 1088 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 1089 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
| 1090 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 1091 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
| 1092 | - |
|
| 1093 | - /** Admin Pages */ |
|
| 1094 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 1095 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 1096 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-page.php'; |
|
| 1097 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 1098 | - |
|
| 1099 | - /** |
|
| 1100 | - * The class responsible for defining all actions that occur in the public-facing |
|
| 1101 | - * side of the site. |
|
| 1102 | - */ |
|
| 1103 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 1104 | - |
|
| 1105 | - /** |
|
| 1106 | - * The shortcode abstract class. |
|
| 1107 | - */ |
|
| 1108 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 1109 | - |
|
| 1110 | - /** |
|
| 1111 | - * The Timeline shortcode. |
|
| 1112 | - */ |
|
| 1113 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 1114 | - |
|
| 1115 | - /** |
|
| 1116 | - * The Navigator shortcode. |
|
| 1117 | - */ |
|
| 1118 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 1119 | - |
|
| 1120 | - /** |
|
| 1121 | - * The Products Navigator shortcode. |
|
| 1122 | - */ |
|
| 1123 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php'; |
|
| 1124 | - |
|
| 1125 | - /** |
|
| 1126 | - * The chord shortcode. |
|
| 1127 | - */ |
|
| 1128 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 1129 | - |
|
| 1130 | - /** |
|
| 1131 | - * The geomap shortcode. |
|
| 1132 | - */ |
|
| 1133 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 1134 | - |
|
| 1135 | - /** |
|
| 1136 | - * The entity cloud shortcode. |
|
| 1137 | - */ |
|
| 1138 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 1139 | - |
|
| 1140 | - /** |
|
| 1141 | - * The entity glossary shortcode. |
|
| 1142 | - */ |
|
| 1143 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
|
| 1144 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 1145 | - |
|
| 1146 | - /** |
|
| 1147 | - * Faceted Search shortcode. |
|
| 1148 | - */ |
|
| 1149 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 1150 | - |
|
| 1151 | - /** |
|
| 1152 | - * The ShareThis service. |
|
| 1153 | - */ |
|
| 1154 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 1155 | - |
|
| 1156 | - /** |
|
| 1157 | - * The SEO service. |
|
| 1158 | - */ |
|
| 1159 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 1160 | - |
|
| 1161 | - /** |
|
| 1162 | - * The AMP service. |
|
| 1163 | - */ |
|
| 1164 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1165 | - |
|
| 1166 | - /** Widgets */ |
|
| 1167 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1168 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1169 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php'; |
|
| 1170 | - |
|
| 1171 | - /* |
|
| 950 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 951 | + |
|
| 952 | + /** |
|
| 953 | + * Load the JSON-LD service to publish entities using JSON-LD.s |
|
| 954 | + * |
|
| 955 | + * @since 3.8.0 |
|
| 956 | + */ |
|
| 957 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 958 | + |
|
| 959 | + // The Publisher Service and the AJAX adapter. |
|
| 960 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 961 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 962 | + |
|
| 963 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 964 | + |
|
| 965 | + /** |
|
| 966 | + * Load the WordLift key validation service. |
|
| 967 | + */ |
|
| 968 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 969 | + |
|
| 970 | + // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
|
| 971 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 972 | + |
|
| 973 | + // Load the `Wordlift_Entity_Page_Service` class definition. |
|
| 974 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
| 975 | + |
|
| 976 | + /** Linked Data. */ |
|
| 977 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 978 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 979 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 980 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 981 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 982 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 983 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 984 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 985 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 986 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 987 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 988 | + |
|
| 989 | + /** Linked Data Rendition. */ |
|
| 990 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php'; |
|
| 991 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php'; |
|
| 992 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php'; |
|
| 993 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 994 | + |
|
| 995 | + /** Services. */ |
|
| 996 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 997 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php'; |
|
| 998 | + |
|
| 999 | + /** Adapters. */ |
|
| 1000 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 1001 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 1002 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 1003 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 1004 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php'; |
|
| 1005 | + |
|
| 1006 | + /** Async Tasks. */ |
|
| 1007 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php'; |
|
| 1008 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 1009 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php'; |
|
| 1010 | + |
|
| 1011 | + /** Autocomplete. */ |
|
| 1012 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 1013 | + |
|
| 1014 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
|
| 1015 | + |
|
| 1016 | + /** Analytics */ |
|
| 1017 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 1018 | + |
|
| 1019 | + /** |
|
| 1020 | + * The class responsible for defining all actions that occur in the admin area. |
|
| 1021 | + */ |
|
| 1022 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 1023 | + |
|
| 1024 | + /** |
|
| 1025 | + * The class to customize the entity list admin page. |
|
| 1026 | + */ |
|
| 1027 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 1028 | + |
|
| 1029 | + /** |
|
| 1030 | + * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
|
| 1031 | + */ |
|
| 1032 | + global $wp_version; |
|
| 1033 | + if ( version_compare( $wp_version, '5.3', '<' ) ) { |
|
| 1034 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 1035 | + } else { |
|
| 1036 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
| 1037 | + } |
|
| 1038 | + |
|
| 1039 | + /** |
|
| 1040 | + * The Notice service. |
|
| 1041 | + */ |
|
| 1042 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 1043 | + |
|
| 1044 | + /** |
|
| 1045 | + * The PrimaShop adapter. |
|
| 1046 | + */ |
|
| 1047 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 1048 | + |
|
| 1049 | + /** |
|
| 1050 | + * The WordLift Dashboard service. |
|
| 1051 | + */ |
|
| 1052 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 1053 | + |
|
| 1054 | + /** |
|
| 1055 | + * The admin 'Install wizard' page. |
|
| 1056 | + */ |
|
| 1057 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 1058 | + |
|
| 1059 | + /** |
|
| 1060 | + * The WordLift entity type list admin page controller. |
|
| 1061 | + */ |
|
| 1062 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 1063 | + |
|
| 1064 | + /** |
|
| 1065 | + * The WordLift entity type settings admin page controller. |
|
| 1066 | + */ |
|
| 1067 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 1068 | + |
|
| 1069 | + /** |
|
| 1070 | + * The admin 'Download Your Data' page. |
|
| 1071 | + */ |
|
| 1072 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 1073 | + |
|
| 1074 | + /** |
|
| 1075 | + * The admin 'WordLift Settings' page. |
|
| 1076 | + */ |
|
| 1077 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php'; |
|
| 1078 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 1079 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 1080 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 1081 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 1082 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 1083 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 1084 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 1085 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 1086 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 1087 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 1088 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 1089 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
| 1090 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 1091 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
| 1092 | + |
|
| 1093 | + /** Admin Pages */ |
|
| 1094 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 1095 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 1096 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-page.php'; |
|
| 1097 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 1098 | + |
|
| 1099 | + /** |
|
| 1100 | + * The class responsible for defining all actions that occur in the public-facing |
|
| 1101 | + * side of the site. |
|
| 1102 | + */ |
|
| 1103 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 1104 | + |
|
| 1105 | + /** |
|
| 1106 | + * The shortcode abstract class. |
|
| 1107 | + */ |
|
| 1108 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 1109 | + |
|
| 1110 | + /** |
|
| 1111 | + * The Timeline shortcode. |
|
| 1112 | + */ |
|
| 1113 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 1114 | + |
|
| 1115 | + /** |
|
| 1116 | + * The Navigator shortcode. |
|
| 1117 | + */ |
|
| 1118 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 1119 | + |
|
| 1120 | + /** |
|
| 1121 | + * The Products Navigator shortcode. |
|
| 1122 | + */ |
|
| 1123 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php'; |
|
| 1124 | + |
|
| 1125 | + /** |
|
| 1126 | + * The chord shortcode. |
|
| 1127 | + */ |
|
| 1128 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 1129 | + |
|
| 1130 | + /** |
|
| 1131 | + * The geomap shortcode. |
|
| 1132 | + */ |
|
| 1133 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 1134 | + |
|
| 1135 | + /** |
|
| 1136 | + * The entity cloud shortcode. |
|
| 1137 | + */ |
|
| 1138 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 1139 | + |
|
| 1140 | + /** |
|
| 1141 | + * The entity glossary shortcode. |
|
| 1142 | + */ |
|
| 1143 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
|
| 1144 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 1145 | + |
|
| 1146 | + /** |
|
| 1147 | + * Faceted Search shortcode. |
|
| 1148 | + */ |
|
| 1149 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 1150 | + |
|
| 1151 | + /** |
|
| 1152 | + * The ShareThis service. |
|
| 1153 | + */ |
|
| 1154 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 1155 | + |
|
| 1156 | + /** |
|
| 1157 | + * The SEO service. |
|
| 1158 | + */ |
|
| 1159 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 1160 | + |
|
| 1161 | + /** |
|
| 1162 | + * The AMP service. |
|
| 1163 | + */ |
|
| 1164 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1165 | + |
|
| 1166 | + /** Widgets */ |
|
| 1167 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1168 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1169 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php'; |
|
| 1170 | + |
|
| 1171 | + /* |
|
| 1172 | 1172 | * Schema.org Services. |
| 1173 | 1173 | * |
| 1174 | 1174 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1175 | 1175 | */ |
| 1176 | - if ( WL_ALL_ENTITY_TYPES ) { |
|
| 1177 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1178 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1179 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1180 | - new Wordlift_Schemaorg_Sync_Service(); |
|
| 1181 | - $schemaorg_property_service = new Wordlift_Schemaorg_Property_Service(); |
|
| 1182 | - new Wordlift_Schemaorg_Class_Service(); |
|
| 1183 | - } else { |
|
| 1184 | - $schemaorg_property_service = null; |
|
| 1185 | - } |
|
| 1176 | + if ( WL_ALL_ENTITY_TYPES ) { |
|
| 1177 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1178 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1179 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1180 | + new Wordlift_Schemaorg_Sync_Service(); |
|
| 1181 | + $schemaorg_property_service = new Wordlift_Schemaorg_Property_Service(); |
|
| 1182 | + new Wordlift_Schemaorg_Class_Service(); |
|
| 1183 | + } else { |
|
| 1184 | + $schemaorg_property_service = null; |
|
| 1185 | + } |
|
| 1186 | 1186 | |
| 1187 | - $this->loader = new Wordlift_Loader(); |
|
| 1187 | + $this->loader = new Wordlift_Loader(); |
|
| 1188 | 1188 | |
| 1189 | - // Instantiate a global logger. |
|
| 1190 | - global $wl_logger; |
|
| 1191 | - $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1189 | + // Instantiate a global logger. |
|
| 1190 | + global $wl_logger; |
|
| 1191 | + $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1192 | 1192 | |
| 1193 | - // Load the `wl-api` end-point. |
|
| 1194 | - new Wordlift_Http_Api(); |
|
| 1193 | + // Load the `wl-api` end-point. |
|
| 1194 | + new Wordlift_Http_Api(); |
|
| 1195 | 1195 | |
| 1196 | - // Load the Install Service. |
|
| 1197 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
|
| 1198 | - $this->install_service = new Wordlift_Install_Service(); |
|
| 1196 | + // Load the Install Service. |
|
| 1197 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
|
| 1198 | + $this->install_service = new Wordlift_Install_Service(); |
|
| 1199 | 1199 | |
| 1200 | - /** Services. */ |
|
| 1201 | - // Create the configuration service. |
|
| 1202 | - $this->configuration_service = new Wordlift_Configuration_Service(); |
|
| 1203 | - $api_service = new Wordlift_Api_Service( $this->configuration_service ); |
|
| 1200 | + /** Services. */ |
|
| 1201 | + // Create the configuration service. |
|
| 1202 | + $this->configuration_service = new Wordlift_Configuration_Service(); |
|
| 1203 | + $api_service = new Wordlift_Api_Service( $this->configuration_service ); |
|
| 1204 | 1204 | |
| 1205 | - // Create an entity type service instance. It'll be later bound to the init action. |
|
| 1206 | - $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 1205 | + // Create an entity type service instance. It'll be later bound to the init action. |
|
| 1206 | + $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 1207 | 1207 | |
| 1208 | - // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
|
| 1209 | - $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 1208 | + // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
|
| 1209 | + $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 1210 | 1210 | |
| 1211 | - // Create an instance of the UI service. |
|
| 1212 | - $this->ui_service = new Wordlift_UI_Service(); |
|
| 1211 | + // Create an instance of the UI service. |
|
| 1212 | + $this->ui_service = new Wordlift_UI_Service(); |
|
| 1213 | 1213 | |
| 1214 | - // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events. |
|
| 1215 | - $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
|
| 1214 | + // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events. |
|
| 1215 | + $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
|
| 1216 | 1216 | |
| 1217 | - $this->sparql_service = new Wordlift_Sparql_Service(); |
|
| 1218 | - $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 1219 | - $this->notice_service = new Wordlift_Notice_Service(); |
|
| 1220 | - $this->relation_service = new Wordlift_Relation_Service(); |
|
| 1217 | + $this->sparql_service = new Wordlift_Sparql_Service(); |
|
| 1218 | + $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 1219 | + $this->notice_service = new Wordlift_Notice_Service(); |
|
| 1220 | + $this->relation_service = new Wordlift_Relation_Service(); |
|
| 1221 | 1221 | |
| 1222 | - $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' ); |
|
| 1223 | - $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service ); |
|
| 1224 | - $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service ); |
|
| 1225 | - $this->user_service = new Wordlift_User_Service( $this->sparql_service, $this->entity_service ); |
|
| 1222 | + $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' ); |
|
| 1223 | + $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service ); |
|
| 1224 | + $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service ); |
|
| 1225 | + $this->user_service = new Wordlift_User_Service( $this->sparql_service, $this->entity_service ); |
|
| 1226 | 1226 | |
| 1227 | - // Instantiate the JSON-LD service. |
|
| 1228 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1227 | + // Instantiate the JSON-LD service. |
|
| 1228 | + $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1229 | 1229 | |
| 1230 | - /** Linked Data. */ |
|
| 1231 | - $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
|
| 1232 | - $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
|
| 1230 | + /** Linked Data. */ |
|
| 1231 | + $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
|
| 1232 | + $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
|
| 1233 | 1233 | |
| 1234 | - $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
|
| 1234 | + $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
|
| 1235 | 1235 | |
| 1236 | - // Create a new instance of the Redirect service. |
|
| 1237 | - $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_uri_service ); |
|
| 1238 | - $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 1236 | + // Create a new instance of the Redirect service. |
|
| 1237 | + $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_uri_service ); |
|
| 1238 | + $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 1239 | 1239 | |
| 1240 | - // Create a new instance of the Timeline service and Timeline shortcode. |
|
| 1241 | - $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
|
| 1240 | + // Create a new instance of the Timeline service and Timeline shortcode. |
|
| 1241 | + $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
|
| 1242 | 1242 | |
| 1243 | - $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
|
| 1243 | + $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
|
| 1244 | 1244 | |
| 1245 | - $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
|
| 1246 | - $this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service(); |
|
| 1245 | + $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
|
| 1246 | + $this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service(); |
|
| 1247 | 1247 | |
| 1248 | - // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
|
| 1249 | - $this->sharethis_service = new Wordlift_ShareThis_Service(); |
|
| 1248 | + // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
|
| 1249 | + $this->sharethis_service = new Wordlift_ShareThis_Service(); |
|
| 1250 | 1250 | |
| 1251 | - // Create an instance of the PrimaShop adapter. |
|
| 1252 | - $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
|
| 1251 | + // Create an instance of the PrimaShop adapter. |
|
| 1252 | + $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
|
| 1253 | 1253 | |
| 1254 | - // Create an import service instance to hook later to WP's import function. |
|
| 1255 | - $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() ); |
|
| 1254 | + // Create an import service instance to hook later to WP's import function. |
|
| 1255 | + $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() ); |
|
| 1256 | 1256 | |
| 1257 | - $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1257 | + $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1258 | 1258 | |
| 1259 | - // Create the entity rating service. |
|
| 1260 | - $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 1259 | + // Create the entity rating service. |
|
| 1260 | + $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 1261 | 1261 | |
| 1262 | - // Create entity list customization (wp-admin/edit.php). |
|
| 1263 | - $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 1262 | + // Create entity list customization (wp-admin/edit.php). |
|
| 1263 | + $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 1264 | 1264 | |
| 1265 | - // Create a new instance of the Redirect service. |
|
| 1266 | - $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
|
| 1265 | + // Create a new instance of the Redirect service. |
|
| 1266 | + $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
|
| 1267 | 1267 | |
| 1268 | - // Create an instance of the Publisher Service and the AJAX Adapter. |
|
| 1269 | - $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service ); |
|
| 1270 | - $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1271 | - $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1268 | + // Create an instance of the Publisher Service and the AJAX Adapter. |
|
| 1269 | + $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service ); |
|
| 1270 | + $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1271 | + $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1272 | 1272 | |
| 1273 | - $attachment_service = new Wordlift_Attachment_Service(); |
|
| 1273 | + $attachment_service = new Wordlift_Attachment_Service(); |
|
| 1274 | 1274 | |
| 1275 | - // Instantiate the JSON-LD service. |
|
| 1276 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1277 | - $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 ); |
|
| 1278 | - $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 ); |
|
| 1279 | - $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 ); |
|
| 1280 | - $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
|
| 1275 | + // Instantiate the JSON-LD service. |
|
| 1276 | + $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1277 | + $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 ); |
|
| 1278 | + $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 ); |
|
| 1279 | + $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 ); |
|
| 1280 | + $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
|
| 1281 | 1281 | |
| 1282 | - $jsonld_cache = new Ttl_Cache( 'jsonld', 86400 ); |
|
| 1283 | - $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache ); |
|
| 1284 | - $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter ); |
|
| 1282 | + $jsonld_cache = new Ttl_Cache( 'jsonld', 86400 ); |
|
| 1283 | + $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache ); |
|
| 1284 | + $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter ); |
|
| 1285 | 1285 | |
| 1286 | - /* |
|
| 1286 | + /* |
|
| 1287 | 1287 | * Load the `Wordlift_Term_JsonLd_Adapter`. |
| 1288 | 1288 | * |
| 1289 | 1289 | * @see https://github.com/insideout10/wordlift-plugin/issues/892 |
| 1290 | 1290 | * |
| 1291 | 1291 | * @since 3.20.0 |
| 1292 | 1292 | */ |
| 1293 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1294 | - $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->jsonld_service ); |
|
| 1295 | - $jsonld_service = new Jsonld_Service( |
|
| 1296 | - $this->jsonld_service, |
|
| 1297 | - $term_jsonld_adapter, |
|
| 1298 | - new Jsonld_User_Service( $this->user_service ) ); |
|
| 1299 | - new Jsonld_Endpoint( $jsonld_service, $this->entity_uri_service ); |
|
| 1300 | - |
|
| 1301 | - // Prints the JSON-LD in the head. |
|
| 1302 | - new Jsonld_Adapter( $this->jsonld_service ); |
|
| 1303 | - |
|
| 1304 | - new Jsonld_By_Id_Endpoint( $this->jsonld_service, $this->entity_uri_service ); |
|
| 1305 | - |
|
| 1306 | - $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
|
| 1307 | - $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service ); |
|
| 1308 | - // Creating Faq Content filter service. |
|
| 1309 | - $this->faq_content_filter_service = new Faq_Content_Filter(); |
|
| 1310 | - $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
|
| 1311 | - $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service ); |
|
| 1312 | - $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
|
| 1313 | - $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->entity_service ); |
|
| 1314 | - |
|
| 1315 | - $this->loader->add_action( 'enqueue_block_editor_assets', $this, 'add_wl_enabled_blocks' ); |
|
| 1316 | - |
|
| 1317 | - /** |
|
| 1318 | - * Filter: wl_feature__enable__blocks. |
|
| 1319 | - * |
|
| 1320 | - * @param bool whether the blocks needed to be registered, defaults to true. |
|
| 1321 | - * |
|
| 1322 | - * @return bool |
|
| 1323 | - * @since 3.27.6 |
|
| 1324 | - */ |
|
| 1325 | - if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 1326 | - // Initialize the short-codes. |
|
| 1327 | - new Async_Template_Decorator( new Wordlift_Navigator_Shortcode() ); |
|
| 1328 | - new Wordlift_Chord_Shortcode(); |
|
| 1329 | - new Wordlift_Geomap_Shortcode(); |
|
| 1330 | - new Wordlift_Timeline_Shortcode(); |
|
| 1331 | - new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
|
| 1332 | - new Wordlift_Vocabulary_Shortcode( $this->configuration_service ); |
|
| 1333 | - new Async_Template_Decorator( new Wordlift_Faceted_Search_Shortcode() ); |
|
| 1334 | - } |
|
| 1335 | - |
|
| 1336 | - new Wordlift_Products_Navigator_Shortcode(); |
|
| 1337 | - |
|
| 1338 | - |
|
| 1339 | - // Initialize the Context Cards Service |
|
| 1340 | - $this->context_cards_service = new Wordlift_Context_Cards_Service(); |
|
| 1341 | - |
|
| 1342 | - // Initialize the SEO service. |
|
| 1343 | - new Wordlift_Seo_Service(); |
|
| 1344 | - |
|
| 1345 | - // Initialize the AMP service. |
|
| 1346 | - new Wordlift_AMP_Service( $this->jsonld_service ); |
|
| 1347 | - |
|
| 1348 | - /** Services. */ |
|
| 1349 | - $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
|
| 1350 | - new Wordlift_Image_Service(); |
|
| 1351 | - |
|
| 1352 | - /** Adapters. */ |
|
| 1353 | - $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
|
| 1354 | - $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service ); |
|
| 1355 | - $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 1356 | - //$this->faq_tinymce_adapter = new Faq_Tinymce_Adapter(); |
|
| 1357 | - $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
|
| 1358 | - |
|
| 1359 | - /* |
|
| 1293 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1294 | + $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->jsonld_service ); |
|
| 1295 | + $jsonld_service = new Jsonld_Service( |
|
| 1296 | + $this->jsonld_service, |
|
| 1297 | + $term_jsonld_adapter, |
|
| 1298 | + new Jsonld_User_Service( $this->user_service ) ); |
|
| 1299 | + new Jsonld_Endpoint( $jsonld_service, $this->entity_uri_service ); |
|
| 1300 | + |
|
| 1301 | + // Prints the JSON-LD in the head. |
|
| 1302 | + new Jsonld_Adapter( $this->jsonld_service ); |
|
| 1303 | + |
|
| 1304 | + new Jsonld_By_Id_Endpoint( $this->jsonld_service, $this->entity_uri_service ); |
|
| 1305 | + |
|
| 1306 | + $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
|
| 1307 | + $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service ); |
|
| 1308 | + // Creating Faq Content filter service. |
|
| 1309 | + $this->faq_content_filter_service = new Faq_Content_Filter(); |
|
| 1310 | + $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
|
| 1311 | + $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service ); |
|
| 1312 | + $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
|
| 1313 | + $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->entity_service ); |
|
| 1314 | + |
|
| 1315 | + $this->loader->add_action( 'enqueue_block_editor_assets', $this, 'add_wl_enabled_blocks' ); |
|
| 1316 | + |
|
| 1317 | + /** |
|
| 1318 | + * Filter: wl_feature__enable__blocks. |
|
| 1319 | + * |
|
| 1320 | + * @param bool whether the blocks needed to be registered, defaults to true. |
|
| 1321 | + * |
|
| 1322 | + * @return bool |
|
| 1323 | + * @since 3.27.6 |
|
| 1324 | + */ |
|
| 1325 | + if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 1326 | + // Initialize the short-codes. |
|
| 1327 | + new Async_Template_Decorator( new Wordlift_Navigator_Shortcode() ); |
|
| 1328 | + new Wordlift_Chord_Shortcode(); |
|
| 1329 | + new Wordlift_Geomap_Shortcode(); |
|
| 1330 | + new Wordlift_Timeline_Shortcode(); |
|
| 1331 | + new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
|
| 1332 | + new Wordlift_Vocabulary_Shortcode( $this->configuration_service ); |
|
| 1333 | + new Async_Template_Decorator( new Wordlift_Faceted_Search_Shortcode() ); |
|
| 1334 | + } |
|
| 1335 | + |
|
| 1336 | + new Wordlift_Products_Navigator_Shortcode(); |
|
| 1337 | + |
|
| 1338 | + |
|
| 1339 | + // Initialize the Context Cards Service |
|
| 1340 | + $this->context_cards_service = new Wordlift_Context_Cards_Service(); |
|
| 1341 | + |
|
| 1342 | + // Initialize the SEO service. |
|
| 1343 | + new Wordlift_Seo_Service(); |
|
| 1344 | + |
|
| 1345 | + // Initialize the AMP service. |
|
| 1346 | + new Wordlift_AMP_Service( $this->jsonld_service ); |
|
| 1347 | + |
|
| 1348 | + /** Services. */ |
|
| 1349 | + $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
|
| 1350 | + new Wordlift_Image_Service(); |
|
| 1351 | + |
|
| 1352 | + /** Adapters. */ |
|
| 1353 | + $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
|
| 1354 | + $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service ); |
|
| 1355 | + $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 1356 | + //$this->faq_tinymce_adapter = new Faq_Tinymce_Adapter(); |
|
| 1357 | + $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
|
| 1358 | + |
|
| 1359 | + /* |
|
| 1360 | 1360 | * Exclude our public js from WP-Rocket. |
| 1361 | 1361 | * |
| 1362 | 1362 | * @since 3.19.4 |
| 1363 | 1363 | * |
| 1364 | 1364 | * @see https://github.com/insideout10/wordlift-plugin/issues/842. |
| 1365 | 1365 | */ |
| 1366 | - new Wordlift_WpRocket_Adapter(); |
|
| 1367 | - |
|
| 1368 | - // Create a Rebuild Service instance, which we'll later bound to an ajax call. |
|
| 1369 | - $this->rebuild_service = new Wordlift_Rebuild_Service( |
|
| 1370 | - $this->sparql_service, |
|
| 1371 | - $uri_service |
|
| 1372 | - ); |
|
| 1373 | - |
|
| 1374 | - $that = $this; |
|
| 1375 | - add_action( 'plugins_loaded', function () use ( $that ) { |
|
| 1376 | - if ( ! apply_filters( 'wl_feature__enable__dataset-ng', false ) ) { |
|
| 1377 | - new Wordlift_Linked_Data_Service( $that->entity_service, $that->entity_type_service, $that->schema_service, $that->sparql_service ); |
|
| 1378 | - new Wordlift_Sparql_Query_Async_Task(); |
|
| 1379 | - new Wordlift_Push_References_Async_Task(); |
|
| 1380 | - } |
|
| 1381 | - } ); |
|
| 1382 | - |
|
| 1383 | - /** WordPress Admin UI. */ |
|
| 1384 | - |
|
| 1385 | - // UI elements. |
|
| 1386 | - $this->input_element = new Wordlift_Admin_Input_Element(); |
|
| 1387 | - $this->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
|
| 1388 | - $this->select2_element = new Wordlift_Admin_Select2_Element(); |
|
| 1389 | - $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
|
| 1390 | - $this->country_select_element = new Wordlift_Admin_Country_Select_Element(); |
|
| 1391 | - $tabs_element = new Wordlift_Admin_Tabs_Element(); |
|
| 1392 | - $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element ); |
|
| 1393 | - $this->author_element = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element ); |
|
| 1394 | - |
|
| 1395 | - $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 ); |
|
| 1396 | - $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 1397 | - |
|
| 1398 | - $this->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element ); |
|
| 1399 | - $this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page ); |
|
| 1400 | - $this->analytics_connect = new Wordlift_Analytics_Connect(); |
|
| 1401 | - |
|
| 1402 | - // Pages. |
|
| 1403 | - /* |
|
| 1366 | + new Wordlift_WpRocket_Adapter(); |
|
| 1367 | + |
|
| 1368 | + // Create a Rebuild Service instance, which we'll later bound to an ajax call. |
|
| 1369 | + $this->rebuild_service = new Wordlift_Rebuild_Service( |
|
| 1370 | + $this->sparql_service, |
|
| 1371 | + $uri_service |
|
| 1372 | + ); |
|
| 1373 | + |
|
| 1374 | + $that = $this; |
|
| 1375 | + add_action( 'plugins_loaded', function () use ( $that ) { |
|
| 1376 | + if ( ! apply_filters( 'wl_feature__enable__dataset-ng', false ) ) { |
|
| 1377 | + new Wordlift_Linked_Data_Service( $that->entity_service, $that->entity_type_service, $that->schema_service, $that->sparql_service ); |
|
| 1378 | + new Wordlift_Sparql_Query_Async_Task(); |
|
| 1379 | + new Wordlift_Push_References_Async_Task(); |
|
| 1380 | + } |
|
| 1381 | + } ); |
|
| 1382 | + |
|
| 1383 | + /** WordPress Admin UI. */ |
|
| 1384 | + |
|
| 1385 | + // UI elements. |
|
| 1386 | + $this->input_element = new Wordlift_Admin_Input_Element(); |
|
| 1387 | + $this->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
|
| 1388 | + $this->select2_element = new Wordlift_Admin_Select2_Element(); |
|
| 1389 | + $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
|
| 1390 | + $this->country_select_element = new Wordlift_Admin_Country_Select_Element(); |
|
| 1391 | + $tabs_element = new Wordlift_Admin_Tabs_Element(); |
|
| 1392 | + $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element ); |
|
| 1393 | + $this->author_element = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element ); |
|
| 1394 | + |
|
| 1395 | + $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 ); |
|
| 1396 | + $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 1397 | + |
|
| 1398 | + $this->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element ); |
|
| 1399 | + $this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page ); |
|
| 1400 | + $this->analytics_connect = new Wordlift_Analytics_Connect(); |
|
| 1401 | + |
|
| 1402 | + // Pages. |
|
| 1403 | + /* |
|
| 1404 | 1404 | * Call the `wl_can_see_classification_box` filter to determine whether we can display the classification box. |
| 1405 | 1405 | * |
| 1406 | 1406 | * @since 3.20.3 |
| 1407 | 1407 | * |
| 1408 | 1408 | * @see https://github.com/insideout10/wordlift-plugin/issues/914 |
| 1409 | 1409 | */ |
| 1410 | - if ( apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 1411 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1412 | - new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 1413 | - } |
|
| 1414 | - new Wordlift_Entity_Type_Admin_Service(); |
|
| 1410 | + if ( apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 1411 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1412 | + new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 1413 | + } |
|
| 1414 | + new Wordlift_Entity_Type_Admin_Service(); |
|
| 1415 | 1415 | |
| 1416 | - // create an instance of the entity type list admin page controller. |
|
| 1417 | - $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
|
| 1416 | + // create an instance of the entity type list admin page controller. |
|
| 1417 | + $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
|
| 1418 | 1418 | |
| 1419 | - // create an instance of the entity type setting admin page controller. |
|
| 1420 | - $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
|
| 1419 | + // create an instance of the entity type setting admin page controller. |
|
| 1420 | + $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
|
| 1421 | 1421 | |
| 1422 | - /** Widgets */ |
|
| 1423 | - $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
|
| 1422 | + /** Widgets */ |
|
| 1423 | + $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
|
| 1424 | 1424 | |
| 1425 | - /* WordPress Admin. */ |
|
| 1426 | - $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 1427 | - $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 1425 | + /* WordPress Admin. */ |
|
| 1426 | + $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 1427 | + $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 1428 | 1428 | |
| 1429 | - // Create an instance of the install wizard. |
|
| 1430 | - $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 ); |
|
| 1429 | + // Create an instance of the install wizard. |
|
| 1430 | + $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 ); |
|
| 1431 | 1431 | |
| 1432 | - $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1432 | + $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1433 | 1433 | |
| 1434 | - // User Profile. |
|
| 1435 | - new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1434 | + // User Profile. |
|
| 1435 | + new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1436 | 1436 | |
| 1437 | - $this->entity_page_service = new Wordlift_Entity_Page_Service(); |
|
| 1437 | + $this->entity_page_service = new Wordlift_Entity_Page_Service(); |
|
| 1438 | 1438 | |
| 1439 | - // Load the debug service if WP is in debug mode. |
|
| 1440 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1441 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1442 | - new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1443 | - } |
|
| 1439 | + // Load the debug service if WP is in debug mode. |
|
| 1440 | + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1441 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1442 | + new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1443 | + } |
|
| 1444 | 1444 | |
| 1445 | - // Remote Image Service. |
|
| 1446 | - new Wordlift_Remote_Image_Service(); |
|
| 1445 | + // Remote Image Service. |
|
| 1446 | + new Wordlift_Remote_Image_Service(); |
|
| 1447 | 1447 | |
| 1448 | - /* |
|
| 1448 | + /* |
|
| 1449 | 1449 | * Provides mappings between post types and entity types. |
| 1450 | 1450 | * |
| 1451 | 1451 | * @since 3.20.0 |
| 1452 | 1452 | * |
| 1453 | 1453 | * @see https://github.com/insideout10/wordlift-plugin/issues/852. |
| 1454 | 1454 | */ |
| 1455 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php'; |
|
| 1456 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1457 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1455 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php'; |
|
| 1456 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1457 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1458 | 1458 | |
| 1459 | - // Create an instance of the Mapping Service and assign it to the Ajax Adapter. |
|
| 1460 | - new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) ); |
|
| 1459 | + // Create an instance of the Mapping Service and assign it to the Ajax Adapter. |
|
| 1460 | + new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) ); |
|
| 1461 | 1461 | |
| 1462 | - /* |
|
| 1462 | + /* |
|
| 1463 | 1463 | * Batch Operations. They're similar to Batch Actions but do not require working on post types. |
| 1464 | 1464 | * |
| 1465 | 1465 | * Eventually Batch Actions will become Batch Operations. |
| 1466 | 1466 | * |
| 1467 | 1467 | * @since 3.20.0 |
| 1468 | 1468 | */ |
| 1469 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1470 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1469 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1470 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1471 | 1471 | |
| 1472 | - /* |
|
| 1472 | + /* |
|
| 1473 | 1473 | * Add the Search Keywords taxonomy to manage the Search Keywords on WLS. |
| 1474 | 1474 | * |
| 1475 | 1475 | * @link https://github.com/insideout10/wordlift-plugin/issues/761 |
| 1476 | 1476 | * |
| 1477 | 1477 | * @since 3.20.0 |
| 1478 | 1478 | */ |
| 1479 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php'; |
|
| 1480 | - new Wordlift_Search_Keyword_Taxonomy( $api_service ); |
|
| 1479 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php'; |
|
| 1480 | + new Wordlift_Search_Keyword_Taxonomy( $api_service ); |
|
| 1481 | 1481 | |
| 1482 | - /* |
|
| 1482 | + /* |
|
| 1483 | 1483 | * Load the Mappings JSON-LD post processing. |
| 1484 | 1484 | * |
| 1485 | 1485 | * @since 3.25.0 |
| 1486 | 1486 | */ |
| 1487 | 1487 | |
| 1488 | - $mappings_dbo = new Mappings_DBO(); |
|
| 1489 | - $default_rule_validator = new Taxonomy_Rule_Validator(); |
|
| 1490 | - new Post_Type_Rule_Validator(); |
|
| 1491 | - // Taxonomy term rule validator for validating rules for term pages. |
|
| 1492 | - new Taxonomy_Term_Rule_Validator(); |
|
| 1493 | - new Post_Taxonomy_Term_Rule_Validator(); |
|
| 1494 | - $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator ); |
|
| 1495 | - $rule_groups_validator = new Rule_Groups_Validator( $rule_validators_registry ); |
|
| 1496 | - $mappings_validator = new Mappings_Validator( $mappings_dbo, $rule_groups_validator ); |
|
| 1497 | - |
|
| 1498 | - new Url_To_Entity_Transform_Function( $this->entity_uri_service ); |
|
| 1499 | - new Taxonomy_To_Terms_Transform_Function(); |
|
| 1500 | - new Post_Id_To_Entity_Transform_Function(); |
|
| 1501 | - $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry(); |
|
| 1502 | - |
|
| 1503 | - /** |
|
| 1504 | - * @since 3.27.1 |
|
| 1505 | - * Intiailize the acf group data formatter. |
|
| 1506 | - */ |
|
| 1507 | - new Acf_Group_Formatter(); |
|
| 1508 | - new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry ); |
|
| 1509 | - |
|
| 1510 | - /** |
|
| 1511 | - * @since 3.26.0 |
|
| 1512 | - * Initialize the Faq JSON LD converter here - disabled. |
|
| 1513 | - */ |
|
| 1514 | - // new Faq_To_Jsonld_Converter(); |
|
| 1515 | - /* |
|
| 1488 | + $mappings_dbo = new Mappings_DBO(); |
|
| 1489 | + $default_rule_validator = new Taxonomy_Rule_Validator(); |
|
| 1490 | + new Post_Type_Rule_Validator(); |
|
| 1491 | + // Taxonomy term rule validator for validating rules for term pages. |
|
| 1492 | + new Taxonomy_Term_Rule_Validator(); |
|
| 1493 | + new Post_Taxonomy_Term_Rule_Validator(); |
|
| 1494 | + $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator ); |
|
| 1495 | + $rule_groups_validator = new Rule_Groups_Validator( $rule_validators_registry ); |
|
| 1496 | + $mappings_validator = new Mappings_Validator( $mappings_dbo, $rule_groups_validator ); |
|
| 1497 | + |
|
| 1498 | + new Url_To_Entity_Transform_Function( $this->entity_uri_service ); |
|
| 1499 | + new Taxonomy_To_Terms_Transform_Function(); |
|
| 1500 | + new Post_Id_To_Entity_Transform_Function(); |
|
| 1501 | + $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry(); |
|
| 1502 | + |
|
| 1503 | + /** |
|
| 1504 | + * @since 3.27.1 |
|
| 1505 | + * Intiailize the acf group data formatter. |
|
| 1506 | + */ |
|
| 1507 | + new Acf_Group_Formatter(); |
|
| 1508 | + new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry ); |
|
| 1509 | + |
|
| 1510 | + /** |
|
| 1511 | + * @since 3.26.0 |
|
| 1512 | + * Initialize the Faq JSON LD converter here - disabled. |
|
| 1513 | + */ |
|
| 1514 | + // new Faq_To_Jsonld_Converter(); |
|
| 1515 | + /* |
|
| 1516 | 1516 | * Use the Templates Ajax Endpoint to load HTML templates for the legacy Angular app via admin-ajax.php |
| 1517 | 1517 | * end-point. |
| 1518 | 1518 | * |
| 1519 | 1519 | * @see https://github.com/insideout10/wordlift-plugin/issues/834 |
| 1520 | 1520 | * @since 3.24.4 |
| 1521 | 1521 | */ |
| 1522 | - new Templates_Ajax_Endpoint(); |
|
| 1523 | - // Call this static method to register FAQ routes to rest api - disabled |
|
| 1524 | - //Faq_Rest_Controller::register_routes(); |
|
| 1522 | + new Templates_Ajax_Endpoint(); |
|
| 1523 | + // Call this static method to register FAQ routes to rest api - disabled |
|
| 1524 | + //Faq_Rest_Controller::register_routes(); |
|
| 1525 | 1525 | |
| 1526 | - /* |
|
| 1526 | + /* |
|
| 1527 | 1527 | * Create a singleton for the Analysis_Response_Ops_Factory. |
| 1528 | 1528 | */ |
| 1529 | - $entity_helper = new Entity_Helper( $this->entity_uri_service, $this->entity_service ); |
|
| 1530 | - new Analysis_Response_Ops_Factory( |
|
| 1531 | - $this->entity_uri_service, |
|
| 1532 | - $this->entity_service, |
|
| 1533 | - $this->entity_type_service, |
|
| 1534 | - $this->storage_factory->post_images(), |
|
| 1535 | - $entity_helper |
|
| 1536 | - ); |
|
| 1537 | - |
|
| 1538 | - /** WL Autocomplete. */ |
|
| 1539 | - $autocomplete_service = new All_Autocomplete_Service( array( |
|
| 1540 | - new Local_Autocomplete_Service(), |
|
| 1541 | - new Linked_Data_Autocomplete_Service( $this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service ), |
|
| 1542 | - ) ); |
|
| 1543 | - $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service ); |
|
| 1544 | - |
|
| 1545 | - /** |
|
| 1546 | - * @since 3.27.2 |
|
| 1547 | - * Integrate the recipe maker jsonld & set recipe |
|
| 1548 | - * as default entity type to the wprm_recipe CPT. |
|
| 1549 | - */ |
|
| 1550 | - new Recipe_Maker_Post_Type_Hook(); |
|
| 1551 | - $recipe_maker_validation_service = new Recipe_Maker_Validation_Service(); |
|
| 1552 | - new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service ); |
|
| 1553 | - new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service ); |
|
| 1554 | - new Recipe_Maker_Warning( $recipe_maker_validation_service ); |
|
| 1555 | - new Yoast_Jsonld( $recipe_maker_validation_service ); |
|
| 1556 | - |
|
| 1557 | - /** |
|
| 1558 | - * @since 3.27.4 |
|
| 1559 | - * Add the faq duplicate markup hook. |
|
| 1560 | - */ |
|
| 1561 | - new Faq_Duplicate_Markup_Remover(); |
|
| 1562 | - /** |
|
| 1563 | - * @since 3.27.8 |
|
| 1564 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1248 |
|
| 1565 | - */ |
|
| 1566 | - new Key_Validation_Notice( $this->key_validation_service, $this->configuration_service ); |
|
| 1567 | - /** |
|
| 1568 | - * @since 3.29.0 |
|
| 1569 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1304 |
|
| 1570 | - */ |
|
| 1571 | - new Entity_Rest_Service( $this->entity_type_service ); |
|
| 1572 | - |
|
| 1573 | - /** |
|
| 1574 | - * Expand author in to references. |
|
| 1575 | - * @since 3.30.0 |
|
| 1576 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1318 |
|
| 1577 | - */ |
|
| 1578 | - add_action('plugins_loaded', function () use ( $that ) { |
|
| 1579 | - |
|
| 1580 | - if ( apply_filters( 'wl_feature__enable__article-wrapper', false ) ) { |
|
| 1581 | - new Jsonld_Article_Wrapper( Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter ); |
|
| 1582 | - } |
|
| 1583 | - |
|
| 1584 | - |
|
| 1585 | - }); |
|
| 1586 | - |
|
| 1587 | - } |
|
| 1588 | - |
|
| 1589 | - /** |
|
| 1590 | - * Define the locale for this plugin for internationalization. |
|
| 1591 | - * |
|
| 1592 | - * Uses the Wordlift_i18n class in order to set the domain and to register the hook |
|
| 1593 | - * with WordPress. |
|
| 1594 | - * |
|
| 1595 | - * @since 1.0.0 |
|
| 1596 | - * @access private |
|
| 1597 | - */ |
|
| 1598 | - private function set_locale() { |
|
| 1599 | - |
|
| 1600 | - $plugin_i18n = new Wordlift_i18n(); |
|
| 1601 | - $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1602 | - |
|
| 1603 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1604 | - |
|
| 1605 | - } |
|
| 1606 | - |
|
| 1607 | - /** |
|
| 1608 | - * Register all of the hooks related to the admin area functionality |
|
| 1609 | - * of the plugin. |
|
| 1610 | - * |
|
| 1611 | - * @since 1.0.0 |
|
| 1612 | - * @access private |
|
| 1613 | - */ |
|
| 1614 | - private function define_admin_hooks() { |
|
| 1615 | - |
|
| 1616 | - $plugin_admin = new Wordlift_Admin( |
|
| 1617 | - $this->get_plugin_name(), |
|
| 1618 | - $this->get_version(), |
|
| 1619 | - $this->configuration_service, |
|
| 1620 | - $this->notice_service, |
|
| 1621 | - $this->user_service |
|
| 1622 | - ); |
|
| 1623 | - |
|
| 1624 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1625 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 ); |
|
| 1626 | - |
|
| 1627 | - // Hook the init action to taxonomy services. |
|
| 1628 | - $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1629 | - $this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 ); |
|
| 1630 | - |
|
| 1631 | - // Hook the deleted_post_meta action to the Thumbnail service. |
|
| 1632 | - $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1633 | - |
|
| 1634 | - // Hook the added_post_meta action to the Thumbnail service. |
|
| 1635 | - $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1636 | - |
|
| 1637 | - // Hook the updated_post_meta action to the Thumbnail service. |
|
| 1638 | - $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1639 | - |
|
| 1640 | - // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1641 | - $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1642 | - |
|
| 1643 | - // Register custom allowed redirect hosts. |
|
| 1644 | - $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1645 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1646 | - $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1647 | - |
|
| 1648 | - /* |
|
| 1529 | + $entity_helper = new Entity_Helper( $this->entity_uri_service, $this->entity_service ); |
|
| 1530 | + new Analysis_Response_Ops_Factory( |
|
| 1531 | + $this->entity_uri_service, |
|
| 1532 | + $this->entity_service, |
|
| 1533 | + $this->entity_type_service, |
|
| 1534 | + $this->storage_factory->post_images(), |
|
| 1535 | + $entity_helper |
|
| 1536 | + ); |
|
| 1537 | + |
|
| 1538 | + /** WL Autocomplete. */ |
|
| 1539 | + $autocomplete_service = new All_Autocomplete_Service( array( |
|
| 1540 | + new Local_Autocomplete_Service(), |
|
| 1541 | + new Linked_Data_Autocomplete_Service( $this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service ), |
|
| 1542 | + ) ); |
|
| 1543 | + $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service ); |
|
| 1544 | + |
|
| 1545 | + /** |
|
| 1546 | + * @since 3.27.2 |
|
| 1547 | + * Integrate the recipe maker jsonld & set recipe |
|
| 1548 | + * as default entity type to the wprm_recipe CPT. |
|
| 1549 | + */ |
|
| 1550 | + new Recipe_Maker_Post_Type_Hook(); |
|
| 1551 | + $recipe_maker_validation_service = new Recipe_Maker_Validation_Service(); |
|
| 1552 | + new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service ); |
|
| 1553 | + new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service ); |
|
| 1554 | + new Recipe_Maker_Warning( $recipe_maker_validation_service ); |
|
| 1555 | + new Yoast_Jsonld( $recipe_maker_validation_service ); |
|
| 1556 | + |
|
| 1557 | + /** |
|
| 1558 | + * @since 3.27.4 |
|
| 1559 | + * Add the faq duplicate markup hook. |
|
| 1560 | + */ |
|
| 1561 | + new Faq_Duplicate_Markup_Remover(); |
|
| 1562 | + /** |
|
| 1563 | + * @since 3.27.8 |
|
| 1564 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1248 |
|
| 1565 | + */ |
|
| 1566 | + new Key_Validation_Notice( $this->key_validation_service, $this->configuration_service ); |
|
| 1567 | + /** |
|
| 1568 | + * @since 3.29.0 |
|
| 1569 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1304 |
|
| 1570 | + */ |
|
| 1571 | + new Entity_Rest_Service( $this->entity_type_service ); |
|
| 1572 | + |
|
| 1573 | + /** |
|
| 1574 | + * Expand author in to references. |
|
| 1575 | + * @since 3.30.0 |
|
| 1576 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1318 |
|
| 1577 | + */ |
|
| 1578 | + add_action('plugins_loaded', function () use ( $that ) { |
|
| 1579 | + |
|
| 1580 | + if ( apply_filters( 'wl_feature__enable__article-wrapper', false ) ) { |
|
| 1581 | + new Jsonld_Article_Wrapper( Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter ); |
|
| 1582 | + } |
|
| 1583 | + |
|
| 1584 | + |
|
| 1585 | + }); |
|
| 1586 | + |
|
| 1587 | + } |
|
| 1588 | + |
|
| 1589 | + /** |
|
| 1590 | + * Define the locale for this plugin for internationalization. |
|
| 1591 | + * |
|
| 1592 | + * Uses the Wordlift_i18n class in order to set the domain and to register the hook |
|
| 1593 | + * with WordPress. |
|
| 1594 | + * |
|
| 1595 | + * @since 1.0.0 |
|
| 1596 | + * @access private |
|
| 1597 | + */ |
|
| 1598 | + private function set_locale() { |
|
| 1599 | + |
|
| 1600 | + $plugin_i18n = new Wordlift_i18n(); |
|
| 1601 | + $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1602 | + |
|
| 1603 | + $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1604 | + |
|
| 1605 | + } |
|
| 1606 | + |
|
| 1607 | + /** |
|
| 1608 | + * Register all of the hooks related to the admin area functionality |
|
| 1609 | + * of the plugin. |
|
| 1610 | + * |
|
| 1611 | + * @since 1.0.0 |
|
| 1612 | + * @access private |
|
| 1613 | + */ |
|
| 1614 | + private function define_admin_hooks() { |
|
| 1615 | + |
|
| 1616 | + $plugin_admin = new Wordlift_Admin( |
|
| 1617 | + $this->get_plugin_name(), |
|
| 1618 | + $this->get_version(), |
|
| 1619 | + $this->configuration_service, |
|
| 1620 | + $this->notice_service, |
|
| 1621 | + $this->user_service |
|
| 1622 | + ); |
|
| 1623 | + |
|
| 1624 | + $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1625 | + $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 ); |
|
| 1626 | + |
|
| 1627 | + // Hook the init action to taxonomy services. |
|
| 1628 | + $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1629 | + $this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 ); |
|
| 1630 | + |
|
| 1631 | + // Hook the deleted_post_meta action to the Thumbnail service. |
|
| 1632 | + $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1633 | + |
|
| 1634 | + // Hook the added_post_meta action to the Thumbnail service. |
|
| 1635 | + $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1636 | + |
|
| 1637 | + // Hook the updated_post_meta action to the Thumbnail service. |
|
| 1638 | + $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1639 | + |
|
| 1640 | + // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1641 | + $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1642 | + |
|
| 1643 | + // Register custom allowed redirect hosts. |
|
| 1644 | + $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1645 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1646 | + $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1647 | + |
|
| 1648 | + /* |
|
| 1649 | 1649 | * The old dashboard is replaced with dashboard v2. |
| 1650 | 1650 | * |
| 1651 | 1651 | * The old dashboard service is still loaded because its functions are used. |
@@ -1654,389 +1654,389 @@ discard block |
||
| 1654 | 1654 | * |
| 1655 | 1655 | * @since 3.20.0 |
| 1656 | 1656 | */ |
| 1657 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1658 | - // $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' ); |
|
| 1659 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1660 | - // $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' ); |
|
| 1661 | - |
|
| 1662 | - // Hook save_post to the entity service to update custom fields (such as alternate labels). |
|
| 1663 | - // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
|
| 1664 | - $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1665 | - $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1666 | - |
|
| 1667 | - $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1668 | - $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1669 | - |
|
| 1670 | - // Entity listing customization (wp-admin/edit.php) |
|
| 1671 | - // Add custom columns. |
|
| 1672 | - $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1673 | - // no explicit entity as it prevents handling of other post types. |
|
| 1674 | - $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1675 | - // Add 4W selection. |
|
| 1676 | - $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1677 | - $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1678 | - $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' ); |
|
| 1679 | - $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' ); |
|
| 1680 | - |
|
| 1681 | - /* |
|
| 1657 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1658 | + // $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' ); |
|
| 1659 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1660 | + // $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' ); |
|
| 1661 | + |
|
| 1662 | + // Hook save_post to the entity service to update custom fields (such as alternate labels). |
|
| 1663 | + // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
|
| 1664 | + $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1665 | + $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1666 | + |
|
| 1667 | + $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1668 | + $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1669 | + |
|
| 1670 | + // Entity listing customization (wp-admin/edit.php) |
|
| 1671 | + // Add custom columns. |
|
| 1672 | + $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1673 | + // no explicit entity as it prevents handling of other post types. |
|
| 1674 | + $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1675 | + // Add 4W selection. |
|
| 1676 | + $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1677 | + $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1678 | + $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' ); |
|
| 1679 | + $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' ); |
|
| 1680 | + |
|
| 1681 | + /* |
|
| 1682 | 1682 | * If `All Entity Types` is disable, use the radio button Walker. |
| 1683 | 1683 | * |
| 1684 | 1684 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1685 | 1685 | */ |
| 1686 | - if ( ! WL_ALL_ENTITY_TYPES ) { |
|
| 1687 | - $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1688 | - } |
|
| 1689 | - |
|
| 1690 | - // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
|
| 1691 | - // entities. |
|
| 1692 | - $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1693 | - |
|
| 1694 | - // Filter imported post meta. |
|
| 1695 | - $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1696 | - |
|
| 1697 | - // Notify the import service when an import starts and ends. |
|
| 1698 | - $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1699 | - $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1700 | - |
|
| 1701 | - // Hook the AJAX wl_rebuild action to the Rebuild Service. |
|
| 1702 | - $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1703 | - $this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' ); |
|
| 1704 | - |
|
| 1705 | - /** |
|
| 1706 | - * Filter: wl_feature__enable__screens. |
|
| 1707 | - * |
|
| 1708 | - * @param bool whether the screens needed to be registered, defaults to true. |
|
| 1709 | - * |
|
| 1710 | - * @return bool |
|
| 1711 | - * @since 3.27.6 |
|
| 1712 | - */ |
|
| 1713 | - if ( apply_filters( 'wl_feature__enable__screens', true ) ) { |
|
| 1714 | - // Hook the menu to the Download Your Data page. |
|
| 1715 | - $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 ); |
|
| 1716 | - $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 ); |
|
| 1717 | - $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 ); |
|
| 1718 | - } |
|
| 1719 | - // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
|
| 1720 | - $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1721 | - |
|
| 1722 | - // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1723 | - $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1724 | - $this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1725 | - $this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1726 | - |
|
| 1727 | - // Hook the AJAX wl_validate_key action to the Key Validation service. |
|
| 1728 | - $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1729 | - |
|
| 1730 | - // Hook the AJAX wl_update_country_options action to the countries. |
|
| 1731 | - $this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' ); |
|
| 1732 | - |
|
| 1733 | - // Hook the `admin_init` function to the Admin Setup. |
|
| 1734 | - $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1735 | - |
|
| 1736 | - // Hook the admin_init to the settings page. |
|
| 1737 | - $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1738 | - $this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' ); |
|
| 1739 | - |
|
| 1740 | - $this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' ); |
|
| 1741 | - |
|
| 1742 | - // Hook the menu creation on the general wordlift menu creation. |
|
| 1743 | - /** |
|
| 1744 | - * Filter: wl_feature__enable__screens. |
|
| 1745 | - * |
|
| 1746 | - * @param bool whether the screens needed to be registered, defaults to true. |
|
| 1747 | - * |
|
| 1748 | - * @return bool |
|
| 1749 | - * @since 3.27.6 |
|
| 1750 | - */ |
|
| 1751 | - if ( apply_filters( 'wl_feature__enable__screens', true ) ) { |
|
| 1752 | - $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 ); |
|
| 1753 | - } |
|
| 1754 | - /* |
|
| 1686 | + if ( ! WL_ALL_ENTITY_TYPES ) { |
|
| 1687 | + $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1688 | + } |
|
| 1689 | + |
|
| 1690 | + // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
|
| 1691 | + // entities. |
|
| 1692 | + $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1693 | + |
|
| 1694 | + // Filter imported post meta. |
|
| 1695 | + $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1696 | + |
|
| 1697 | + // Notify the import service when an import starts and ends. |
|
| 1698 | + $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1699 | + $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1700 | + |
|
| 1701 | + // Hook the AJAX wl_rebuild action to the Rebuild Service. |
|
| 1702 | + $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1703 | + $this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' ); |
|
| 1704 | + |
|
| 1705 | + /** |
|
| 1706 | + * Filter: wl_feature__enable__screens. |
|
| 1707 | + * |
|
| 1708 | + * @param bool whether the screens needed to be registered, defaults to true. |
|
| 1709 | + * |
|
| 1710 | + * @return bool |
|
| 1711 | + * @since 3.27.6 |
|
| 1712 | + */ |
|
| 1713 | + if ( apply_filters( 'wl_feature__enable__screens', true ) ) { |
|
| 1714 | + // Hook the menu to the Download Your Data page. |
|
| 1715 | + $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 ); |
|
| 1716 | + $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 ); |
|
| 1717 | + $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 ); |
|
| 1718 | + } |
|
| 1719 | + // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
|
| 1720 | + $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1721 | + |
|
| 1722 | + // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1723 | + $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1724 | + $this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1725 | + $this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1726 | + |
|
| 1727 | + // Hook the AJAX wl_validate_key action to the Key Validation service. |
|
| 1728 | + $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1729 | + |
|
| 1730 | + // Hook the AJAX wl_update_country_options action to the countries. |
|
| 1731 | + $this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' ); |
|
| 1732 | + |
|
| 1733 | + // Hook the `admin_init` function to the Admin Setup. |
|
| 1734 | + $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1735 | + |
|
| 1736 | + // Hook the admin_init to the settings page. |
|
| 1737 | + $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1738 | + $this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' ); |
|
| 1739 | + |
|
| 1740 | + $this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' ); |
|
| 1741 | + |
|
| 1742 | + // Hook the menu creation on the general wordlift menu creation. |
|
| 1743 | + /** |
|
| 1744 | + * Filter: wl_feature__enable__screens. |
|
| 1745 | + * |
|
| 1746 | + * @param bool whether the screens needed to be registered, defaults to true. |
|
| 1747 | + * |
|
| 1748 | + * @return bool |
|
| 1749 | + * @since 3.27.6 |
|
| 1750 | + */ |
|
| 1751 | + if ( apply_filters( 'wl_feature__enable__screens', true ) ) { |
|
| 1752 | + $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 ); |
|
| 1753 | + } |
|
| 1754 | + /* |
|
| 1755 | 1755 | * Display the `Wordlift_Admin_Search_Rankings_Page` page. |
| 1756 | 1756 | * |
| 1757 | 1757 | * @link https://github.com/insideout10/wordlift-plugin/issues/761 |
| 1758 | 1758 | * |
| 1759 | 1759 | * @since 3.20.0 |
| 1760 | 1760 | */ |
| 1761 | - if ( in_array( $this->configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) { |
|
| 1762 | - /** |
|
| 1763 | - * Filter: wl_feature__enable__screens. |
|
| 1764 | - * |
|
| 1765 | - * @param bool whether the screens needed to be registered, defaults to true. |
|
| 1766 | - * |
|
| 1767 | - * @return bool |
|
| 1768 | - * @since 3.27.6 |
|
| 1769 | - */ |
|
| 1761 | + if ( in_array( $this->configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) { |
|
| 1762 | + /** |
|
| 1763 | + * Filter: wl_feature__enable__screens. |
|
| 1764 | + * |
|
| 1765 | + * @param bool whether the screens needed to be registered, defaults to true. |
|
| 1766 | + * |
|
| 1767 | + * @return bool |
|
| 1768 | + * @since 3.27.6 |
|
| 1769 | + */ |
|
| 1770 | 1770 | // if ( apply_filters( 'wl_feature__enable__screens', true ) ) { |
| 1771 | 1771 | // $admin_search_rankings_page = new Wordlift_Admin_Search_Rankings_Page(); |
| 1772 | 1772 | // $this->loader->add_action( 'wl_admin_menu', $admin_search_rankings_page, 'admin_menu' ); |
| 1773 | 1773 | // } |
| 1774 | - } |
|
| 1774 | + } |
|
| 1775 | 1775 | |
| 1776 | - // Hook key update. |
|
| 1777 | - $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1778 | - $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1776 | + // Hook key update. |
|
| 1777 | + $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1778 | + $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1779 | 1779 | |
| 1780 | - // Add additional action links to the WordLift plugin in the plugins page. |
|
| 1781 | - $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1780 | + // Add additional action links to the WordLift plugin in the plugins page. |
|
| 1781 | + $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1782 | 1782 | |
| 1783 | - /* |
|
| 1783 | + /* |
|
| 1784 | 1784 | * Remove the Analytics Settings link from the plugin page. |
| 1785 | 1785 | * |
| 1786 | 1786 | * @see https://github.com/insideout10/wordlift-plugin/issues/932 |
| 1787 | 1787 | * @since 3.21.1 |
| 1788 | 1788 | */ |
| 1789 | - // $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1790 | - |
|
| 1791 | - // Hook the AJAX `wl_publisher` action name. |
|
| 1792 | - $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1793 | - |
|
| 1794 | - // Hook row actions for the entity type list admin. |
|
| 1795 | - $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1796 | - |
|
| 1797 | - /** Ajax actions. */ |
|
| 1798 | - $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' ); |
|
| 1799 | - |
|
| 1800 | - // Hook capabilities manipulation to allow access to entity type admin |
|
| 1801 | - // page on WordPress versions before 4.7. |
|
| 1802 | - global $wp_version; |
|
| 1803 | - if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1804 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1805 | - } |
|
| 1806 | - |
|
| 1807 | - $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1808 | - |
|
| 1809 | - /** Adapters. */ |
|
| 1810 | - $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1811 | - /** |
|
| 1812 | - * Disabling Faq temporarily. |
|
| 1813 | - * Load the tinymce editor button on the tool bar. |
|
| 1814 | - * @since 3.26.0 |
|
| 1815 | - */ |
|
| 1816 | - //$this->loader->add_filter( 'tiny_mce_before_init', $this->faq_tinymce_adapter, 'register_custom_tags' ); |
|
| 1817 | - //$this->loader->add_filter( 'mce_buttons', $this->faq_tinymce_adapter, 'register_faq_toolbar_button', 10, 1 ); |
|
| 1818 | - //$this->loader->add_filter( 'mce_external_plugins', $this->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 ); |
|
| 1819 | - |
|
| 1820 | - |
|
| 1821 | - $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' ); |
|
| 1822 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' ); |
|
| 1823 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' ); |
|
| 1824 | - /** |
|
| 1825 | - * @since 3.26.0 |
|
| 1826 | - */ |
|
| 1827 | - if ( apply_filters( 'wl_feature__enable__post_excerpt', true ) ) { |
|
| 1828 | - $excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter(); |
|
| 1829 | - $this->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' ); |
|
| 1830 | - // Adding Rest route for the post excerpt |
|
| 1831 | - Post_Excerpt_Rest_Controller::register_routes(); |
|
| 1832 | - } |
|
| 1833 | - |
|
| 1834 | - $this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 ); |
|
| 1835 | - $this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 ); |
|
| 1836 | - |
|
| 1837 | - // Handle the autocomplete request. |
|
| 1838 | - add_action( 'wp_ajax_wl_autocomplete', array( |
|
| 1839 | - $this->autocomplete_adapter, |
|
| 1840 | - 'wl_autocomplete', |
|
| 1841 | - ) ); |
|
| 1842 | - add_action( 'wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1843 | - $this->autocomplete_adapter, |
|
| 1844 | - 'wl_autocomplete', |
|
| 1845 | - ) ); |
|
| 1846 | - |
|
| 1847 | - // Hooks to restrict multisite super admin from manipulating entity types. |
|
| 1848 | - if ( is_multisite() ) { |
|
| 1849 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1850 | - } |
|
| 1851 | - |
|
| 1852 | - $deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service ); |
|
| 1853 | - |
|
| 1854 | - add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) ); |
|
| 1855 | - add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) ); |
|
| 1856 | - add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) ); |
|
| 1857 | - |
|
| 1858 | - /** |
|
| 1859 | - * Always allow the `wordlift/classification` block. |
|
| 1860 | - * |
|
| 1861 | - * @since 3.23.0 |
|
| 1862 | - */ |
|
| 1863 | - add_filter( 'allowed_block_types', function ( $value ) { |
|
| 1864 | - |
|
| 1865 | - if ( true === $value ) { |
|
| 1866 | - return $value; |
|
| 1867 | - } |
|
| 1868 | - |
|
| 1869 | - return array_merge( (array) $value, array( 'wordlift/classification' ) ); |
|
| 1870 | - }, PHP_INT_MAX ); |
|
| 1871 | - |
|
| 1872 | - /** |
|
| 1873 | - * @since 3.27.7 |
|
| 1874 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
| 1875 | - */ |
|
| 1876 | - new Top_Entities(); |
|
| 1877 | - } |
|
| 1878 | - |
|
| 1879 | - /** |
|
| 1880 | - * Register all of the hooks related to the public-facing functionality |
|
| 1881 | - * of the plugin. |
|
| 1882 | - * |
|
| 1883 | - * @since 1.0.0 |
|
| 1884 | - * @access private |
|
| 1885 | - */ |
|
| 1886 | - private function define_public_hooks() { |
|
| 1887 | - |
|
| 1888 | - $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1889 | - |
|
| 1890 | - // Register the entity post type. |
|
| 1891 | - $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1892 | - |
|
| 1893 | - // Bind the link generation and handling hooks to the entity link service. |
|
| 1894 | - $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1895 | - $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1896 | - // $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 ); |
|
| 1897 | - // $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 ); |
|
| 1898 | - |
|
| 1899 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1900 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1901 | - $this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' ); |
|
| 1902 | - |
|
| 1903 | - // Registering Faq_Content_Filter service used for removing faq question and answer tags from the html. |
|
| 1904 | - $this->loader->add_filter( 'the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' ); |
|
| 1905 | - // Hook the content filter service to add entity links. |
|
| 1906 | - if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) { |
|
| 1907 | - $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1908 | - } |
|
| 1909 | - |
|
| 1910 | - // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1911 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1912 | - |
|
| 1913 | - // Hook the ShareThis service. |
|
| 1914 | - $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1915 | - $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1916 | - |
|
| 1917 | - // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1918 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1919 | - |
|
| 1920 | - // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
|
| 1921 | - // in order to tweak WP's `WP_Query` to include entities in queries related |
|
| 1922 | - // to categories. |
|
| 1923 | - $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1924 | - |
|
| 1925 | - /* |
|
| 1789 | + // $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1790 | + |
|
| 1791 | + // Hook the AJAX `wl_publisher` action name. |
|
| 1792 | + $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1793 | + |
|
| 1794 | + // Hook row actions for the entity type list admin. |
|
| 1795 | + $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1796 | + |
|
| 1797 | + /** Ajax actions. */ |
|
| 1798 | + $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' ); |
|
| 1799 | + |
|
| 1800 | + // Hook capabilities manipulation to allow access to entity type admin |
|
| 1801 | + // page on WordPress versions before 4.7. |
|
| 1802 | + global $wp_version; |
|
| 1803 | + if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1804 | + $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1805 | + } |
|
| 1806 | + |
|
| 1807 | + $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1808 | + |
|
| 1809 | + /** Adapters. */ |
|
| 1810 | + $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1811 | + /** |
|
| 1812 | + * Disabling Faq temporarily. |
|
| 1813 | + * Load the tinymce editor button on the tool bar. |
|
| 1814 | + * @since 3.26.0 |
|
| 1815 | + */ |
|
| 1816 | + //$this->loader->add_filter( 'tiny_mce_before_init', $this->faq_tinymce_adapter, 'register_custom_tags' ); |
|
| 1817 | + //$this->loader->add_filter( 'mce_buttons', $this->faq_tinymce_adapter, 'register_faq_toolbar_button', 10, 1 ); |
|
| 1818 | + //$this->loader->add_filter( 'mce_external_plugins', $this->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 ); |
|
| 1819 | + |
|
| 1820 | + |
|
| 1821 | + $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' ); |
|
| 1822 | + $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' ); |
|
| 1823 | + $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' ); |
|
| 1824 | + /** |
|
| 1825 | + * @since 3.26.0 |
|
| 1826 | + */ |
|
| 1827 | + if ( apply_filters( 'wl_feature__enable__post_excerpt', true ) ) { |
|
| 1828 | + $excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter(); |
|
| 1829 | + $this->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' ); |
|
| 1830 | + // Adding Rest route for the post excerpt |
|
| 1831 | + Post_Excerpt_Rest_Controller::register_routes(); |
|
| 1832 | + } |
|
| 1833 | + |
|
| 1834 | + $this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 ); |
|
| 1835 | + $this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 ); |
|
| 1836 | + |
|
| 1837 | + // Handle the autocomplete request. |
|
| 1838 | + add_action( 'wp_ajax_wl_autocomplete', array( |
|
| 1839 | + $this->autocomplete_adapter, |
|
| 1840 | + 'wl_autocomplete', |
|
| 1841 | + ) ); |
|
| 1842 | + add_action( 'wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1843 | + $this->autocomplete_adapter, |
|
| 1844 | + 'wl_autocomplete', |
|
| 1845 | + ) ); |
|
| 1846 | + |
|
| 1847 | + // Hooks to restrict multisite super admin from manipulating entity types. |
|
| 1848 | + if ( is_multisite() ) { |
|
| 1849 | + $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1850 | + } |
|
| 1851 | + |
|
| 1852 | + $deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service ); |
|
| 1853 | + |
|
| 1854 | + add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) ); |
|
| 1855 | + add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) ); |
|
| 1856 | + add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) ); |
|
| 1857 | + |
|
| 1858 | + /** |
|
| 1859 | + * Always allow the `wordlift/classification` block. |
|
| 1860 | + * |
|
| 1861 | + * @since 3.23.0 |
|
| 1862 | + */ |
|
| 1863 | + add_filter( 'allowed_block_types', function ( $value ) { |
|
| 1864 | + |
|
| 1865 | + if ( true === $value ) { |
|
| 1866 | + return $value; |
|
| 1867 | + } |
|
| 1868 | + |
|
| 1869 | + return array_merge( (array) $value, array( 'wordlift/classification' ) ); |
|
| 1870 | + }, PHP_INT_MAX ); |
|
| 1871 | + |
|
| 1872 | + /** |
|
| 1873 | + * @since 3.27.7 |
|
| 1874 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
| 1875 | + */ |
|
| 1876 | + new Top_Entities(); |
|
| 1877 | + } |
|
| 1878 | + |
|
| 1879 | + /** |
|
| 1880 | + * Register all of the hooks related to the public-facing functionality |
|
| 1881 | + * of the plugin. |
|
| 1882 | + * |
|
| 1883 | + * @since 1.0.0 |
|
| 1884 | + * @access private |
|
| 1885 | + */ |
|
| 1886 | + private function define_public_hooks() { |
|
| 1887 | + |
|
| 1888 | + $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1889 | + |
|
| 1890 | + // Register the entity post type. |
|
| 1891 | + $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1892 | + |
|
| 1893 | + // Bind the link generation and handling hooks to the entity link service. |
|
| 1894 | + $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1895 | + $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1896 | + // $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 ); |
|
| 1897 | + // $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 ); |
|
| 1898 | + |
|
| 1899 | + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1900 | + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1901 | + $this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' ); |
|
| 1902 | + |
|
| 1903 | + // Registering Faq_Content_Filter service used for removing faq question and answer tags from the html. |
|
| 1904 | + $this->loader->add_filter( 'the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' ); |
|
| 1905 | + // Hook the content filter service to add entity links. |
|
| 1906 | + if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) { |
|
| 1907 | + $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1908 | + } |
|
| 1909 | + |
|
| 1910 | + // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1911 | + $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1912 | + |
|
| 1913 | + // Hook the ShareThis service. |
|
| 1914 | + $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1915 | + $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1916 | + |
|
| 1917 | + // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1918 | + $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1919 | + |
|
| 1920 | + // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
|
| 1921 | + // in order to tweak WP's `WP_Query` to include entities in queries related |
|
| 1922 | + // to categories. |
|
| 1923 | + $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1924 | + |
|
| 1925 | + /* |
|
| 1926 | 1926 | * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service` |
| 1927 | 1927 | * in order to tweak WP's `WP_Query` to show event related entities in reverse |
| 1928 | 1928 | * order of start time. |
| 1929 | 1929 | */ |
| 1930 | - $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1931 | - |
|
| 1932 | - $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1933 | - |
|
| 1934 | - // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
|
| 1935 | - $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1936 | - |
|
| 1937 | - // Analytics Script Frontend. |
|
| 1938 | - if ( $this->configuration_service->is_analytics_enable() ) { |
|
| 1939 | - $this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 ); |
|
| 1940 | - } |
|
| 1941 | - |
|
| 1942 | - } |
|
| 1943 | - |
|
| 1944 | - /** |
|
| 1945 | - * Run the loader to execute all of the hooks with WordPress. |
|
| 1946 | - * |
|
| 1947 | - * @since 1.0.0 |
|
| 1948 | - */ |
|
| 1949 | - public function run() { |
|
| 1950 | - $this->loader->run(); |
|
| 1951 | - } |
|
| 1952 | - |
|
| 1953 | - /** |
|
| 1954 | - * The name of the plugin used to uniquely identify it within the context of |
|
| 1955 | - * WordPress and to define internationalization functionality. |
|
| 1956 | - * |
|
| 1957 | - * @return string The name of the plugin. |
|
| 1958 | - * @since 1.0.0 |
|
| 1959 | - */ |
|
| 1960 | - public function get_plugin_name() { |
|
| 1961 | - return $this->plugin_name; |
|
| 1962 | - } |
|
| 1963 | - |
|
| 1964 | - /** |
|
| 1965 | - * The reference to the class that orchestrates the hooks with the plugin. |
|
| 1966 | - * |
|
| 1967 | - * @return Wordlift_Loader Orchestrates the hooks of the plugin. |
|
| 1968 | - * @since 1.0.0 |
|
| 1969 | - */ |
|
| 1970 | - public function get_loader() { |
|
| 1971 | - return $this->loader; |
|
| 1972 | - } |
|
| 1973 | - |
|
| 1974 | - /** |
|
| 1975 | - * Retrieve the version number of the plugin. |
|
| 1976 | - * |
|
| 1977 | - * @return string The version number of the plugin. |
|
| 1978 | - * @since 1.0.0 |
|
| 1979 | - */ |
|
| 1980 | - public function get_version() { |
|
| 1981 | - return $this->version; |
|
| 1982 | - } |
|
| 1983 | - |
|
| 1984 | - /** |
|
| 1985 | - * Load dependencies for WP-CLI. |
|
| 1986 | - * |
|
| 1987 | - * @throws Exception |
|
| 1988 | - * @since 3.18.0 |
|
| 1989 | - */ |
|
| 1990 | - private function load_cli_dependencies() { |
|
| 1991 | - |
|
| 1992 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php'; |
|
| 1993 | - |
|
| 1994 | - $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 ); |
|
| 1995 | - |
|
| 1996 | - WP_CLI::add_command( 'wl references push', $push_reference_data_command ); |
|
| 1997 | - |
|
| 1998 | - } |
|
| 1999 | - |
|
| 2000 | - /** |
|
| 2001 | - * Get the {@link \Wordlift_Dashboard_Service} to allow others to use its functions. |
|
| 2002 | - * |
|
| 2003 | - * @return \Wordlift_Dashboard_Service The {@link \Wordlift_Dashboard_Service} instance. |
|
| 2004 | - * @since 3.20.0 |
|
| 2005 | - */ |
|
| 2006 | - public function get_dashboard_service() { |
|
| 2007 | - |
|
| 2008 | - return $this->dashboard_service; |
|
| 2009 | - } |
|
| 2010 | - |
|
| 2011 | - public function add_wl_enabled_blocks() { |
|
| 2012 | - /** |
|
| 2013 | - * Filter: wl_feature__enable__blocks. |
|
| 2014 | - * |
|
| 2015 | - * @param bool whether the blocks needed to be registered, defaults to true. |
|
| 2016 | - * |
|
| 2017 | - * @return bool |
|
| 2018 | - * @since 3.27.6 |
|
| 2019 | - */ |
|
| 2020 | - |
|
| 2021 | - wp_register_script( 'wl_enabled_blocks', false ); |
|
| 2022 | - |
|
| 2023 | - $enabled_blocks = array( 'wordlift/products-navigator' ); |
|
| 2024 | - |
|
| 2025 | - if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 2026 | - // To intimate JS |
|
| 2027 | - $enabled_blocks = array_merge( $enabled_blocks, array( |
|
| 2028 | - 'wordlift/navigator', |
|
| 2029 | - 'wordlift/chord', |
|
| 2030 | - 'wordlift/geomap', |
|
| 2031 | - 'wordlift/timeline', |
|
| 2032 | - 'wordlift/cloud', |
|
| 2033 | - 'wordlift/vocabulary', |
|
| 2034 | - 'wordlift/faceted-search' |
|
| 2035 | - ) ); |
|
| 2036 | - } |
|
| 2037 | - |
|
| 2038 | - wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks ); |
|
| 2039 | - wp_enqueue_script( 'wl_enabled_blocks' ); |
|
| 2040 | - } |
|
| 1930 | + $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1931 | + |
|
| 1932 | + $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1933 | + |
|
| 1934 | + // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
|
| 1935 | + $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1936 | + |
|
| 1937 | + // Analytics Script Frontend. |
|
| 1938 | + if ( $this->configuration_service->is_analytics_enable() ) { |
|
| 1939 | + $this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 ); |
|
| 1940 | + } |
|
| 1941 | + |
|
| 1942 | + } |
|
| 1943 | + |
|
| 1944 | + /** |
|
| 1945 | + * Run the loader to execute all of the hooks with WordPress. |
|
| 1946 | + * |
|
| 1947 | + * @since 1.0.0 |
|
| 1948 | + */ |
|
| 1949 | + public function run() { |
|
| 1950 | + $this->loader->run(); |
|
| 1951 | + } |
|
| 1952 | + |
|
| 1953 | + /** |
|
| 1954 | + * The name of the plugin used to uniquely identify it within the context of |
|
| 1955 | + * WordPress and to define internationalization functionality. |
|
| 1956 | + * |
|
| 1957 | + * @return string The name of the plugin. |
|
| 1958 | + * @since 1.0.0 |
|
| 1959 | + */ |
|
| 1960 | + public function get_plugin_name() { |
|
| 1961 | + return $this->plugin_name; |
|
| 1962 | + } |
|
| 1963 | + |
|
| 1964 | + /** |
|
| 1965 | + * The reference to the class that orchestrates the hooks with the plugin. |
|
| 1966 | + * |
|
| 1967 | + * @return Wordlift_Loader Orchestrates the hooks of the plugin. |
|
| 1968 | + * @since 1.0.0 |
|
| 1969 | + */ |
|
| 1970 | + public function get_loader() { |
|
| 1971 | + return $this->loader; |
|
| 1972 | + } |
|
| 1973 | + |
|
| 1974 | + /** |
|
| 1975 | + * Retrieve the version number of the plugin. |
|
| 1976 | + * |
|
| 1977 | + * @return string The version number of the plugin. |
|
| 1978 | + * @since 1.0.0 |
|
| 1979 | + */ |
|
| 1980 | + public function get_version() { |
|
| 1981 | + return $this->version; |
|
| 1982 | + } |
|
| 1983 | + |
|
| 1984 | + /** |
|
| 1985 | + * Load dependencies for WP-CLI. |
|
| 1986 | + * |
|
| 1987 | + * @throws Exception |
|
| 1988 | + * @since 3.18.0 |
|
| 1989 | + */ |
|
| 1990 | + private function load_cli_dependencies() { |
|
| 1991 | + |
|
| 1992 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php'; |
|
| 1993 | + |
|
| 1994 | + $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 ); |
|
| 1995 | + |
|
| 1996 | + WP_CLI::add_command( 'wl references push', $push_reference_data_command ); |
|
| 1997 | + |
|
| 1998 | + } |
|
| 1999 | + |
|
| 2000 | + /** |
|
| 2001 | + * Get the {@link \Wordlift_Dashboard_Service} to allow others to use its functions. |
|
| 2002 | + * |
|
| 2003 | + * @return \Wordlift_Dashboard_Service The {@link \Wordlift_Dashboard_Service} instance. |
|
| 2004 | + * @since 3.20.0 |
|
| 2005 | + */ |
|
| 2006 | + public function get_dashboard_service() { |
|
| 2007 | + |
|
| 2008 | + return $this->dashboard_service; |
|
| 2009 | + } |
|
| 2010 | + |
|
| 2011 | + public function add_wl_enabled_blocks() { |
|
| 2012 | + /** |
|
| 2013 | + * Filter: wl_feature__enable__blocks. |
|
| 2014 | + * |
|
| 2015 | + * @param bool whether the blocks needed to be registered, defaults to true. |
|
| 2016 | + * |
|
| 2017 | + * @return bool |
|
| 2018 | + * @since 3.27.6 |
|
| 2019 | + */ |
|
| 2020 | + |
|
| 2021 | + wp_register_script( 'wl_enabled_blocks', false ); |
|
| 2022 | + |
|
| 2023 | + $enabled_blocks = array( 'wordlift/products-navigator' ); |
|
| 2024 | + |
|
| 2025 | + if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 2026 | + // To intimate JS |
|
| 2027 | + $enabled_blocks = array_merge( $enabled_blocks, array( |
|
| 2028 | + 'wordlift/navigator', |
|
| 2029 | + 'wordlift/chord', |
|
| 2030 | + 'wordlift/geomap', |
|
| 2031 | + 'wordlift/timeline', |
|
| 2032 | + 'wordlift/cloud', |
|
| 2033 | + 'wordlift/vocabulary', |
|
| 2034 | + 'wordlift/faceted-search' |
|
| 2035 | + ) ); |
|
| 2036 | + } |
|
| 2037 | + |
|
| 2038 | + wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks ); |
|
| 2039 | + wp_enqueue_script( 'wl_enabled_blocks' ); |
|
| 2040 | + } |
|
| 2041 | 2041 | |
| 2042 | 2042 | } |
@@ -761,7 +761,7 @@ discard block |
||
| 761 | 761 | $this->define_public_hooks(); |
| 762 | 762 | |
| 763 | 763 | // If we're in `WP_CLI` load the related files. |
| 764 | - if ( class_exists( 'WP_CLI' ) ) { |
|
| 764 | + if (class_exists('WP_CLI')) { |
|
| 765 | 765 | $this->load_cli_dependencies(); |
| 766 | 766 | } |
| 767 | 767 | |
@@ -802,381 +802,381 @@ discard block |
||
| 802 | 802 | * The class responsible for orchestrating the actions and filters of the |
| 803 | 803 | * core plugin. |
| 804 | 804 | */ |
| 805 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 805 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-loader.php'; |
|
| 806 | 806 | |
| 807 | 807 | // The class responsible for plugin uninstall. |
| 808 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
|
| 808 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-deactivator-feedback.php'; |
|
| 809 | 809 | |
| 810 | 810 | /** |
| 811 | 811 | * The class responsible for defining internationalization functionality |
| 812 | 812 | * of the plugin. |
| 813 | 813 | */ |
| 814 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 814 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-i18n.php'; |
|
| 815 | 815 | |
| 816 | 816 | /** |
| 817 | 817 | * WordLift's supported languages. |
| 818 | 818 | */ |
| 819 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 819 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-languages.php'; |
|
| 820 | 820 | |
| 821 | 821 | /** |
| 822 | 822 | * WordLift's supported countries. |
| 823 | 823 | */ |
| 824 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php'; |
|
| 824 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-countries.php'; |
|
| 825 | 825 | |
| 826 | 826 | /** |
| 827 | 827 | * Provide support functions to sanitize data. |
| 828 | 828 | */ |
| 829 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 829 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sanitizer.php'; |
|
| 830 | 830 | |
| 831 | 831 | /** Services. */ |
| 832 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 833 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
|
| 834 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 835 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 836 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 837 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 838 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 839 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
|
| 840 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 841 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php'; |
|
| 832 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-log-service.php'; |
|
| 833 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-http-api.php'; |
|
| 834 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-redirect-service.php'; |
|
| 835 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-configuration-service.php'; |
|
| 836 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-type-service.php'; |
|
| 837 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-service.php'; |
|
| 838 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-link-service.php'; |
|
| 839 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-linked-data-service.php'; |
|
| 840 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-relation-service.php'; |
|
| 841 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-image-service.php'; |
|
| 842 | 842 | |
| 843 | 843 | /** |
| 844 | 844 | * The Query builder. |
| 845 | 845 | */ |
| 846 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 846 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-query-builder.php'; |
|
| 847 | 847 | |
| 848 | 848 | /** |
| 849 | 849 | * The Schema service. |
| 850 | 850 | */ |
| 851 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 851 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-service.php'; |
|
| 852 | 852 | |
| 853 | 853 | /** |
| 854 | 854 | * The schema:url property service. |
| 855 | 855 | */ |
| 856 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 857 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 856 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-service.php'; |
|
| 857 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-url-property-service.php'; |
|
| 858 | 858 | |
| 859 | 859 | /** |
| 860 | 860 | * The UI service. |
| 861 | 861 | */ |
| 862 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 862 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-ui-service.php'; |
|
| 863 | 863 | |
| 864 | 864 | /** |
| 865 | 865 | * The Thumbnail service. |
| 866 | 866 | */ |
| 867 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 867 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-thumbnail-service.php'; |
|
| 868 | 868 | |
| 869 | 869 | /** |
| 870 | 870 | * The Entity Types Taxonomy service. |
| 871 | 871 | */ |
| 872 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 872 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 873 | 873 | |
| 874 | 874 | /** |
| 875 | 875 | * The Entity service. |
| 876 | 876 | */ |
| 877 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
|
| 878 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 877 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-uri-service.php'; |
|
| 878 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-service.php'; |
|
| 879 | 879 | |
| 880 | 880 | // Add the entity rating service. |
| 881 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 881 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rating-service.php'; |
|
| 882 | 882 | |
| 883 | 883 | /** |
| 884 | 884 | * The User service. |
| 885 | 885 | */ |
| 886 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 886 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-user-service.php'; |
|
| 887 | 887 | |
| 888 | 888 | /** |
| 889 | 889 | * The Timeline service. |
| 890 | 890 | */ |
| 891 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 891 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-timeline-service.php'; |
|
| 892 | 892 | |
| 893 | 893 | /** |
| 894 | 894 | * The Topic Taxonomy service. |
| 895 | 895 | */ |
| 896 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 896 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 897 | 897 | |
| 898 | 898 | /** |
| 899 | 899 | * The SPARQL service. |
| 900 | 900 | */ |
| 901 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 901 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sparql-service.php'; |
|
| 902 | 902 | |
| 903 | 903 | /** |
| 904 | 904 | * The WordLift import service. |
| 905 | 905 | */ |
| 906 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 906 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-import-service.php'; |
|
| 907 | 907 | |
| 908 | 908 | /** |
| 909 | 909 | * The WordLift URI service. |
| 910 | 910 | */ |
| 911 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 912 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 913 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 911 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-uri-service.php'; |
|
| 912 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-factory.php'; |
|
| 913 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-service.php'; |
|
| 914 | 914 | |
| 915 | 915 | /** |
| 916 | 916 | * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
| 917 | 917 | */ |
| 918 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php'; |
|
| 919 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php'; |
|
| 920 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php'; |
|
| 921 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php'; |
|
| 922 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php'; |
|
| 918 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-listable.php'; |
|
| 919 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-rebuild-service.php'; |
|
| 920 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-reference-rebuild-service.php'; |
|
| 921 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-relation-rebuild-service.php'; |
|
| 922 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-relation-rebuild-adapter.php'; |
|
| 923 | 923 | |
| 924 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 925 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 924 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 925 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-attachment-service.php'; |
|
| 926 | 926 | |
| 927 | 927 | /** |
| 928 | 928 | * Load the converters. |
| 929 | 929 | */ |
| 930 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 931 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 932 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 933 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 934 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 935 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 930 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/intf-wordlift-post-converter.php'; |
|
| 931 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 932 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 933 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 934 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 935 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 936 | 936 | |
| 937 | 937 | /** |
| 938 | 938 | * Load cache-related files. |
| 939 | 939 | */ |
| 940 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
|
| 940 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/cache/require.php'; |
|
| 941 | 941 | |
| 942 | 942 | /** |
| 943 | 943 | * Load the content filter. |
| 944 | 944 | */ |
| 945 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 945 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-content-filter-service.php'; |
|
| 946 | 946 | |
| 947 | 947 | /* |
| 948 | 948 | * Load the excerpt helper. |
| 949 | 949 | */ |
| 950 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 950 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 951 | 951 | |
| 952 | 952 | /** |
| 953 | 953 | * Load the JSON-LD service to publish entities using JSON-LD.s |
| 954 | 954 | * |
| 955 | 955 | * @since 3.8.0 |
| 956 | 956 | */ |
| 957 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 957 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-service.php'; |
|
| 958 | 958 | |
| 959 | 959 | // The Publisher Service and the AJAX adapter. |
| 960 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 961 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 960 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-service.php'; |
|
| 961 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 962 | 962 | |
| 963 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 963 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-adapter.php'; |
|
| 964 | 964 | |
| 965 | 965 | /** |
| 966 | 966 | * Load the WordLift key validation service. |
| 967 | 967 | */ |
| 968 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 968 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-key-validation-service.php'; |
|
| 969 | 969 | |
| 970 | 970 | // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
| 971 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 971 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 972 | 972 | |
| 973 | 973 | // Load the `Wordlift_Entity_Page_Service` class definition. |
| 974 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
| 974 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-page-service.php'; |
|
| 975 | 975 | |
| 976 | 976 | /** Linked Data. */ |
| 977 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 978 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 979 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 980 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 981 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 982 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 983 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 984 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 985 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 986 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 987 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 977 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 978 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 979 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 980 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 981 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 982 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 983 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 984 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 985 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 986 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 987 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 988 | 988 | |
| 989 | 989 | /** Linked Data Rendition. */ |
| 990 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php'; |
|
| 991 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php'; |
|
| 992 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php'; |
|
| 993 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 990 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php'; |
|
| 991 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php'; |
|
| 992 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php'; |
|
| 993 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 994 | 994 | |
| 995 | 995 | /** Services. */ |
| 996 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 997 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php'; |
|
| 996 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 997 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-api-service.php'; |
|
| 998 | 998 | |
| 999 | 999 | /** Adapters. */ |
| 1000 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 1001 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 1002 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 1003 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 1004 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php'; |
|
| 1000 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-tinymce-adapter.php'; |
|
| 1001 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-newrelic-adapter.php'; |
|
| 1002 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 1003 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-adapter.php'; |
|
| 1004 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-wprocket-adapter.php'; |
|
| 1005 | 1005 | |
| 1006 | 1006 | /** Async Tasks. */ |
| 1007 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php'; |
|
| 1008 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 1009 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php'; |
|
| 1007 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-async-task.php'; |
|
| 1008 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 1009 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-push-references-async-task.php'; |
|
| 1010 | 1010 | |
| 1011 | 1011 | /** Autocomplete. */ |
| 1012 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 1012 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 1013 | 1013 | |
| 1014 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
|
| 1014 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-remote-image-service.php'; |
|
| 1015 | 1015 | |
| 1016 | 1016 | /** Analytics */ |
| 1017 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 1017 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 1018 | 1018 | |
| 1019 | 1019 | /** |
| 1020 | 1020 | * The class responsible for defining all actions that occur in the admin area. |
| 1021 | 1021 | */ |
| 1022 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 1022 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin.php'; |
|
| 1023 | 1023 | |
| 1024 | 1024 | /** |
| 1025 | 1025 | * The class to customize the entity list admin page. |
| 1026 | 1026 | */ |
| 1027 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 1027 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-list.php'; |
|
| 1028 | 1028 | |
| 1029 | 1029 | /** |
| 1030 | 1030 | * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
| 1031 | 1031 | */ |
| 1032 | 1032 | global $wp_version; |
| 1033 | - if ( version_compare( $wp_version, '5.3', '<' ) ) { |
|
| 1034 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 1033 | + if (version_compare($wp_version, '5.3', '<')) { |
|
| 1034 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 1035 | 1035 | } else { |
| 1036 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
| 1036 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
| 1037 | 1037 | } |
| 1038 | 1038 | |
| 1039 | 1039 | /** |
| 1040 | 1040 | * The Notice service. |
| 1041 | 1041 | */ |
| 1042 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 1042 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-notice-service.php'; |
|
| 1043 | 1043 | |
| 1044 | 1044 | /** |
| 1045 | 1045 | * The PrimaShop adapter. |
| 1046 | 1046 | */ |
| 1047 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 1047 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-primashop-adapter.php'; |
|
| 1048 | 1048 | |
| 1049 | 1049 | /** |
| 1050 | 1050 | * The WordLift Dashboard service. |
| 1051 | 1051 | */ |
| 1052 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 1052 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard.php'; |
|
| 1053 | 1053 | |
| 1054 | 1054 | /** |
| 1055 | 1055 | * The admin 'Install wizard' page. |
| 1056 | 1056 | */ |
| 1057 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 1057 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-setup.php'; |
|
| 1058 | 1058 | |
| 1059 | 1059 | /** |
| 1060 | 1060 | * The WordLift entity type list admin page controller. |
| 1061 | 1061 | */ |
| 1062 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 1062 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 1063 | 1063 | |
| 1064 | 1064 | /** |
| 1065 | 1065 | * The WordLift entity type settings admin page controller. |
| 1066 | 1066 | */ |
| 1067 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 1067 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-settings.php'; |
|
| 1068 | 1068 | |
| 1069 | 1069 | /** |
| 1070 | 1070 | * The admin 'Download Your Data' page. |
| 1071 | 1071 | */ |
| 1072 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 1072 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-download-your-data-page.php'; |
|
| 1073 | 1073 | |
| 1074 | 1074 | /** |
| 1075 | 1075 | * The admin 'WordLift Settings' page. |
| 1076 | 1076 | */ |
| 1077 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php'; |
|
| 1078 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 1079 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 1080 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 1081 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 1082 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 1083 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 1084 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 1085 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 1086 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 1087 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 1088 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 1089 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
| 1090 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 1091 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
| 1077 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/intf-wordlift-admin-element.php'; |
|
| 1078 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 1079 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 1080 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 1081 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 1082 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 1083 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 1084 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 1085 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 1086 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 1087 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-page.php'; |
|
| 1088 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page.php'; |
|
| 1089 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
| 1090 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 1091 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
| 1092 | 1092 | |
| 1093 | 1093 | /** Admin Pages */ |
| 1094 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 1095 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 1096 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-page.php'; |
|
| 1097 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 1094 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 1095 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-status-page.php'; |
|
| 1096 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-search-rankings-page.php'; |
|
| 1097 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 1098 | 1098 | |
| 1099 | 1099 | /** |
| 1100 | 1100 | * The class responsible for defining all actions that occur in the public-facing |
| 1101 | 1101 | * side of the site. |
| 1102 | 1102 | */ |
| 1103 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 1103 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-public.php'; |
|
| 1104 | 1104 | |
| 1105 | 1105 | /** |
| 1106 | 1106 | * The shortcode abstract class. |
| 1107 | 1107 | */ |
| 1108 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 1108 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-shortcode.php'; |
|
| 1109 | 1109 | |
| 1110 | 1110 | /** |
| 1111 | 1111 | * The Timeline shortcode. |
| 1112 | 1112 | */ |
| 1113 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 1113 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-timeline-shortcode.php'; |
|
| 1114 | 1114 | |
| 1115 | 1115 | /** |
| 1116 | 1116 | * The Navigator shortcode. |
| 1117 | 1117 | */ |
| 1118 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 1118 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-navigator-shortcode.php'; |
|
| 1119 | 1119 | |
| 1120 | 1120 | /** |
| 1121 | 1121 | * The Products Navigator shortcode. |
| 1122 | 1122 | */ |
| 1123 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php'; |
|
| 1123 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-products-navigator-shortcode.php'; |
|
| 1124 | 1124 | |
| 1125 | 1125 | /** |
| 1126 | 1126 | * The chord shortcode. |
| 1127 | 1127 | */ |
| 1128 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 1128 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-chord-shortcode.php'; |
|
| 1129 | 1129 | |
| 1130 | 1130 | /** |
| 1131 | 1131 | * The geomap shortcode. |
| 1132 | 1132 | */ |
| 1133 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 1133 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-geomap-shortcode.php'; |
|
| 1134 | 1134 | |
| 1135 | 1135 | /** |
| 1136 | 1136 | * The entity cloud shortcode. |
| 1137 | 1137 | */ |
| 1138 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 1138 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 1139 | 1139 | |
| 1140 | 1140 | /** |
| 1141 | 1141 | * The entity glossary shortcode. |
| 1142 | 1142 | */ |
| 1143 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
|
| 1144 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 1143 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-alphabet-service.php'; |
|
| 1144 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 1145 | 1145 | |
| 1146 | 1146 | /** |
| 1147 | 1147 | * Faceted Search shortcode. |
| 1148 | 1148 | */ |
| 1149 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 1149 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 1150 | 1150 | |
| 1151 | 1151 | /** |
| 1152 | 1152 | * The ShareThis service. |
| 1153 | 1153 | */ |
| 1154 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 1154 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-sharethis-service.php'; |
|
| 1155 | 1155 | |
| 1156 | 1156 | /** |
| 1157 | 1157 | * The SEO service. |
| 1158 | 1158 | */ |
| 1159 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 1159 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-seo-service.php'; |
|
| 1160 | 1160 | |
| 1161 | 1161 | /** |
| 1162 | 1162 | * The AMP service. |
| 1163 | 1163 | */ |
| 1164 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1164 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-amp-service.php'; |
|
| 1165 | 1165 | |
| 1166 | 1166 | /** Widgets */ |
| 1167 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1168 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1169 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php'; |
|
| 1167 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-widget.php'; |
|
| 1168 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1169 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-context-cards.php'; |
|
| 1170 | 1170 | |
| 1171 | 1171 | /* |
| 1172 | 1172 | * Schema.org Services. |
| 1173 | 1173 | * |
| 1174 | 1174 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1175 | 1175 | */ |
| 1176 | - if ( WL_ALL_ENTITY_TYPES ) { |
|
| 1177 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1178 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1179 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1176 | + if (WL_ALL_ENTITY_TYPES) { |
|
| 1177 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1178 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1179 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1180 | 1180 | new Wordlift_Schemaorg_Sync_Service(); |
| 1181 | 1181 | $schemaorg_property_service = new Wordlift_Schemaorg_Property_Service(); |
| 1182 | 1182 | new Wordlift_Schemaorg_Class_Service(); |
@@ -1188,25 +1188,25 @@ discard block |
||
| 1188 | 1188 | |
| 1189 | 1189 | // Instantiate a global logger. |
| 1190 | 1190 | global $wl_logger; |
| 1191 | - $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1191 | + $wl_logger = Wordlift_Log_Service::get_logger('WordLift'); |
|
| 1192 | 1192 | |
| 1193 | 1193 | // Load the `wl-api` end-point. |
| 1194 | 1194 | new Wordlift_Http_Api(); |
| 1195 | 1195 | |
| 1196 | 1196 | // Load the Install Service. |
| 1197 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
|
| 1197 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-service.php'; |
|
| 1198 | 1198 | $this->install_service = new Wordlift_Install_Service(); |
| 1199 | 1199 | |
| 1200 | 1200 | /** Services. */ |
| 1201 | 1201 | // Create the configuration service. |
| 1202 | 1202 | $this->configuration_service = new Wordlift_Configuration_Service(); |
| 1203 | - $api_service = new Wordlift_Api_Service( $this->configuration_service ); |
|
| 1203 | + $api_service = new Wordlift_Api_Service($this->configuration_service); |
|
| 1204 | 1204 | |
| 1205 | 1205 | // Create an entity type service instance. It'll be later bound to the init action. |
| 1206 | - $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 1206 | + $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service(Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path()); |
|
| 1207 | 1207 | |
| 1208 | 1208 | // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
| 1209 | - $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 1209 | + $this->entity_link_service = new Wordlift_Entity_Link_Service($this->entity_post_type_service, $this->configuration_service->get_entity_base_path()); |
|
| 1210 | 1210 | |
| 1211 | 1211 | // Create an instance of the UI service. |
| 1212 | 1212 | $this->ui_service = new Wordlift_UI_Service(); |
@@ -1215,30 +1215,30 @@ discard block |
||
| 1215 | 1215 | $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
| 1216 | 1216 | |
| 1217 | 1217 | $this->sparql_service = new Wordlift_Sparql_Service(); |
| 1218 | - $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 1218 | + $schema_url_property_service = new Wordlift_Schema_Url_Property_Service($this->sparql_service); |
|
| 1219 | 1219 | $this->notice_service = new Wordlift_Notice_Service(); |
| 1220 | 1220 | $this->relation_service = new Wordlift_Relation_Service(); |
| 1221 | 1221 | |
| 1222 | - $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' ); |
|
| 1223 | - $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service ); |
|
| 1224 | - $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service ); |
|
| 1225 | - $this->user_service = new Wordlift_User_Service( $this->sparql_service, $this->entity_service ); |
|
| 1222 | + $entity_uri_cache_service = new Wordlift_File_Cache_Service(WL_TEMP_DIR.'entity_uri/'); |
|
| 1223 | + $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service($this->configuration_service, $entity_uri_cache_service); |
|
| 1224 | + $this->entity_service = new Wordlift_Entity_Service($this->ui_service, $this->relation_service, $this->entity_uri_service); |
|
| 1225 | + $this->user_service = new Wordlift_User_Service($this->sparql_service, $this->entity_service); |
|
| 1226 | 1226 | |
| 1227 | 1227 | // Instantiate the JSON-LD service. |
| 1228 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1228 | + $property_getter = Wordlift_Property_Getter_Factory::create($this->entity_service); |
|
| 1229 | 1229 | |
| 1230 | 1230 | /** Linked Data. */ |
| 1231 | - $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
|
| 1232 | - $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
|
| 1231 | + $this->storage_factory = new Wordlift_Storage_Factory($this->entity_service, $this->user_service, $property_getter); |
|
| 1232 | + $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory($this->entity_service); |
|
| 1233 | 1233 | |
| 1234 | - $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
|
| 1234 | + $this->schema_service = new Wordlift_Schema_Service($this->storage_factory, $this->rendition_factory, $this->configuration_service); |
|
| 1235 | 1235 | |
| 1236 | 1236 | // Create a new instance of the Redirect service. |
| 1237 | - $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_uri_service ); |
|
| 1238 | - $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 1237 | + $this->redirect_service = new Wordlift_Redirect_Service($this->entity_uri_service); |
|
| 1238 | + $this->entity_type_service = new Wordlift_Entity_Type_Service($this->schema_service); |
|
| 1239 | 1239 | |
| 1240 | 1240 | // Create a new instance of the Timeline service and Timeline shortcode. |
| 1241 | - $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
|
| 1241 | + $this->timeline_service = new Wordlift_Timeline_Service($this->entity_service, $this->entity_type_service); |
|
| 1242 | 1242 | |
| 1243 | 1243 | $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
| 1244 | 1244 | |
@@ -1252,36 +1252,36 @@ discard block |
||
| 1252 | 1252 | $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
| 1253 | 1253 | |
| 1254 | 1254 | // Create an import service instance to hook later to WP's import function. |
| 1255 | - $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() ); |
|
| 1255 | + $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()); |
|
| 1256 | 1256 | |
| 1257 | - $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1257 | + $uri_service = new Wordlift_Uri_Service($GLOBALS['wpdb']); |
|
| 1258 | 1258 | |
| 1259 | 1259 | // Create the entity rating service. |
| 1260 | - $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 1260 | + $this->rating_service = new Wordlift_Rating_Service($this->entity_service, $this->entity_type_service, $this->notice_service); |
|
| 1261 | 1261 | |
| 1262 | 1262 | // Create entity list customization (wp-admin/edit.php). |
| 1263 | - $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 1263 | + $this->entity_list_service = new Wordlift_Entity_List_Service($this->rating_service); |
|
| 1264 | 1264 | |
| 1265 | 1265 | // Create a new instance of the Redirect service. |
| 1266 | - $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
|
| 1266 | + $this->dashboard_service = new Wordlift_Dashboard_Service($this->rating_service, $this->entity_service); |
|
| 1267 | 1267 | |
| 1268 | 1268 | // Create an instance of the Publisher Service and the AJAX Adapter. |
| 1269 | - $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service ); |
|
| 1270 | - $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1271 | - $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1269 | + $this->publisher_service = new Wordlift_Publisher_Service($this->configuration_service); |
|
| 1270 | + $this->property_factory = new Wordlift_Property_Factory($schema_url_property_service); |
|
| 1271 | + $this->property_factory->register(Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service); |
|
| 1272 | 1272 | |
| 1273 | 1273 | $attachment_service = new Wordlift_Attachment_Service(); |
| 1274 | 1274 | |
| 1275 | 1275 | // Instantiate the JSON-LD service. |
| 1276 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1277 | - $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 ); |
|
| 1278 | - $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 ); |
|
| 1279 | - $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 ); |
|
| 1280 | - $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
|
| 1276 | + $property_getter = Wordlift_Property_Getter_Factory::create($this->entity_service); |
|
| 1277 | + $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); |
|
| 1278 | + $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); |
|
| 1279 | + $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); |
|
| 1280 | + $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service); |
|
| 1281 | 1281 | |
| 1282 | - $jsonld_cache = new Ttl_Cache( 'jsonld', 86400 ); |
|
| 1283 | - $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache ); |
|
| 1284 | - $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter ); |
|
| 1282 | + $jsonld_cache = new Ttl_Cache('jsonld', 86400); |
|
| 1283 | + $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter($this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache); |
|
| 1284 | + $this->jsonld_service = new Wordlift_Jsonld_Service($this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter); |
|
| 1285 | 1285 | |
| 1286 | 1286 | /* |
| 1287 | 1287 | * Load the `Wordlift_Term_JsonLd_Adapter`. |
@@ -1290,29 +1290,29 @@ discard block |
||
| 1290 | 1290 | * |
| 1291 | 1291 | * @since 3.20.0 |
| 1292 | 1292 | */ |
| 1293 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1294 | - $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->jsonld_service ); |
|
| 1293 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1294 | + $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter($this->entity_uri_service, $this->jsonld_service); |
|
| 1295 | 1295 | $jsonld_service = new Jsonld_Service( |
| 1296 | 1296 | $this->jsonld_service, |
| 1297 | 1297 | $term_jsonld_adapter, |
| 1298 | - new Jsonld_User_Service( $this->user_service ) ); |
|
| 1299 | - new Jsonld_Endpoint( $jsonld_service, $this->entity_uri_service ); |
|
| 1298 | + new Jsonld_User_Service($this->user_service) ); |
|
| 1299 | + new Jsonld_Endpoint($jsonld_service, $this->entity_uri_service); |
|
| 1300 | 1300 | |
| 1301 | 1301 | // Prints the JSON-LD in the head. |
| 1302 | - new Jsonld_Adapter( $this->jsonld_service ); |
|
| 1302 | + new Jsonld_Adapter($this->jsonld_service); |
|
| 1303 | 1303 | |
| 1304 | - new Jsonld_By_Id_Endpoint( $this->jsonld_service, $this->entity_uri_service ); |
|
| 1304 | + new Jsonld_By_Id_Endpoint($this->jsonld_service, $this->entity_uri_service); |
|
| 1305 | 1305 | |
| 1306 | - $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
|
| 1307 | - $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service ); |
|
| 1306 | + $this->key_validation_service = new Wordlift_Key_Validation_Service($this->configuration_service); |
|
| 1307 | + $this->content_filter_service = new Wordlift_Content_Filter_Service($this->entity_service, $this->configuration_service, $this->entity_uri_service); |
|
| 1308 | 1308 | // Creating Faq Content filter service. |
| 1309 | 1309 | $this->faq_content_filter_service = new Faq_Content_Filter(); |
| 1310 | - $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
|
| 1311 | - $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service ); |
|
| 1312 | - $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
|
| 1313 | - $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->entity_service ); |
|
| 1310 | + $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service($this->content_filter_service, $this->entity_service); |
|
| 1311 | + $this->sample_data_service = new Wordlift_Sample_Data_Service($this->entity_type_service, $this->configuration_service, $this->user_service); |
|
| 1312 | + $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter($this->sample_data_service); |
|
| 1313 | + $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service($this->entity_service); |
|
| 1314 | 1314 | |
| 1315 | - $this->loader->add_action( 'enqueue_block_editor_assets', $this, 'add_wl_enabled_blocks' ); |
|
| 1315 | + $this->loader->add_action('enqueue_block_editor_assets', $this, 'add_wl_enabled_blocks'); |
|
| 1316 | 1316 | |
| 1317 | 1317 | /** |
| 1318 | 1318 | * Filter: wl_feature__enable__blocks. |
@@ -1322,15 +1322,15 @@ discard block |
||
| 1322 | 1322 | * @return bool |
| 1323 | 1323 | * @since 3.27.6 |
| 1324 | 1324 | */ |
| 1325 | - if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 1325 | + if (apply_filters('wl_feature__enable__blocks', true)) { |
|
| 1326 | 1326 | // Initialize the short-codes. |
| 1327 | - new Async_Template_Decorator( new Wordlift_Navigator_Shortcode() ); |
|
| 1327 | + new Async_Template_Decorator(new Wordlift_Navigator_Shortcode()); |
|
| 1328 | 1328 | new Wordlift_Chord_Shortcode(); |
| 1329 | 1329 | new Wordlift_Geomap_Shortcode(); |
| 1330 | 1330 | new Wordlift_Timeline_Shortcode(); |
| 1331 | - new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
|
| 1332 | - new Wordlift_Vocabulary_Shortcode( $this->configuration_service ); |
|
| 1333 | - new Async_Template_Decorator( new Wordlift_Faceted_Search_Shortcode() ); |
|
| 1331 | + new Wordlift_Related_Entities_Cloud_Shortcode($this->relation_service); |
|
| 1332 | + new Wordlift_Vocabulary_Shortcode($this->configuration_service); |
|
| 1333 | + new Async_Template_Decorator(new Wordlift_Faceted_Search_Shortcode()); |
|
| 1334 | 1334 | } |
| 1335 | 1335 | |
| 1336 | 1336 | new Wordlift_Products_Navigator_Shortcode(); |
@@ -1343,18 +1343,18 @@ discard block |
||
| 1343 | 1343 | new Wordlift_Seo_Service(); |
| 1344 | 1344 | |
| 1345 | 1345 | // Initialize the AMP service. |
| 1346 | - new Wordlift_AMP_Service( $this->jsonld_service ); |
|
| 1346 | + new Wordlift_AMP_Service($this->jsonld_service); |
|
| 1347 | 1347 | |
| 1348 | 1348 | /** Services. */ |
| 1349 | 1349 | $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
| 1350 | 1350 | new Wordlift_Image_Service(); |
| 1351 | 1351 | |
| 1352 | 1352 | /** Adapters. */ |
| 1353 | - $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
|
| 1354 | - $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service ); |
|
| 1355 | - $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 1353 | + $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter($this->entity_type_service); |
|
| 1354 | + $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter($this->publisher_service); |
|
| 1355 | + $this->tinymce_adapter = new Wordlift_Tinymce_Adapter($this); |
|
| 1356 | 1356 | //$this->faq_tinymce_adapter = new Faq_Tinymce_Adapter(); |
| 1357 | - $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
|
| 1357 | + $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter($this->relation_rebuild_service); |
|
| 1358 | 1358 | |
| 1359 | 1359 | /* |
| 1360 | 1360 | * Exclude our public js from WP-Rocket. |
@@ -1372,9 +1372,9 @@ discard block |
||
| 1372 | 1372 | ); |
| 1373 | 1373 | |
| 1374 | 1374 | $that = $this; |
| 1375 | - add_action( 'plugins_loaded', function () use ( $that ) { |
|
| 1376 | - if ( ! apply_filters( 'wl_feature__enable__dataset-ng', false ) ) { |
|
| 1377 | - new Wordlift_Linked_Data_Service( $that->entity_service, $that->entity_type_service, $that->schema_service, $that->sparql_service ); |
|
| 1375 | + add_action('plugins_loaded', function() use ($that) { |
|
| 1376 | + if ( ! apply_filters('wl_feature__enable__dataset-ng', false)) { |
|
| 1377 | + new Wordlift_Linked_Data_Service($that->entity_service, $that->entity_type_service, $that->schema_service, $that->sparql_service); |
|
| 1378 | 1378 | new Wordlift_Sparql_Query_Async_Task(); |
| 1379 | 1379 | new Wordlift_Push_References_Async_Task(); |
| 1380 | 1380 | } |
@@ -1389,14 +1389,14 @@ discard block |
||
| 1389 | 1389 | $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
| 1390 | 1390 | $this->country_select_element = new Wordlift_Admin_Country_Select_Element(); |
| 1391 | 1391 | $tabs_element = new Wordlift_Admin_Tabs_Element(); |
| 1392 | - $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element ); |
|
| 1393 | - $this->author_element = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element ); |
|
| 1392 | + $this->publisher_element = new Wordlift_Admin_Publisher_Element($this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element); |
|
| 1393 | + $this->author_element = new Wordlift_Admin_Author_Element($this->publisher_service, $this->select2_element); |
|
| 1394 | 1394 | |
| 1395 | - $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 ); |
|
| 1396 | - $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 1395 | + $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); |
|
| 1396 | + $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link($this->settings_page); |
|
| 1397 | 1397 | |
| 1398 | - $this->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element ); |
|
| 1399 | - $this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page ); |
|
| 1398 | + $this->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page($this->configuration_service, $this->input_element, $this->radio_input_element); |
|
| 1399 | + $this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link($this->analytics_settings_page); |
|
| 1400 | 1400 | $this->analytics_connect = new Wordlift_Analytics_Connect(); |
| 1401 | 1401 | |
| 1402 | 1402 | // Pages. |
@@ -1407,9 +1407,9 @@ discard block |
||
| 1407 | 1407 | * |
| 1408 | 1408 | * @see https://github.com/insideout10/wordlift-plugin/issues/914 |
| 1409 | 1409 | */ |
| 1410 | - if ( apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 1411 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1412 | - new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 1410 | + if (apply_filters('wl_can_see_classification_box', true)) { |
|
| 1411 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1412 | + new Wordlift_Admin_Post_Edit_Page($this); |
|
| 1413 | 1413 | } |
| 1414 | 1414 | new Wordlift_Entity_Type_Admin_Service(); |
| 1415 | 1415 | |
@@ -1423,23 +1423,23 @@ discard block |
||
| 1423 | 1423 | $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
| 1424 | 1424 | |
| 1425 | 1425 | /* WordPress Admin. */ |
| 1426 | - $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 1427 | - $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 1426 | + $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page($this->configuration_service); |
|
| 1427 | + $this->status_page = new Wordlift_Admin_Status_Page($this->entity_service, $this->sparql_service); |
|
| 1428 | 1428 | |
| 1429 | 1429 | // Create an instance of the install wizard. |
| 1430 | - $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 ); |
|
| 1430 | + $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); |
|
| 1431 | 1431 | |
| 1432 | - $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1432 | + $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service($this->entity_post_type_service); |
|
| 1433 | 1433 | |
| 1434 | 1434 | // User Profile. |
| 1435 | - new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1435 | + new Wordlift_Admin_User_Profile_Page($this->author_element, $this->user_service); |
|
| 1436 | 1436 | |
| 1437 | 1437 | $this->entity_page_service = new Wordlift_Entity_Page_Service(); |
| 1438 | 1438 | |
| 1439 | 1439 | // Load the debug service if WP is in debug mode. |
| 1440 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1441 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1442 | - new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1440 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
| 1441 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-debug-service.php'; |
|
| 1442 | + new Wordlift_Debug_Service($this->entity_service, $uri_service); |
|
| 1443 | 1443 | } |
| 1444 | 1444 | |
| 1445 | 1445 | // Remote Image Service. |
@@ -1452,12 +1452,12 @@ discard block |
||
| 1452 | 1452 | * |
| 1453 | 1453 | * @see https://github.com/insideout10/wordlift-plugin/issues/852. |
| 1454 | 1454 | */ |
| 1455 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php'; |
|
| 1456 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1457 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1455 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-batch-action.php'; |
|
| 1456 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1457 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1458 | 1458 | |
| 1459 | 1459 | // Create an instance of the Mapping Service and assign it to the Ajax Adapter. |
| 1460 | - new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) ); |
|
| 1460 | + new Wordlift_Mapping_Ajax_Adapter(new Wordlift_Mapping_Service(Wordlift_Entity_Type_Service::get_instance())); |
|
| 1461 | 1461 | |
| 1462 | 1462 | /* |
| 1463 | 1463 | * Batch Operations. They're similar to Batch Actions but do not require working on post types. |
@@ -1466,8 +1466,8 @@ discard block |
||
| 1466 | 1466 | * |
| 1467 | 1467 | * @since 3.20.0 |
| 1468 | 1468 | */ |
| 1469 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1470 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1469 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1470 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1471 | 1471 | |
| 1472 | 1472 | /* |
| 1473 | 1473 | * Add the Search Keywords taxonomy to manage the Search Keywords on WLS. |
@@ -1476,8 +1476,8 @@ discard block |
||
| 1476 | 1476 | * |
| 1477 | 1477 | * @since 3.20.0 |
| 1478 | 1478 | */ |
| 1479 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php'; |
|
| 1480 | - new Wordlift_Search_Keyword_Taxonomy( $api_service ); |
|
| 1479 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php'; |
|
| 1480 | + new Wordlift_Search_Keyword_Taxonomy($api_service); |
|
| 1481 | 1481 | |
| 1482 | 1482 | /* |
| 1483 | 1483 | * Load the Mappings JSON-LD post processing. |
@@ -1491,11 +1491,11 @@ discard block |
||
| 1491 | 1491 | // Taxonomy term rule validator for validating rules for term pages. |
| 1492 | 1492 | new Taxonomy_Term_Rule_Validator(); |
| 1493 | 1493 | new Post_Taxonomy_Term_Rule_Validator(); |
| 1494 | - $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator ); |
|
| 1495 | - $rule_groups_validator = new Rule_Groups_Validator( $rule_validators_registry ); |
|
| 1496 | - $mappings_validator = new Mappings_Validator( $mappings_dbo, $rule_groups_validator ); |
|
| 1494 | + $rule_validators_registry = new Rule_Validators_Registry($default_rule_validator); |
|
| 1495 | + $rule_groups_validator = new Rule_Groups_Validator($rule_validators_registry); |
|
| 1496 | + $mappings_validator = new Mappings_Validator($mappings_dbo, $rule_groups_validator); |
|
| 1497 | 1497 | |
| 1498 | - new Url_To_Entity_Transform_Function( $this->entity_uri_service ); |
|
| 1498 | + new Url_To_Entity_Transform_Function($this->entity_uri_service); |
|
| 1499 | 1499 | new Taxonomy_To_Terms_Transform_Function(); |
| 1500 | 1500 | new Post_Id_To_Entity_Transform_Function(); |
| 1501 | 1501 | $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry(); |
@@ -1505,7 +1505,7 @@ discard block |
||
| 1505 | 1505 | * Intiailize the acf group data formatter. |
| 1506 | 1506 | */ |
| 1507 | 1507 | new Acf_Group_Formatter(); |
| 1508 | - new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry ); |
|
| 1508 | + new Jsonld_Converter($mappings_validator, $mappings_transform_functions_registry); |
|
| 1509 | 1509 | |
| 1510 | 1510 | /** |
| 1511 | 1511 | * @since 3.26.0 |
@@ -1526,7 +1526,7 @@ discard block |
||
| 1526 | 1526 | /* |
| 1527 | 1527 | * Create a singleton for the Analysis_Response_Ops_Factory. |
| 1528 | 1528 | */ |
| 1529 | - $entity_helper = new Entity_Helper( $this->entity_uri_service, $this->entity_service ); |
|
| 1529 | + $entity_helper = new Entity_Helper($this->entity_uri_service, $this->entity_service); |
|
| 1530 | 1530 | new Analysis_Response_Ops_Factory( |
| 1531 | 1531 | $this->entity_uri_service, |
| 1532 | 1532 | $this->entity_service, |
@@ -1536,11 +1536,11 @@ discard block |
||
| 1536 | 1536 | ); |
| 1537 | 1537 | |
| 1538 | 1538 | /** WL Autocomplete. */ |
| 1539 | - $autocomplete_service = new All_Autocomplete_Service( array( |
|
| 1539 | + $autocomplete_service = new All_Autocomplete_Service(array( |
|
| 1540 | 1540 | new Local_Autocomplete_Service(), |
| 1541 | - new Linked_Data_Autocomplete_Service( $this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service ), |
|
| 1542 | - ) ); |
|
| 1543 | - $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service ); |
|
| 1541 | + new Linked_Data_Autocomplete_Service($this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service), |
|
| 1542 | + )); |
|
| 1543 | + $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter($autocomplete_service); |
|
| 1544 | 1544 | |
| 1545 | 1545 | /** |
| 1546 | 1546 | * @since 3.27.2 |
@@ -1549,10 +1549,10 @@ discard block |
||
| 1549 | 1549 | */ |
| 1550 | 1550 | new Recipe_Maker_Post_Type_Hook(); |
| 1551 | 1551 | $recipe_maker_validation_service = new Recipe_Maker_Validation_Service(); |
| 1552 | - new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service ); |
|
| 1553 | - new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service ); |
|
| 1554 | - new Recipe_Maker_Warning( $recipe_maker_validation_service ); |
|
| 1555 | - new Yoast_Jsonld( $recipe_maker_validation_service ); |
|
| 1552 | + new Recipe_Maker_Jsonld_Hook($attachment_service, $recipe_maker_validation_service); |
|
| 1553 | + new Recipe_Maker_After_Get_Jsonld_Hook($recipe_maker_validation_service); |
|
| 1554 | + new Recipe_Maker_Warning($recipe_maker_validation_service); |
|
| 1555 | + new Yoast_Jsonld($recipe_maker_validation_service); |
|
| 1556 | 1556 | |
| 1557 | 1557 | /** |
| 1558 | 1558 | * @since 3.27.4 |
@@ -1563,22 +1563,22 @@ discard block |
||
| 1563 | 1563 | * @since 3.27.8 |
| 1564 | 1564 | * @see https://github.com/insideout10/wordlift-plugin/issues/1248 |
| 1565 | 1565 | */ |
| 1566 | - new Key_Validation_Notice( $this->key_validation_service, $this->configuration_service ); |
|
| 1566 | + new Key_Validation_Notice($this->key_validation_service, $this->configuration_service); |
|
| 1567 | 1567 | /** |
| 1568 | 1568 | * @since 3.29.0 |
| 1569 | 1569 | * @see https://github.com/insideout10/wordlift-plugin/issues/1304 |
| 1570 | 1570 | */ |
| 1571 | - new Entity_Rest_Service( $this->entity_type_service ); |
|
| 1571 | + new Entity_Rest_Service($this->entity_type_service); |
|
| 1572 | 1572 | |
| 1573 | 1573 | /** |
| 1574 | 1574 | * Expand author in to references. |
| 1575 | 1575 | * @since 3.30.0 |
| 1576 | 1576 | * @see https://github.com/insideout10/wordlift-plugin/issues/1318 |
| 1577 | 1577 | */ |
| 1578 | - add_action('plugins_loaded', function () use ( $that ) { |
|
| 1578 | + add_action('plugins_loaded', function() use ($that) { |
|
| 1579 | 1579 | |
| 1580 | - if ( apply_filters( 'wl_feature__enable__article-wrapper', false ) ) { |
|
| 1581 | - new Jsonld_Article_Wrapper( Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter ); |
|
| 1580 | + if (apply_filters('wl_feature__enable__article-wrapper', false)) { |
|
| 1581 | + new Jsonld_Article_Wrapper(Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter); |
|
| 1582 | 1582 | } |
| 1583 | 1583 | |
| 1584 | 1584 | |
@@ -1598,9 +1598,9 @@ discard block |
||
| 1598 | 1598 | private function set_locale() { |
| 1599 | 1599 | |
| 1600 | 1600 | $plugin_i18n = new Wordlift_i18n(); |
| 1601 | - $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1601 | + $plugin_i18n->set_domain($this->get_plugin_name()); |
|
| 1602 | 1602 | |
| 1603 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1603 | + $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain'); |
|
| 1604 | 1604 | |
| 1605 | 1605 | } |
| 1606 | 1606 | |
@@ -1621,29 +1621,29 @@ discard block |
||
| 1621 | 1621 | $this->user_service |
| 1622 | 1622 | ); |
| 1623 | 1623 | |
| 1624 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1625 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 ); |
|
| 1624 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles'); |
|
| 1625 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11); |
|
| 1626 | 1626 | |
| 1627 | 1627 | // Hook the init action to taxonomy services. |
| 1628 | - $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1629 | - $this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 ); |
|
| 1628 | + $this->loader->add_action('init', $this->topic_taxonomy_service, 'init', 0); |
|
| 1629 | + $this->loader->add_action('init', $this->entity_types_taxonomy_service, 'init', 0); |
|
| 1630 | 1630 | |
| 1631 | 1631 | // Hook the deleted_post_meta action to the Thumbnail service. |
| 1632 | - $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1632 | + $this->loader->add_action('deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4); |
|
| 1633 | 1633 | |
| 1634 | 1634 | // Hook the added_post_meta action to the Thumbnail service. |
| 1635 | - $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1635 | + $this->loader->add_action('added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4); |
|
| 1636 | 1636 | |
| 1637 | 1637 | // Hook the updated_post_meta action to the Thumbnail service. |
| 1638 | - $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1638 | + $this->loader->add_action('updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4); |
|
| 1639 | 1639 | |
| 1640 | 1640 | // Hook the AJAX wl_timeline action to the Timeline service. |
| 1641 | - $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1641 | + $this->loader->add_action('wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline'); |
|
| 1642 | 1642 | |
| 1643 | 1643 | // Register custom allowed redirect hosts. |
| 1644 | - $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1644 | + $this->loader->add_filter('allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts'); |
|
| 1645 | 1645 | // Hook the AJAX wordlift_redirect action to the Redirect service. |
| 1646 | - $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1646 | + $this->loader->add_action('wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect'); |
|
| 1647 | 1647 | |
| 1648 | 1648 | /* |
| 1649 | 1649 | * The old dashboard is replaced with dashboard v2. |
@@ -1661,46 +1661,46 @@ discard block |
||
| 1661 | 1661 | |
| 1662 | 1662 | // Hook save_post to the entity service to update custom fields (such as alternate labels). |
| 1663 | 1663 | // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
| 1664 | - $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1665 | - $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1664 | + $this->loader->add_action('save_post', $this->entity_service, 'save_post', 9, 3); |
|
| 1665 | + $this->loader->add_action('save_post', $this->rating_service, 'set_rating_for', 20, 1); |
|
| 1666 | 1666 | |
| 1667 | - $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1668 | - $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1667 | + $this->loader->add_action('edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1); |
|
| 1668 | + $this->loader->add_action('in_admin_header', $this->rating_service, 'in_admin_header'); |
|
| 1669 | 1669 | |
| 1670 | 1670 | // Entity listing customization (wp-admin/edit.php) |
| 1671 | 1671 | // Add custom columns. |
| 1672 | - $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1672 | + $this->loader->add_filter('manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns'); |
|
| 1673 | 1673 | // no explicit entity as it prevents handling of other post types. |
| 1674 | - $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1674 | + $this->loader->add_filter('manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2); |
|
| 1675 | 1675 | // Add 4W selection. |
| 1676 | - $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1677 | - $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1678 | - $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' ); |
|
| 1679 | - $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' ); |
|
| 1676 | + $this->loader->add_action('restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope'); |
|
| 1677 | + $this->loader->add_filter('posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope'); |
|
| 1678 | + $this->loader->add_action('pre_get_posts', $this->entity_list_service, 'pre_get_posts'); |
|
| 1679 | + $this->loader->add_action('load-edit.php', $this->entity_list_service, 'load_edit'); |
|
| 1680 | 1680 | |
| 1681 | 1681 | /* |
| 1682 | 1682 | * If `All Entity Types` is disable, use the radio button Walker. |
| 1683 | 1683 | * |
| 1684 | 1684 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1685 | 1685 | */ |
| 1686 | - if ( ! WL_ALL_ENTITY_TYPES ) { |
|
| 1687 | - $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1686 | + if ( ! WL_ALL_ENTITY_TYPES) { |
|
| 1687 | + $this->loader->add_filter('wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args'); |
|
| 1688 | 1688 | } |
| 1689 | 1689 | |
| 1690 | 1690 | // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
| 1691 | 1691 | // entities. |
| 1692 | - $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1692 | + $this->loader->add_filter('prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2); |
|
| 1693 | 1693 | |
| 1694 | 1694 | // Filter imported post meta. |
| 1695 | - $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1695 | + $this->loader->add_filter('wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3); |
|
| 1696 | 1696 | |
| 1697 | 1697 | // Notify the import service when an import starts and ends. |
| 1698 | - $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1699 | - $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1698 | + $this->loader->add_action('import_start', $this->import_service, 'import_start', 10, 0); |
|
| 1699 | + $this->loader->add_action('import_end', $this->import_service, 'import_end', 10, 0); |
|
| 1700 | 1700 | |
| 1701 | 1701 | // Hook the AJAX wl_rebuild action to the Rebuild Service. |
| 1702 | - $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1703 | - $this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' ); |
|
| 1702 | + $this->loader->add_action('wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild'); |
|
| 1703 | + $this->loader->add_action('wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild'); |
|
| 1704 | 1704 | |
| 1705 | 1705 | /** |
| 1706 | 1706 | * Filter: wl_feature__enable__screens. |
@@ -1710,34 +1710,34 @@ discard block |
||
| 1710 | 1710 | * @return bool |
| 1711 | 1711 | * @since 3.27.6 |
| 1712 | 1712 | */ |
| 1713 | - if ( apply_filters( 'wl_feature__enable__screens', true ) ) { |
|
| 1713 | + if (apply_filters('wl_feature__enable__screens', true)) { |
|
| 1714 | 1714 | // Hook the menu to the Download Your Data page. |
| 1715 | - $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 ); |
|
| 1716 | - $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 ); |
|
| 1717 | - $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 ); |
|
| 1715 | + $this->loader->add_action('admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0); |
|
| 1716 | + $this->loader->add_action('admin_menu', $this->status_page, 'admin_menu', 100, 0); |
|
| 1717 | + $this->loader->add_action('admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0); |
|
| 1718 | 1718 | } |
| 1719 | 1719 | // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
| 1720 | - $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1720 | + $this->loader->add_action('wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10); |
|
| 1721 | 1721 | |
| 1722 | 1722 | // Hook the AJAX wl_jsonld action to the JSON-LD service. |
| 1723 | - $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1724 | - $this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1725 | - $this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1723 | + $this->loader->add_action('wp_ajax_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1724 | + $this->loader->add_action('admin_post_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1725 | + $this->loader->add_action('admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1726 | 1726 | |
| 1727 | 1727 | // Hook the AJAX wl_validate_key action to the Key Validation service. |
| 1728 | - $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1728 | + $this->loader->add_action('wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key'); |
|
| 1729 | 1729 | |
| 1730 | 1730 | // Hook the AJAX wl_update_country_options action to the countries. |
| 1731 | - $this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' ); |
|
| 1731 | + $this->loader->add_action('wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html'); |
|
| 1732 | 1732 | |
| 1733 | 1733 | // Hook the `admin_init` function to the Admin Setup. |
| 1734 | - $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1734 | + $this->loader->add_action('admin_init', $this->admin_setup, 'admin_init'); |
|
| 1735 | 1735 | |
| 1736 | 1736 | // Hook the admin_init to the settings page. |
| 1737 | - $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1738 | - $this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' ); |
|
| 1737 | + $this->loader->add_action('admin_init', $this->settings_page, 'admin_init'); |
|
| 1738 | + $this->loader->add_action('admin_init', $this->analytics_settings_page, 'admin_init'); |
|
| 1739 | 1739 | |
| 1740 | - $this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' ); |
|
| 1740 | + $this->loader->add_filter('admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction'); |
|
| 1741 | 1741 | |
| 1742 | 1742 | // Hook the menu creation on the general wordlift menu creation. |
| 1743 | 1743 | /** |
@@ -1748,8 +1748,8 @@ discard block |
||
| 1748 | 1748 | * @return bool |
| 1749 | 1749 | * @since 3.27.6 |
| 1750 | 1750 | */ |
| 1751 | - if ( apply_filters( 'wl_feature__enable__screens', true ) ) { |
|
| 1752 | - $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 ); |
|
| 1751 | + if (apply_filters('wl_feature__enable__screens', true)) { |
|
| 1752 | + $this->loader->add_action('wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2); |
|
| 1753 | 1753 | } |
| 1754 | 1754 | /* |
| 1755 | 1755 | * Display the `Wordlift_Admin_Search_Rankings_Page` page. |
@@ -1758,7 +1758,7 @@ discard block |
||
| 1758 | 1758 | * |
| 1759 | 1759 | * @since 3.20.0 |
| 1760 | 1760 | */ |
| 1761 | - if ( in_array( $this->configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) { |
|
| 1761 | + if (in_array($this->configuration_service->get_package_type(), array('editorial', 'business'))) { |
|
| 1762 | 1762 | /** |
| 1763 | 1763 | * Filter: wl_feature__enable__screens. |
| 1764 | 1764 | * |
@@ -1774,11 +1774,11 @@ discard block |
||
| 1774 | 1774 | } |
| 1775 | 1775 | |
| 1776 | 1776 | // Hook key update. |
| 1777 | - $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1778 | - $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1777 | + $this->loader->add_action('pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2); |
|
| 1778 | + $this->loader->add_action('update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2); |
|
| 1779 | 1779 | |
| 1780 | 1780 | // Add additional action links to the WordLift plugin in the plugins page. |
| 1781 | - $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1781 | + $this->loader->add_filter('plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1); |
|
| 1782 | 1782 | |
| 1783 | 1783 | /* |
| 1784 | 1784 | * Remove the Analytics Settings link from the plugin page. |
@@ -1789,25 +1789,25 @@ discard block |
||
| 1789 | 1789 | // $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 ); |
| 1790 | 1790 | |
| 1791 | 1791 | // Hook the AJAX `wl_publisher` action name. |
| 1792 | - $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1792 | + $this->loader->add_action('wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher'); |
|
| 1793 | 1793 | |
| 1794 | 1794 | // Hook row actions for the entity type list admin. |
| 1795 | - $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1795 | + $this->loader->add_filter('wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2); |
|
| 1796 | 1796 | |
| 1797 | 1797 | /** Ajax actions. */ |
| 1798 | - $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' ); |
|
| 1798 | + $this->loader->add_action('wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export'); |
|
| 1799 | 1799 | |
| 1800 | 1800 | // Hook capabilities manipulation to allow access to entity type admin |
| 1801 | 1801 | // page on WordPress versions before 4.7. |
| 1802 | 1802 | global $wp_version; |
| 1803 | - if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1804 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1803 | + if (version_compare($wp_version, '4.7', '<')) { |
|
| 1804 | + $this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4); |
|
| 1805 | 1805 | } |
| 1806 | 1806 | |
| 1807 | - $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1807 | + $this->loader->add_action('wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1); |
|
| 1808 | 1808 | |
| 1809 | 1809 | /** Adapters. */ |
| 1810 | - $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1810 | + $this->loader->add_filter('mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1); |
|
| 1811 | 1811 | /** |
| 1812 | 1812 | * Disabling Faq temporarily. |
| 1813 | 1813 | * Load the tinymce editor button on the tool bar. |
@@ -1818,56 +1818,56 @@ discard block |
||
| 1818 | 1818 | //$this->loader->add_filter( 'mce_external_plugins', $this->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 ); |
| 1819 | 1819 | |
| 1820 | 1820 | |
| 1821 | - $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' ); |
|
| 1822 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' ); |
|
| 1823 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' ); |
|
| 1821 | + $this->loader->add_action('wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all'); |
|
| 1822 | + $this->loader->add_action('wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create'); |
|
| 1823 | + $this->loader->add_action('wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete'); |
|
| 1824 | 1824 | /** |
| 1825 | 1825 | * @since 3.26.0 |
| 1826 | 1826 | */ |
| 1827 | - if ( apply_filters( 'wl_feature__enable__post_excerpt', true ) ) { |
|
| 1827 | + if (apply_filters('wl_feature__enable__post_excerpt', true)) { |
|
| 1828 | 1828 | $excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter(); |
| 1829 | - $this->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' ); |
|
| 1829 | + $this->loader->add_action('do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box'); |
|
| 1830 | 1830 | // Adding Rest route for the post excerpt |
| 1831 | 1831 | Post_Excerpt_Rest_Controller::register_routes(); |
| 1832 | 1832 | } |
| 1833 | 1833 | |
| 1834 | - $this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 ); |
|
| 1835 | - $this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 ); |
|
| 1834 | + $this->loader->add_action('update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5); |
|
| 1835 | + $this->loader->add_action('delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5); |
|
| 1836 | 1836 | |
| 1837 | 1837 | // Handle the autocomplete request. |
| 1838 | - add_action( 'wp_ajax_wl_autocomplete', array( |
|
| 1838 | + add_action('wp_ajax_wl_autocomplete', array( |
|
| 1839 | 1839 | $this->autocomplete_adapter, |
| 1840 | 1840 | 'wl_autocomplete', |
| 1841 | - ) ); |
|
| 1842 | - add_action( 'wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1841 | + )); |
|
| 1842 | + add_action('wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1843 | 1843 | $this->autocomplete_adapter, |
| 1844 | 1844 | 'wl_autocomplete', |
| 1845 | - ) ); |
|
| 1845 | + )); |
|
| 1846 | 1846 | |
| 1847 | 1847 | // Hooks to restrict multisite super admin from manipulating entity types. |
| 1848 | - if ( is_multisite() ) { |
|
| 1849 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1848 | + if (is_multisite()) { |
|
| 1849 | + $this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4); |
|
| 1850 | 1850 | } |
| 1851 | 1851 | |
| 1852 | - $deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service ); |
|
| 1852 | + $deactivator_feedback = new Wordlift_Deactivator_Feedback($this->configuration_service); |
|
| 1853 | 1853 | |
| 1854 | - add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) ); |
|
| 1855 | - add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) ); |
|
| 1856 | - add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) ); |
|
| 1854 | + add_action('admin_footer', array($deactivator_feedback, 'render_feedback_popup')); |
|
| 1855 | + add_action('admin_enqueue_scripts', array($deactivator_feedback, 'enqueue_popup_scripts')); |
|
| 1856 | + add_action('wp_ajax_wl_deactivation_feedback', array($deactivator_feedback, 'wl_deactivation_feedback')); |
|
| 1857 | 1857 | |
| 1858 | 1858 | /** |
| 1859 | 1859 | * Always allow the `wordlift/classification` block. |
| 1860 | 1860 | * |
| 1861 | 1861 | * @since 3.23.0 |
| 1862 | 1862 | */ |
| 1863 | - add_filter( 'allowed_block_types', function ( $value ) { |
|
| 1863 | + add_filter('allowed_block_types', function($value) { |
|
| 1864 | 1864 | |
| 1865 | - if ( true === $value ) { |
|
| 1865 | + if (true === $value) { |
|
| 1866 | 1866 | return $value; |
| 1867 | 1867 | } |
| 1868 | 1868 | |
| 1869 | - return array_merge( (array) $value, array( 'wordlift/classification' ) ); |
|
| 1870 | - }, PHP_INT_MAX ); |
|
| 1869 | + return array_merge((array) $value, array('wordlift/classification')); |
|
| 1870 | + }, PHP_INT_MAX); |
|
| 1871 | 1871 | |
| 1872 | 1872 | /** |
| 1873 | 1873 | * @since 3.27.7 |
@@ -1885,58 +1885,58 @@ discard block |
||
| 1885 | 1885 | */ |
| 1886 | 1886 | private function define_public_hooks() { |
| 1887 | 1887 | |
| 1888 | - $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1888 | + $plugin_public = new Wordlift_Public($this->get_plugin_name(), $this->get_version()); |
|
| 1889 | 1889 | |
| 1890 | 1890 | // Register the entity post type. |
| 1891 | - $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1891 | + $this->loader->add_action('init', $this->entity_post_type_service, 'register'); |
|
| 1892 | 1892 | |
| 1893 | 1893 | // Bind the link generation and handling hooks to the entity link service. |
| 1894 | - $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1895 | - $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1894 | + $this->loader->add_filter('post_type_link', $this->entity_link_service, 'post_type_link', 10, 4); |
|
| 1895 | + $this->loader->add_action('pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1); |
|
| 1896 | 1896 | // $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 ); |
| 1897 | 1897 | // $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 ); |
| 1898 | 1898 | |
| 1899 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1900 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1901 | - $this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' ); |
|
| 1899 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles'); |
|
| 1900 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts'); |
|
| 1901 | + $this->loader->add_action('wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts'); |
|
| 1902 | 1902 | |
| 1903 | 1903 | // Registering Faq_Content_Filter service used for removing faq question and answer tags from the html. |
| 1904 | - $this->loader->add_filter( 'the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' ); |
|
| 1904 | + $this->loader->add_filter('the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags'); |
|
| 1905 | 1905 | // Hook the content filter service to add entity links. |
| 1906 | - if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) { |
|
| 1907 | - $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1906 | + if ( ! defined('WL_DISABLE_CONTENT_FILTER') || ! WL_DISABLE_CONTENT_FILTER) { |
|
| 1907 | + $this->loader->add_filter('the_content', $this->content_filter_service, 'the_content'); |
|
| 1908 | 1908 | } |
| 1909 | 1909 | |
| 1910 | 1910 | // Hook the AJAX wl_timeline action to the Timeline service. |
| 1911 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1911 | + $this->loader->add_action('wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline'); |
|
| 1912 | 1912 | |
| 1913 | 1913 | // Hook the ShareThis service. |
| 1914 | - $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1915 | - $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1914 | + $this->loader->add_filter('the_content', $this->sharethis_service, 'the_content', 99); |
|
| 1915 | + $this->loader->add_filter('the_excerpt', $this->sharethis_service, 'the_excerpt', 99); |
|
| 1916 | 1916 | |
| 1917 | 1917 | // Hook the AJAX wl_jsonld action to the JSON-LD service. |
| 1918 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1918 | + $this->loader->add_action('wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1919 | 1919 | |
| 1920 | 1920 | // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
| 1921 | 1921 | // in order to tweak WP's `WP_Query` to include entities in queries related |
| 1922 | 1922 | // to categories. |
| 1923 | - $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1923 | + $this->loader->add_action('pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1); |
|
| 1924 | 1924 | |
| 1925 | 1925 | /* |
| 1926 | 1926 | * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service` |
| 1927 | 1927 | * in order to tweak WP's `WP_Query` to show event related entities in reverse |
| 1928 | 1928 | * order of start time. |
| 1929 | 1929 | */ |
| 1930 | - $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1930 | + $this->loader->add_action('pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1); |
|
| 1931 | 1931 | |
| 1932 | - $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1932 | + $this->loader->add_action('wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1); |
|
| 1933 | 1933 | |
| 1934 | 1934 | // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
| 1935 | - $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1935 | + $this->loader->add_action('save_post', $this->entity_type_adapter, 'save_post', 9, 3); |
|
| 1936 | 1936 | |
| 1937 | 1937 | // Analytics Script Frontend. |
| 1938 | - if ( $this->configuration_service->is_analytics_enable() ) { |
|
| 1939 | - $this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 ); |
|
| 1938 | + if ($this->configuration_service->is_analytics_enable()) { |
|
| 1939 | + $this->loader->add_action('wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10); |
|
| 1940 | 1940 | } |
| 1941 | 1941 | |
| 1942 | 1942 | } |
@@ -1989,11 +1989,11 @@ discard block |
||
| 1989 | 1989 | */ |
| 1990 | 1990 | private function load_cli_dependencies() { |
| 1991 | 1991 | |
| 1992 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php'; |
|
| 1992 | + require_once plugin_dir_path(dirname(__FILE__)).'cli/class-wordlift-push-reference-data-command.php'; |
|
| 1993 | 1993 | |
| 1994 | - $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 ); |
|
| 1994 | + $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); |
|
| 1995 | 1995 | |
| 1996 | - WP_CLI::add_command( 'wl references push', $push_reference_data_command ); |
|
| 1996 | + WP_CLI::add_command('wl references push', $push_reference_data_command); |
|
| 1997 | 1997 | |
| 1998 | 1998 | } |
| 1999 | 1999 | |
@@ -2018,13 +2018,13 @@ discard block |
||
| 2018 | 2018 | * @since 3.27.6 |
| 2019 | 2019 | */ |
| 2020 | 2020 | |
| 2021 | - wp_register_script( 'wl_enabled_blocks', false ); |
|
| 2021 | + wp_register_script('wl_enabled_blocks', false); |
|
| 2022 | 2022 | |
| 2023 | - $enabled_blocks = array( 'wordlift/products-navigator' ); |
|
| 2023 | + $enabled_blocks = array('wordlift/products-navigator'); |
|
| 2024 | 2024 | |
| 2025 | - if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 2025 | + if (apply_filters('wl_feature__enable__blocks', true)) { |
|
| 2026 | 2026 | // To intimate JS |
| 2027 | - $enabled_blocks = array_merge( $enabled_blocks, array( |
|
| 2027 | + $enabled_blocks = array_merge($enabled_blocks, array( |
|
| 2028 | 2028 | 'wordlift/navigator', |
| 2029 | 2029 | 'wordlift/chord', |
| 2030 | 2030 | 'wordlift/geomap', |
@@ -2032,11 +2032,11 @@ discard block |
||
| 2032 | 2032 | 'wordlift/cloud', |
| 2033 | 2033 | 'wordlift/vocabulary', |
| 2034 | 2034 | 'wordlift/faceted-search' |
| 2035 | - ) ); |
|
| 2035 | + )); |
|
| 2036 | 2036 | } |
| 2037 | 2037 | |
| 2038 | - wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks ); |
|
| 2039 | - wp_enqueue_script( 'wl_enabled_blocks' ); |
|
| 2038 | + wp_localize_script('wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks); |
|
| 2039 | + wp_enqueue_script('wl_enabled_blocks'); |
|
| 2040 | 2040 | } |
| 2041 | 2041 | |
| 2042 | 2042 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | // If this file is called directly, abort. |
| 52 | 52 | if ( ! defined( 'WPINC' ) ) { |
| 53 | - die; |
|
| 53 | + die; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php'; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | function wl_write_log( $log ) { |
| 75 | 75 | |
| 76 | - Wordlift_Log_Service::get_instance()->debug( $log ); |
|
| 76 | + Wordlift_Log_Service::get_instance()->debug( $log ); |
|
| 77 | 77 | |
| 78 | 78 | } |
| 79 | 79 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | function wl_write_log_hide_key( $text ) { |
| 92 | 92 | |
| 93 | - return str_ireplace( wl_configuration_get_key(), '<hidden>', $text ); |
|
| 93 | + return str_ireplace( wl_configuration_get_key(), '<hidden>', $text ); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
@@ -98,21 +98,21 @@ discard block |
||
| 98 | 98 | * see http://vip.wordpress.com/documentation/register-additional-html-attributes-for-tinymce-and-wp-kses/ |
| 99 | 99 | */ |
| 100 | 100 | function wordlift_allowed_post_tags() { |
| 101 | - global $allowedposttags; |
|
| 102 | - |
|
| 103 | - $tags = array( 'span' ); |
|
| 104 | - $new_attributes = array( |
|
| 105 | - 'itemscope' => array(), |
|
| 106 | - 'itemtype' => array(), |
|
| 107 | - 'itemprop' => array(), |
|
| 108 | - 'itemid' => array(), |
|
| 109 | - ); |
|
| 110 | - |
|
| 111 | - foreach ( $tags as $tag ) { |
|
| 112 | - if ( isset( $allowedposttags[ $tag ] ) && is_array( $allowedposttags[ $tag ] ) ) { |
|
| 113 | - $allowedposttags[ $tag ] = array_merge( $allowedposttags[ $tag ], $new_attributes ); |
|
| 114 | - } |
|
| 115 | - } |
|
| 101 | + global $allowedposttags; |
|
| 102 | + |
|
| 103 | + $tags = array( 'span' ); |
|
| 104 | + $new_attributes = array( |
|
| 105 | + 'itemscope' => array(), |
|
| 106 | + 'itemtype' => array(), |
|
| 107 | + 'itemprop' => array(), |
|
| 108 | + 'itemid' => array(), |
|
| 109 | + ); |
|
| 110 | + |
|
| 111 | + foreach ( $tags as $tag ) { |
|
| 112 | + if ( isset( $allowedposttags[ $tag ] ) && is_array( $allowedposttags[ $tag ] ) ) { |
|
| 113 | + $allowedposttags[ $tag ] = array_merge( $allowedposttags[ $tag ], $new_attributes ); |
|
| 114 | + } |
|
| 115 | + } |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | // add allowed post tags. |
@@ -123,18 +123,18 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | function wordlift_admin_enqueue_scripts() { |
| 125 | 125 | |
| 126 | - // Added for compatibility with WordPress 3.9 (see http://make.wordpress.org/core/2014/04/16/jquery-ui-and-wpdialogs-in-wordpress-3-9/) |
|
| 127 | - wp_enqueue_script( 'wpdialogs' ); |
|
| 128 | - wp_enqueue_style( 'wp-jquery-ui-dialog' ); |
|
| 126 | + // Added for compatibility with WordPress 3.9 (see http://make.wordpress.org/core/2014/04/16/jquery-ui-and-wpdialogs-in-wordpress-3-9/) |
|
| 127 | + wp_enqueue_script( 'wpdialogs' ); |
|
| 128 | + wp_enqueue_style( 'wp-jquery-ui-dialog' ); |
|
| 129 | 129 | |
| 130 | - wp_enqueue_style( 'wordlift-reloaded', plugin_dir_url( __FILE__ ) . 'css/wordlift-reloaded.min.css' ); |
|
| 130 | + wp_enqueue_style( 'wordlift-reloaded', plugin_dir_url( __FILE__ ) . 'css/wordlift-reloaded.min.css' ); |
|
| 131 | 131 | |
| 132 | - wp_enqueue_script( 'jquery-ui-autocomplete' ); |
|
| 132 | + wp_enqueue_script( 'jquery-ui-autocomplete' ); |
|
| 133 | 133 | |
| 134 | - // Disable auto-save for custom entity posts only |
|
| 135 | - if ( Wordlift_Entity_Service::TYPE_NAME === get_post_type() ) { |
|
| 136 | - wp_dequeue_script( 'autosave' ); |
|
| 137 | - } |
|
| 134 | + // Disable auto-save for custom entity posts only |
|
| 135 | + if ( Wordlift_Entity_Service::TYPE_NAME === get_post_type() ) { |
|
| 136 | + wp_dequeue_script( 'autosave' ); |
|
| 137 | + } |
|
| 138 | 138 | |
| 139 | 139 | } |
| 140 | 140 | |
@@ -150,18 +150,18 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | function wordlift_allowed_html( $allowedtags, $context ) { |
| 152 | 152 | |
| 153 | - if ( 'post' !== $context ) { |
|
| 154 | - return $allowedtags; |
|
| 155 | - } |
|
| 156 | - |
|
| 157 | - return array_merge_recursive( $allowedtags, array( |
|
| 158 | - 'span' => array( |
|
| 159 | - 'itemscope' => true, |
|
| 160 | - 'itemtype' => true, |
|
| 161 | - 'itemid' => true, |
|
| 162 | - 'itemprop' => true, |
|
| 163 | - ), |
|
| 164 | - ) ); |
|
| 153 | + if ( 'post' !== $context ) { |
|
| 154 | + return $allowedtags; |
|
| 155 | + } |
|
| 156 | + |
|
| 157 | + return array_merge_recursive( $allowedtags, array( |
|
| 158 | + 'span' => array( |
|
| 159 | + 'itemscope' => true, |
|
| 160 | + 'itemtype' => true, |
|
| 161 | + 'itemid' => true, |
|
| 162 | + 'itemprop' => true, |
|
| 163 | + ), |
|
| 164 | + ) ); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | add_filter( 'wp_kses_allowed_html', 'wordlift_allowed_html', 10, 2 ); |
@@ -175,16 +175,16 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | function wl_get_coordinates( $post_id ) { |
| 177 | 177 | |
| 178 | - $latitude = wl_schema_get_value( $post_id, 'latitude' ); |
|
| 179 | - $longitude = wl_schema_get_value( $post_id, 'longitude' ); |
|
| 178 | + $latitude = wl_schema_get_value( $post_id, 'latitude' ); |
|
| 179 | + $longitude = wl_schema_get_value( $post_id, 'longitude' ); |
|
| 180 | 180 | |
| 181 | - // DO NOT set latitude/longitude to 0/0 as default values. It's a specific |
|
| 182 | - // place on the globe:"The zero/zero point of this system is located in the |
|
| 183 | - // Gulf of Guinea about 625 km (390 mi) south of Tema, Ghana." |
|
| 184 | - return array( |
|
| 185 | - 'latitude' => isset( $latitude[0] ) && is_numeric( $latitude[0] ) ? $latitude[0] : '', |
|
| 186 | - 'longitude' => isset( $longitude[0] ) && is_numeric( $longitude[0] ) ? $longitude[0] : '', |
|
| 187 | - ); |
|
| 181 | + // DO NOT set latitude/longitude to 0/0 as default values. It's a specific |
|
| 182 | + // place on the globe:"The zero/zero point of this system is located in the |
|
| 183 | + // Gulf of Guinea about 625 km (390 mi) south of Tema, Ghana." |
|
| 184 | + return array( |
|
| 185 | + 'latitude' => isset( $latitude[0] ) && is_numeric( $latitude[0] ) ? $latitude[0] : '', |
|
| 186 | + 'longitude' => isset( $longitude[0] ) && is_numeric( $longitude[0] ) ? $longitude[0] : '', |
|
| 187 | + ); |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
@@ -198,9 +198,9 @@ discard block |
||
| 198 | 198 | */ |
| 199 | 199 | function wl_get_image_urls( $post_id ) { |
| 200 | 200 | |
| 201 | - return Wordlift_Storage_Factory::get_instance() |
|
| 202 | - ->post_images() |
|
| 203 | - ->get( $post_id ); |
|
| 201 | + return Wordlift_Storage_Factory::get_instance() |
|
| 202 | + ->post_images() |
|
| 203 | + ->get( $post_id ); |
|
| 204 | 204 | |
| 205 | 205 | } |
| 206 | 206 | |
@@ -214,24 +214,24 @@ discard block |
||
| 214 | 214 | */ |
| 215 | 215 | function wl_get_attachment_for_source_url( $parent_post_id, $source_url ) { |
| 216 | 216 | |
| 217 | - // wl_write_log( "wl_get_attachment_for_source_url [ parent post id :: $parent_post_id ][ source url :: $source_url ]" ); |
|
| 217 | + // wl_write_log( "wl_get_attachment_for_source_url [ parent post id :: $parent_post_id ][ source url :: $source_url ]" ); |
|
| 218 | 218 | |
| 219 | - $posts = get_posts( array( |
|
| 220 | - 'post_type' => 'attachment', |
|
| 221 | - 'posts_per_page' => 1, |
|
| 222 | - 'post_status' => 'any', |
|
| 223 | - 'post_parent' => $parent_post_id, |
|
| 224 | - 'meta_key' => 'wl_source_url', |
|
| 225 | - 'meta_value' => $source_url, |
|
| 226 | - ) ); |
|
| 219 | + $posts = get_posts( array( |
|
| 220 | + 'post_type' => 'attachment', |
|
| 221 | + 'posts_per_page' => 1, |
|
| 222 | + 'post_status' => 'any', |
|
| 223 | + 'post_parent' => $parent_post_id, |
|
| 224 | + 'meta_key' => 'wl_source_url', |
|
| 225 | + 'meta_value' => $source_url, |
|
| 226 | + ) ); |
|
| 227 | 227 | |
| 228 | - // Return the found post. |
|
| 229 | - if ( 1 === count( $posts ) ) { |
|
| 230 | - return $posts[0]; |
|
| 231 | - } |
|
| 228 | + // Return the found post. |
|
| 229 | + if ( 1 === count( $posts ) ) { |
|
| 230 | + return $posts[0]; |
|
| 231 | + } |
|
| 232 | 232 | |
| 233 | - // Return null. |
|
| 234 | - return null; |
|
| 233 | + // Return null. |
|
| 234 | + return null; |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | /** |
@@ -242,8 +242,8 @@ discard block |
||
| 242 | 242 | */ |
| 243 | 243 | function wl_set_source_url( $post_id, $source_url ) { |
| 244 | 244 | |
| 245 | - delete_post_meta( $post_id, 'wl_source_url' ); |
|
| 246 | - add_post_meta( $post_id, 'wl_source_url', $source_url ); |
|
| 245 | + delete_post_meta( $post_id, 'wl_source_url' ); |
|
| 246 | + add_post_meta( $post_id, 'wl_source_url', $source_url ); |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | /** |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | */ |
| 261 | 261 | function wl_sanitize_uri_path( $path, $char = '_' ) { |
| 262 | 262 | |
| 263 | - return Wordlift_Uri_Service::get_instance()->sanitize_path( $path, $char ); |
|
| 263 | + return Wordlift_Uri_Service::get_instance()->sanitize_path( $path, $char ); |
|
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | /** |
@@ -272,47 +272,47 @@ discard block |
||
| 272 | 272 | */ |
| 273 | 273 | function wl_replace_item_id_with_uri( $content ) { |
| 274 | 274 | |
| 275 | - $log = Wordlift_Log_Service::get_logger( 'wl_replace_item_id_with_uri' ); |
|
| 276 | - $log->trace( 'Replacing item IDs with URIs...' ); |
|
| 275 | + $log = Wordlift_Log_Service::get_logger( 'wl_replace_item_id_with_uri' ); |
|
| 276 | + $log->trace( 'Replacing item IDs with URIs...' ); |
|
| 277 | 277 | |
| 278 | - // Strip slashes, see https://core.trac.wordpress.org/ticket/21767 |
|
| 279 | - $content = stripslashes( $content ); |
|
| 278 | + // Strip slashes, see https://core.trac.wordpress.org/ticket/21767 |
|
| 279 | + $content = stripslashes( $content ); |
|
| 280 | 280 | |
| 281 | - // If any match are found. |
|
| 282 | - $matches = array(); |
|
| 283 | - if ( 0 < preg_match_all( '/ itemid="([^"]+)"/i', $content, $matches, PREG_SET_ORDER ) ) { |
|
| 281 | + // If any match are found. |
|
| 282 | + $matches = array(); |
|
| 283 | + if ( 0 < preg_match_all( '/ itemid="([^"]+)"/i', $content, $matches, PREG_SET_ORDER ) ) { |
|
| 284 | 284 | |
| 285 | - foreach ( $matches as $match ) { |
|
| 285 | + foreach ( $matches as $match ) { |
|
| 286 | 286 | |
| 287 | - // Get the item ID. |
|
| 288 | - $item_id = $match[1]; |
|
| 287 | + // Get the item ID. |
|
| 288 | + $item_id = $match[1]; |
|
| 289 | 289 | |
| 290 | - // Get the post bound to that item ID (looking both in the 'official' URI and in the 'same-as' . |
|
| 291 | - $post = Wordlift_Entity_Service::get_instance() |
|
| 292 | - ->get_entity_post_by_uri( $item_id ); |
|
| 290 | + // Get the post bound to that item ID (looking both in the 'official' URI and in the 'same-as' . |
|
| 291 | + $post = Wordlift_Entity_Service::get_instance() |
|
| 292 | + ->get_entity_post_by_uri( $item_id ); |
|
| 293 | 293 | |
| 294 | - // If no entity is found, continue to the next one. |
|
| 295 | - if ( null === $post ) { |
|
| 296 | - continue; |
|
| 297 | - } |
|
| 294 | + // If no entity is found, continue to the next one. |
|
| 295 | + if ( null === $post ) { |
|
| 296 | + continue; |
|
| 297 | + } |
|
| 298 | 298 | |
| 299 | - // Get the URI for that post. |
|
| 300 | - $uri = wl_get_entity_uri( $post->ID ); |
|
| 299 | + // Get the URI for that post. |
|
| 300 | + $uri = wl_get_entity_uri( $post->ID ); |
|
| 301 | 301 | |
| 302 | - // wl_write_log( "wl_replace_item_id_with_uri [ item id :: $item_id ][ uri :: $uri ]" ); |
|
| 302 | + // wl_write_log( "wl_replace_item_id_with_uri [ item id :: $item_id ][ uri :: $uri ]" ); |
|
| 303 | 303 | |
| 304 | - // If the item ID and the URI differ, replace the item ID with the URI saved in WordPress. |
|
| 305 | - if ( ! empty( $uri ) && $item_id !== $uri ) { |
|
| 306 | - $uri_e = esc_html( $uri ); |
|
| 307 | - $content = str_replace( " itemid=\"$item_id\"", " itemid=\"$uri_e\"", $content ); |
|
| 308 | - } |
|
| 309 | - } |
|
| 310 | - } |
|
| 304 | + // If the item ID and the URI differ, replace the item ID with the URI saved in WordPress. |
|
| 305 | + if ( ! empty( $uri ) && $item_id !== $uri ) { |
|
| 306 | + $uri_e = esc_html( $uri ); |
|
| 307 | + $content = str_replace( " itemid=\"$item_id\"", " itemid=\"$uri_e\"", $content ); |
|
| 308 | + } |
|
| 309 | + } |
|
| 310 | + } |
|
| 311 | 311 | |
| 312 | - // Reapply slashes. |
|
| 313 | - $content = addslashes( $content ); |
|
| 312 | + // Reapply slashes. |
|
| 313 | + $content = addslashes( $content ); |
|
| 314 | 314 | |
| 315 | - return $content; |
|
| 315 | + return $content; |
|
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | add_filter( 'content_save_pre', 'wl_replace_item_id_with_uri', 1, 1 ); |
@@ -375,29 +375,29 @@ discard block |
||
| 375 | 375 | */ |
| 376 | 376 | function activate_wordlift() { |
| 377 | 377 | |
| 378 | - $log = Wordlift_Log_Service::get_logger( 'activate_wordlift' ); |
|
| 379 | - |
|
| 380 | - $log->info( 'Activating WordLift...' ); |
|
| 381 | - |
|
| 382 | - require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-activator.php'; |
|
| 383 | - Wordlift_Activator::activate(); |
|
| 384 | - |
|
| 385 | - /** |
|
| 386 | - * Tell the {@link Wordlift_Http_Api} class that we're activating, to let it run activation tasks. |
|
| 387 | - * |
|
| 388 | - * @see https://github.com/insideout10/wordlift-plugin/issues/820 related issue. |
|
| 389 | - * @since 3.19.2 |
|
| 390 | - */ |
|
| 391 | - Wordlift_Http_Api::activate(); |
|
| 392 | - |
|
| 393 | - // Ensure the post type is registered before flushing the rewrite rules. |
|
| 394 | - Wordlift_Entity_Post_Type_Service::get_instance()->register(); |
|
| 395 | - flush_rewrite_rules(); |
|
| 396 | - /** |
|
| 397 | - * @since 3.27.7 |
|
| 398 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
| 399 | - */ |
|
| 400 | - Top_Entities::activate(); |
|
| 378 | + $log = Wordlift_Log_Service::get_logger( 'activate_wordlift' ); |
|
| 379 | + |
|
| 380 | + $log->info( 'Activating WordLift...' ); |
|
| 381 | + |
|
| 382 | + require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-activator.php'; |
|
| 383 | + Wordlift_Activator::activate(); |
|
| 384 | + |
|
| 385 | + /** |
|
| 386 | + * Tell the {@link Wordlift_Http_Api} class that we're activating, to let it run activation tasks. |
|
| 387 | + * |
|
| 388 | + * @see https://github.com/insideout10/wordlift-plugin/issues/820 related issue. |
|
| 389 | + * @since 3.19.2 |
|
| 390 | + */ |
|
| 391 | + Wordlift_Http_Api::activate(); |
|
| 392 | + |
|
| 393 | + // Ensure the post type is registered before flushing the rewrite rules. |
|
| 394 | + Wordlift_Entity_Post_Type_Service::get_instance()->register(); |
|
| 395 | + flush_rewrite_rules(); |
|
| 396 | + /** |
|
| 397 | + * @since 3.27.7 |
|
| 398 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
| 399 | + */ |
|
| 400 | + Top_Entities::activate(); |
|
| 401 | 401 | } |
| 402 | 402 | |
| 403 | 403 | /** |
@@ -406,21 +406,21 @@ discard block |
||
| 406 | 406 | */ |
| 407 | 407 | function deactivate_wordlift() { |
| 408 | 408 | |
| 409 | - require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-deactivator.php'; |
|
| 410 | - Wordlift_Deactivator::deactivate(); |
|
| 411 | - Wordlift_Http_Api::deactivate(); |
|
| 412 | - Ttl_Cache_Cleaner::deactivate(); |
|
| 413 | - /** |
|
| 414 | - * @since 3.27.7 |
|
| 415 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
| 416 | - */ |
|
| 417 | - Top_Entities::deactivate(); |
|
| 418 | - /** |
|
| 419 | - * @since 3.27.8 |
|
| 420 | - * Remove notification flag on deactivation. |
|
| 421 | - */ |
|
| 422 | - Key_Validation_Notice::remove_notification_flag(); |
|
| 423 | - flush_rewrite_rules(); |
|
| 409 | + require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-deactivator.php'; |
|
| 410 | + Wordlift_Deactivator::deactivate(); |
|
| 411 | + Wordlift_Http_Api::deactivate(); |
|
| 412 | + Ttl_Cache_Cleaner::deactivate(); |
|
| 413 | + /** |
|
| 414 | + * @since 3.27.7 |
|
| 415 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
| 416 | + */ |
|
| 417 | + Top_Entities::deactivate(); |
|
| 418 | + /** |
|
| 419 | + * @since 3.27.8 |
|
| 420 | + * Remove notification flag on deactivation. |
|
| 421 | + */ |
|
| 422 | + Key_Validation_Notice::remove_notification_flag(); |
|
| 423 | + flush_rewrite_rules(); |
|
| 424 | 424 | |
| 425 | 425 | } |
| 426 | 426 | |
@@ -443,100 +443,100 @@ discard block |
||
| 443 | 443 | * @since 1.0.0 |
| 444 | 444 | */ |
| 445 | 445 | function run_wordlift() { |
| 446 | - /** |
|
| 447 | - * Filter: wl_feature__enable__widgets. |
|
| 448 | - * |
|
| 449 | - * @param bool whether the widgets needed to be registered, defaults to true. |
|
| 450 | - * |
|
| 451 | - * @return bool |
|
| 452 | - * @since 3.27.6 |
|
| 453 | - */ |
|
| 454 | - if ( apply_filters( 'wl_feature__enable__widgets', true ) ) { |
|
| 455 | - add_action( 'widgets_init', 'wl_register_chord_widget' ); |
|
| 456 | - add_action( 'widgets_init', 'wl_register_geo_widget' ); |
|
| 457 | - add_action( 'widgets_init', 'wl_register_timeline_widget' ); |
|
| 458 | - } |
|
| 459 | - add_filter( 'widget_text', 'do_shortcode' ); |
|
| 460 | - |
|
| 461 | - |
|
| 462 | - /** |
|
| 463 | - * Filter: wl_feature__enable__analysis |
|
| 464 | - * |
|
| 465 | - * @param bool Whether to send api request to analysis or not |
|
| 466 | - * |
|
| 467 | - * @return bool |
|
| 468 | - * @since 3.27.6 |
|
| 469 | - */ |
|
| 470 | - if ( apply_filters( 'wl_feature__enable__analysis', true ) ) { |
|
| 471 | - add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_action' ); |
|
| 472 | - } else { |
|
| 473 | - add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_disabled_action' ); |
|
| 474 | - } |
|
| 475 | - |
|
| 476 | - /* |
|
| 446 | + /** |
|
| 447 | + * Filter: wl_feature__enable__widgets. |
|
| 448 | + * |
|
| 449 | + * @param bool whether the widgets needed to be registered, defaults to true. |
|
| 450 | + * |
|
| 451 | + * @return bool |
|
| 452 | + * @since 3.27.6 |
|
| 453 | + */ |
|
| 454 | + if ( apply_filters( 'wl_feature__enable__widgets', true ) ) { |
|
| 455 | + add_action( 'widgets_init', 'wl_register_chord_widget' ); |
|
| 456 | + add_action( 'widgets_init', 'wl_register_geo_widget' ); |
|
| 457 | + add_action( 'widgets_init', 'wl_register_timeline_widget' ); |
|
| 458 | + } |
|
| 459 | + add_filter( 'widget_text', 'do_shortcode' ); |
|
| 460 | + |
|
| 461 | + |
|
| 462 | + /** |
|
| 463 | + * Filter: wl_feature__enable__analysis |
|
| 464 | + * |
|
| 465 | + * @param bool Whether to send api request to analysis or not |
|
| 466 | + * |
|
| 467 | + * @return bool |
|
| 468 | + * @since 3.27.6 |
|
| 469 | + */ |
|
| 470 | + if ( apply_filters( 'wl_feature__enable__analysis', true ) ) { |
|
| 471 | + add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_action' ); |
|
| 472 | + } else { |
|
| 473 | + add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_disabled_action' ); |
|
| 474 | + } |
|
| 475 | + |
|
| 476 | + /* |
|
| 477 | 477 | * We introduce the WordLift autoloader, since we start using classes in namespaces, i.e. Wordlift\Http. |
| 478 | 478 | * |
| 479 | 479 | * @since 3.21.2 |
| 480 | 480 | */ |
| 481 | - wordlift_plugin_autoload_register(); |
|
| 481 | + wordlift_plugin_autoload_register(); |
|
| 482 | 482 | |
| 483 | - $plugin = new Wordlift(); |
|
| 484 | - $plugin->run(); |
|
| 483 | + $plugin = new Wordlift(); |
|
| 484 | + $plugin->run(); |
|
| 485 | 485 | |
| 486 | - // Initialize the TTL Cache Cleaner. |
|
| 487 | - new Ttl_Cache_Cleaner(); |
|
| 486 | + // Initialize the TTL Cache Cleaner. |
|
| 487 | + new Ttl_Cache_Cleaner(); |
|
| 488 | 488 | |
| 489 | - // Load the new Post Adapter. |
|
| 490 | - new Post_Adapter(); |
|
| 489 | + // Load the new Post Adapter. |
|
| 490 | + new Post_Adapter(); |
|
| 491 | 491 | |
| 492 | - // Load the API Data Hooks. |
|
| 493 | - new Api_Data_Hooks( Wordlift_Configuration_Service::get_instance() ); |
|
| 492 | + // Load the API Data Hooks. |
|
| 493 | + new Api_Data_Hooks( Wordlift_Configuration_Service::get_instance() ); |
|
| 494 | 494 | |
| 495 | - add_action( 'plugins_loaded', function () { |
|
| 496 | - // Load early. **PLEASE NOTE** that features are applied only to calls that happen **AFTER** the `plugins_loaded` |
|
| 497 | - // action. |
|
| 498 | - require_once plugin_dir_path( __FILE__ ) . 'wordlift/features/index.php'; |
|
| 499 | - }, 1 ); |
|
| 495 | + add_action( 'plugins_loaded', function () { |
|
| 496 | + // Load early. **PLEASE NOTE** that features are applied only to calls that happen **AFTER** the `plugins_loaded` |
|
| 497 | + // action. |
|
| 498 | + require_once plugin_dir_path( __FILE__ ) . 'wordlift/features/index.php'; |
|
| 499 | + }, 1 ); |
|
| 500 | 500 | |
| 501 | - add_action( 'plugins_loaded', function () use ( $plugin ) { |
|
| 502 | - // Licenses Images. |
|
| 503 | - $user_agent = User_Agent::get_user_agent(); |
|
| 504 | - $wordlift_key = Wordlift_Configuration_Service::get_instance()->get_key(); |
|
| 505 | - $api_service = new Default_Api_Service( apply_filters( 'wl_api_base_url', WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE ), 60, $user_agent, $wordlift_key ); |
|
| 506 | - $image_license_factory = new Image_License_Factory(); |
|
| 507 | - $image_license_service = new Image_License_Service( $api_service, $image_license_factory ); |
|
| 508 | - $image_license_cache = new Ttl_Cache( 'image-license', 86400 * 30 ); // 30 days. |
|
| 509 | - $cached_image_license_service = new Cached_Image_License_Service( $image_license_service, $image_license_cache ); |
|
| 501 | + add_action( 'plugins_loaded', function () use ( $plugin ) { |
|
| 502 | + // Licenses Images. |
|
| 503 | + $user_agent = User_Agent::get_user_agent(); |
|
| 504 | + $wordlift_key = Wordlift_Configuration_Service::get_instance()->get_key(); |
|
| 505 | + $api_service = new Default_Api_Service( apply_filters( 'wl_api_base_url', WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE ), 60, $user_agent, $wordlift_key ); |
|
| 506 | + $image_license_factory = new Image_License_Factory(); |
|
| 507 | + $image_license_service = new Image_License_Service( $api_service, $image_license_factory ); |
|
| 508 | + $image_license_cache = new Ttl_Cache( 'image-license', 86400 * 30 ); // 30 days. |
|
| 509 | + $cached_image_license_service = new Cached_Image_License_Service( $image_license_service, $image_license_cache ); |
|
| 510 | 510 | |
| 511 | - $image_license_scheduler = new Image_License_Scheduler( $image_license_service, $image_license_cache ); |
|
| 512 | - $image_license_cleanup_service = new Image_License_Cleanup_Service(); |
|
| 511 | + $image_license_scheduler = new Image_License_Scheduler( $image_license_service, $image_license_cache ); |
|
| 512 | + $image_license_cleanup_service = new Image_License_Cleanup_Service(); |
|
| 513 | 513 | |
| 514 | - // Get the cached data. If we have cached data, we load the notifier. |
|
| 515 | - $image_license_data = $image_license_cache->get( Cached_Image_License_Service::GET_NON_PUBLIC_DOMAIN_IMAGES ); |
|
| 516 | - if ( null !== $image_license_data ) { |
|
| 517 | - $image_license_page = new Image_License_Page( $image_license_data, Wordlift::get_instance()->get_version() ); |
|
| 518 | - new Image_License_Notifier( $image_license_data, $image_license_page ); |
|
| 519 | - } |
|
| 514 | + // Get the cached data. If we have cached data, we load the notifier. |
|
| 515 | + $image_license_data = $image_license_cache->get( Cached_Image_License_Service::GET_NON_PUBLIC_DOMAIN_IMAGES ); |
|
| 516 | + if ( null !== $image_license_data ) { |
|
| 517 | + $image_license_page = new Image_License_Page( $image_license_data, Wordlift::get_instance()->get_version() ); |
|
| 518 | + new Image_License_Notifier( $image_license_data, $image_license_page ); |
|
| 519 | + } |
|
| 520 | 520 | |
| 521 | - $remove_all_images_task = new Remove_All_Images_Task( $cached_image_license_service ); |
|
| 522 | - $remove_all_images_task_adapter = new Task_Ajax_Adapter( $remove_all_images_task ); |
|
| 521 | + $remove_all_images_task = new Remove_All_Images_Task( $cached_image_license_service ); |
|
| 522 | + $remove_all_images_task_adapter = new Task_Ajax_Adapter( $remove_all_images_task ); |
|
| 523 | 523 | |
| 524 | - $reload_data_task = new Reload_Data_Task(); |
|
| 525 | - $reload_data_task_adapter = new Task_Ajax_Adapter( $reload_data_task ); |
|
| 524 | + $reload_data_task = new Reload_Data_Task(); |
|
| 525 | + $reload_data_task_adapter = new Task_Ajax_Adapter( $reload_data_task ); |
|
| 526 | 526 | |
| 527 | - $add_license_caption_or_remove_task = new Add_License_Caption_Or_Remove_Task( $cached_image_license_service ); |
|
| 528 | - $add_license_caption_or_remove_task_adapter = new Task_Ajax_Adapter( $add_license_caption_or_remove_task ); |
|
| 527 | + $add_license_caption_or_remove_task = new Add_License_Caption_Or_Remove_Task( $cached_image_license_service ); |
|
| 528 | + $add_license_caption_or_remove_task_adapter = new Task_Ajax_Adapter( $add_license_caption_or_remove_task ); |
|
| 529 | 529 | |
| 530 | - $remove_all_images_task_page = new Remove_All_Images_Page( new Task_Ajax_Adapters_Registry( $remove_all_images_task_adapter ), $plugin->get_version() ); |
|
| 531 | - $reload_data_task_page = new Reload_Data_Page( new Task_Ajax_Adapters_Registry( $reload_data_task_adapter ), $plugin->get_version() ); |
|
| 532 | - $add_license_caption_or_remove_task_page = new Add_License_Caption_Or_Remove_Page( new Task_Ajax_Adapters_Registry( $add_license_caption_or_remove_task_adapter ), $plugin->get_version() ); |
|
| 530 | + $remove_all_images_task_page = new Remove_All_Images_Page( new Task_Ajax_Adapters_Registry( $remove_all_images_task_adapter ), $plugin->get_version() ); |
|
| 531 | + $reload_data_task_page = new Reload_Data_Page( new Task_Ajax_Adapters_Registry( $reload_data_task_adapter ), $plugin->get_version() ); |
|
| 532 | + $add_license_caption_or_remove_task_page = new Add_License_Caption_Or_Remove_Page( new Task_Ajax_Adapters_Registry( $add_license_caption_or_remove_task_adapter ), $plugin->get_version() ); |
|
| 533 | 533 | |
| 534 | - new Wordlift_Products_Navigator_Shortcode_REST(); |
|
| 534 | + new Wordlift_Products_Navigator_Shortcode_REST(); |
|
| 535 | 535 | |
| 536 | - // Register the Dataset module, requires `$api_service`. |
|
| 537 | - require_once plugin_dir_path( __FILE__ ) . 'wordlift/dataset/index.php'; |
|
| 536 | + // Register the Dataset module, requires `$api_service`. |
|
| 537 | + require_once plugin_dir_path( __FILE__ ) . 'wordlift/dataset/index.php'; |
|
| 538 | 538 | |
| 539 | - } ); |
|
| 539 | + } ); |
|
| 540 | 540 | |
| 541 | 541 | } |
| 542 | 542 | |
@@ -550,45 +550,45 @@ discard block |
||
| 550 | 550 | */ |
| 551 | 551 | function wordlift_plugin_autoload_register() { |
| 552 | 552 | |
| 553 | - spl_autoload_register( function ( $class_name ) { |
|
| 553 | + spl_autoload_register( function ( $class_name ) { |
|
| 554 | 554 | |
| 555 | - // Bail out if these are not our classes. |
|
| 556 | - if ( 0 !== strpos( $class_name, 'Wordlift\\' ) ) { |
|
| 557 | - return false; |
|
| 558 | - } |
|
| 555 | + // Bail out if these are not our classes. |
|
| 556 | + if ( 0 !== strpos( $class_name, 'Wordlift\\' ) ) { |
|
| 557 | + return false; |
|
| 558 | + } |
|
| 559 | 559 | |
| 560 | - $class_name_lc = strtolower( str_replace( '_', '-', $class_name ) ); |
|
| 560 | + $class_name_lc = strtolower( str_replace( '_', '-', $class_name ) ); |
|
| 561 | 561 | |
| 562 | - preg_match( '|^(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches ); |
|
| 562 | + preg_match( '|^(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches ); |
|
| 563 | 563 | |
| 564 | - $path = str_replace( '\\', DIRECTORY_SEPARATOR, $matches[1] ); |
|
| 565 | - $file = 'class-' . $matches[2] . '.php'; |
|
| 564 | + $path = str_replace( '\\', DIRECTORY_SEPARATOR, $matches[1] ); |
|
| 565 | + $file = 'class-' . $matches[2] . '.php'; |
|
| 566 | 566 | |
| 567 | - $full_path = plugin_dir_path( __FILE__ ) . $path . DIRECTORY_SEPARATOR . $file; |
|
| 567 | + $full_path = plugin_dir_path( __FILE__ ) . $path . DIRECTORY_SEPARATOR . $file; |
|
| 568 | 568 | |
| 569 | - if ( ! file_exists( $full_path ) ) { |
|
| 570 | - echo( "Class $class_name not found at $full_path." ); |
|
| 569 | + if ( ! file_exists( $full_path ) ) { |
|
| 570 | + echo( "Class $class_name not found at $full_path." ); |
|
| 571 | 571 | |
| 572 | - return false; |
|
| 573 | - } |
|
| 572 | + return false; |
|
| 573 | + } |
|
| 574 | 574 | |
| 575 | - require_once $full_path; |
|
| 575 | + require_once $full_path; |
|
| 576 | 576 | |
| 577 | - return true; |
|
| 578 | - } ); |
|
| 577 | + return true; |
|
| 578 | + } ); |
|
| 579 | 579 | |
| 580 | 580 | } |
| 581 | 581 | |
| 582 | 582 | function wl_block_categories( $categories, $post ) { |
| 583 | - return array_merge( |
|
| 584 | - $categories, |
|
| 585 | - array( |
|
| 586 | - array( |
|
| 587 | - 'slug' => 'wordlift', |
|
| 588 | - 'title' => __( 'WordLift', 'wordlift' ), |
|
| 589 | - ), |
|
| 590 | - ) |
|
| 591 | - ); |
|
| 583 | + return array_merge( |
|
| 584 | + $categories, |
|
| 585 | + array( |
|
| 586 | + array( |
|
| 587 | + 'slug' => 'wordlift', |
|
| 588 | + 'title' => __( 'WordLift', 'wordlift' ), |
|
| 589 | + ), |
|
| 590 | + ) |
|
| 591 | + ); |
|
| 592 | 592 | } |
| 593 | 593 | |
| 594 | 594 | add_filter( 'block_categories', 'wl_block_categories', 10, 2 ); |
@@ -49,17 +49,17 @@ discard block |
||
| 49 | 49 | use Wordlift\Tasks\Task_Ajax_Adapters_Registry; |
| 50 | 50 | |
| 51 | 51 | // If this file is called directly, abort. |
| 52 | -if ( ! defined( 'WPINC' ) ) { |
|
| 52 | +if ( ! defined('WPINC')) { |
|
| 53 | 53 | die; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | -require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php'; |
|
| 56 | +require_once plugin_dir_path(__FILE__).'vendor/autoload.php'; |
|
| 57 | 57 | |
| 58 | 58 | // Include WordLift constants. |
| 59 | -require_once( 'wordlift_constants.php' ); |
|
| 59 | +require_once('wordlift_constants.php'); |
|
| 60 | 60 | |
| 61 | 61 | // Load modules. |
| 62 | -require_once( 'modules/core/wordlift_core.php' ); |
|
| 62 | +require_once('modules/core/wordlift_core.php'); |
|
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | 65 | * Log to the debug.log file. |
@@ -71,9 +71,9 @@ discard block |
||
| 71 | 71 | * @deprecated use Wordlift_Log_Service::get_instance()->info( $log ); |
| 72 | 72 | * |
| 73 | 73 | */ |
| 74 | -function wl_write_log( $log ) { |
|
| 74 | +function wl_write_log($log) { |
|
| 75 | 75 | |
| 76 | - Wordlift_Log_Service::get_instance()->debug( $log ); |
|
| 76 | + Wordlift_Log_Service::get_instance()->debug($log); |
|
| 77 | 77 | |
| 78 | 78 | } |
| 79 | 79 | |
@@ -88,9 +88,9 @@ discard block |
||
| 88 | 88 | * @since 3.0.0 |
| 89 | 89 | * |
| 90 | 90 | */ |
| 91 | -function wl_write_log_hide_key( $text ) { |
|
| 91 | +function wl_write_log_hide_key($text) { |
|
| 92 | 92 | |
| 93 | - return str_ireplace( wl_configuration_get_key(), '<hidden>', $text ); |
|
| 93 | + return str_ireplace(wl_configuration_get_key(), '<hidden>', $text); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | function wordlift_allowed_post_tags() { |
| 101 | 101 | global $allowedposttags; |
| 102 | 102 | |
| 103 | - $tags = array( 'span' ); |
|
| 103 | + $tags = array('span'); |
|
| 104 | 104 | $new_attributes = array( |
| 105 | 105 | 'itemscope' => array(), |
| 106 | 106 | 'itemtype' => array(), |
@@ -108,15 +108,15 @@ discard block |
||
| 108 | 108 | 'itemid' => array(), |
| 109 | 109 | ); |
| 110 | 110 | |
| 111 | - foreach ( $tags as $tag ) { |
|
| 112 | - if ( isset( $allowedposttags[ $tag ] ) && is_array( $allowedposttags[ $tag ] ) ) { |
|
| 113 | - $allowedposttags[ $tag ] = array_merge( $allowedposttags[ $tag ], $new_attributes ); |
|
| 111 | + foreach ($tags as $tag) { |
|
| 112 | + if (isset($allowedposttags[$tag]) && is_array($allowedposttags[$tag])) { |
|
| 113 | + $allowedposttags[$tag] = array_merge($allowedposttags[$tag], $new_attributes); |
|
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | // add allowed post tags. |
| 119 | -add_action( 'init', 'wordlift_allowed_post_tags' ); |
|
| 119 | +add_action('init', 'wordlift_allowed_post_tags'); |
|
| 120 | 120 | |
| 121 | 121 | /** |
| 122 | 122 | * Register additional scripts for the admin UI. |
@@ -124,21 +124,21 @@ discard block |
||
| 124 | 124 | function wordlift_admin_enqueue_scripts() { |
| 125 | 125 | |
| 126 | 126 | // Added for compatibility with WordPress 3.9 (see http://make.wordpress.org/core/2014/04/16/jquery-ui-and-wpdialogs-in-wordpress-3-9/) |
| 127 | - wp_enqueue_script( 'wpdialogs' ); |
|
| 128 | - wp_enqueue_style( 'wp-jquery-ui-dialog' ); |
|
| 127 | + wp_enqueue_script('wpdialogs'); |
|
| 128 | + wp_enqueue_style('wp-jquery-ui-dialog'); |
|
| 129 | 129 | |
| 130 | - wp_enqueue_style( 'wordlift-reloaded', plugin_dir_url( __FILE__ ) . 'css/wordlift-reloaded.min.css' ); |
|
| 130 | + wp_enqueue_style('wordlift-reloaded', plugin_dir_url(__FILE__).'css/wordlift-reloaded.min.css'); |
|
| 131 | 131 | |
| 132 | - wp_enqueue_script( 'jquery-ui-autocomplete' ); |
|
| 132 | + wp_enqueue_script('jquery-ui-autocomplete'); |
|
| 133 | 133 | |
| 134 | 134 | // Disable auto-save for custom entity posts only |
| 135 | - if ( Wordlift_Entity_Service::TYPE_NAME === get_post_type() ) { |
|
| 136 | - wp_dequeue_script( 'autosave' ); |
|
| 135 | + if (Wordlift_Entity_Service::TYPE_NAME === get_post_type()) { |
|
| 136 | + wp_dequeue_script('autosave'); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | -add_action( 'admin_enqueue_scripts', 'wordlift_admin_enqueue_scripts' ); |
|
| 141 | +add_action('admin_enqueue_scripts', 'wordlift_admin_enqueue_scripts'); |
|
| 142 | 142 | |
| 143 | 143 | /** |
| 144 | 144 | * Hooked to *wp_kses_allowed_html* filter, adds microdata attributes. |
@@ -148,23 +148,23 @@ discard block |
||
| 148 | 148 | * |
| 149 | 149 | * @return array An array which contains allowed microdata attributes. |
| 150 | 150 | */ |
| 151 | -function wordlift_allowed_html( $allowedtags, $context ) { |
|
| 151 | +function wordlift_allowed_html($allowedtags, $context) { |
|
| 152 | 152 | |
| 153 | - if ( 'post' !== $context ) { |
|
| 153 | + if ('post' !== $context) { |
|
| 154 | 154 | return $allowedtags; |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - return array_merge_recursive( $allowedtags, array( |
|
| 157 | + return array_merge_recursive($allowedtags, array( |
|
| 158 | 158 | 'span' => array( |
| 159 | 159 | 'itemscope' => true, |
| 160 | 160 | 'itemtype' => true, |
| 161 | 161 | 'itemid' => true, |
| 162 | 162 | 'itemprop' => true, |
| 163 | 163 | ), |
| 164 | - ) ); |
|
| 164 | + )); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | -add_filter( 'wp_kses_allowed_html', 'wordlift_allowed_html', 10, 2 ); |
|
| 167 | +add_filter('wp_kses_allowed_html', 'wordlift_allowed_html', 10, 2); |
|
| 168 | 168 | |
| 169 | 169 | /** |
| 170 | 170 | * Get the coordinates for the specified post ID. |
@@ -173,17 +173,17 @@ discard block |
||
| 173 | 173 | * |
| 174 | 174 | * @return array|null An array of coordinates or null. |
| 175 | 175 | */ |
| 176 | -function wl_get_coordinates( $post_id ) { |
|
| 176 | +function wl_get_coordinates($post_id) { |
|
| 177 | 177 | |
| 178 | - $latitude = wl_schema_get_value( $post_id, 'latitude' ); |
|
| 179 | - $longitude = wl_schema_get_value( $post_id, 'longitude' ); |
|
| 178 | + $latitude = wl_schema_get_value($post_id, 'latitude'); |
|
| 179 | + $longitude = wl_schema_get_value($post_id, 'longitude'); |
|
| 180 | 180 | |
| 181 | 181 | // DO NOT set latitude/longitude to 0/0 as default values. It's a specific |
| 182 | 182 | // place on the globe:"The zero/zero point of this system is located in the |
| 183 | 183 | // Gulf of Guinea about 625 km (390 mi) south of Tema, Ghana." |
| 184 | 184 | return array( |
| 185 | - 'latitude' => isset( $latitude[0] ) && is_numeric( $latitude[0] ) ? $latitude[0] : '', |
|
| 186 | - 'longitude' => isset( $longitude[0] ) && is_numeric( $longitude[0] ) ? $longitude[0] : '', |
|
| 185 | + 'latitude' => isset($latitude[0]) && is_numeric($latitude[0]) ? $latitude[0] : '', |
|
| 186 | + 'longitude' => isset($longitude[0]) && is_numeric($longitude[0]) ? $longitude[0] : '', |
|
| 187 | 187 | ); |
| 188 | 188 | } |
| 189 | 189 | |
@@ -196,11 +196,11 @@ discard block |
||
| 196 | 196 | * @deprecated use Wordlift_Storage_Factory::get_instance()->post_images()->get( $post_id ) |
| 197 | 197 | * |
| 198 | 198 | */ |
| 199 | -function wl_get_image_urls( $post_id ) { |
|
| 199 | +function wl_get_image_urls($post_id) { |
|
| 200 | 200 | |
| 201 | 201 | return Wordlift_Storage_Factory::get_instance() |
| 202 | 202 | ->post_images() |
| 203 | - ->get( $post_id ); |
|
| 203 | + ->get($post_id); |
|
| 204 | 204 | |
| 205 | 205 | } |
| 206 | 206 | |
@@ -212,21 +212,21 @@ discard block |
||
| 212 | 212 | * |
| 213 | 213 | * @return WP_Post|null A post instance or null if not found. |
| 214 | 214 | */ |
| 215 | -function wl_get_attachment_for_source_url( $parent_post_id, $source_url ) { |
|
| 215 | +function wl_get_attachment_for_source_url($parent_post_id, $source_url) { |
|
| 216 | 216 | |
| 217 | 217 | // wl_write_log( "wl_get_attachment_for_source_url [ parent post id :: $parent_post_id ][ source url :: $source_url ]" ); |
| 218 | 218 | |
| 219 | - $posts = get_posts( array( |
|
| 219 | + $posts = get_posts(array( |
|
| 220 | 220 | 'post_type' => 'attachment', |
| 221 | 221 | 'posts_per_page' => 1, |
| 222 | 222 | 'post_status' => 'any', |
| 223 | 223 | 'post_parent' => $parent_post_id, |
| 224 | 224 | 'meta_key' => 'wl_source_url', |
| 225 | 225 | 'meta_value' => $source_url, |
| 226 | - ) ); |
|
| 226 | + )); |
|
| 227 | 227 | |
| 228 | 228 | // Return the found post. |
| 229 | - if ( 1 === count( $posts ) ) { |
|
| 229 | + if (1 === count($posts)) { |
|
| 230 | 230 | return $posts[0]; |
| 231 | 231 | } |
| 232 | 232 | |
@@ -240,10 +240,10 @@ discard block |
||
| 240 | 240 | * @param int $post_id The post ID. |
| 241 | 241 | * @param string $source_url The source URL. |
| 242 | 242 | */ |
| 243 | -function wl_set_source_url( $post_id, $source_url ) { |
|
| 243 | +function wl_set_source_url($post_id, $source_url) { |
|
| 244 | 244 | |
| 245 | - delete_post_meta( $post_id, 'wl_source_url' ); |
|
| 246 | - add_post_meta( $post_id, 'wl_source_url', $source_url ); |
|
| 245 | + delete_post_meta($post_id, 'wl_source_url'); |
|
| 246 | + add_post_meta($post_id, 'wl_source_url', $source_url); |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | /** |
@@ -258,9 +258,9 @@ discard block |
||
| 258 | 258 | * @see https://codex.wordpress.org/Function_Reference/sanitize_title |
| 259 | 259 | * |
| 260 | 260 | */ |
| 261 | -function wl_sanitize_uri_path( $path, $char = '_' ) { |
|
| 261 | +function wl_sanitize_uri_path($path, $char = '_') { |
|
| 262 | 262 | |
| 263 | - return Wordlift_Uri_Service::get_instance()->sanitize_path( $path, $char ); |
|
| 263 | + return Wordlift_Uri_Service::get_instance()->sanitize_path($path, $char); |
|
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | /** |
@@ -270,104 +270,104 @@ discard block |
||
| 270 | 270 | * |
| 271 | 271 | * @return string The updated post content. |
| 272 | 272 | */ |
| 273 | -function wl_replace_item_id_with_uri( $content ) { |
|
| 273 | +function wl_replace_item_id_with_uri($content) { |
|
| 274 | 274 | |
| 275 | - $log = Wordlift_Log_Service::get_logger( 'wl_replace_item_id_with_uri' ); |
|
| 276 | - $log->trace( 'Replacing item IDs with URIs...' ); |
|
| 275 | + $log = Wordlift_Log_Service::get_logger('wl_replace_item_id_with_uri'); |
|
| 276 | + $log->trace('Replacing item IDs with URIs...'); |
|
| 277 | 277 | |
| 278 | 278 | // Strip slashes, see https://core.trac.wordpress.org/ticket/21767 |
| 279 | - $content = stripslashes( $content ); |
|
| 279 | + $content = stripslashes($content); |
|
| 280 | 280 | |
| 281 | 281 | // If any match are found. |
| 282 | 282 | $matches = array(); |
| 283 | - if ( 0 < preg_match_all( '/ itemid="([^"]+)"/i', $content, $matches, PREG_SET_ORDER ) ) { |
|
| 283 | + if (0 < preg_match_all('/ itemid="([^"]+)"/i', $content, $matches, PREG_SET_ORDER)) { |
|
| 284 | 284 | |
| 285 | - foreach ( $matches as $match ) { |
|
| 285 | + foreach ($matches as $match) { |
|
| 286 | 286 | |
| 287 | 287 | // Get the item ID. |
| 288 | 288 | $item_id = $match[1]; |
| 289 | 289 | |
| 290 | 290 | // Get the post bound to that item ID (looking both in the 'official' URI and in the 'same-as' . |
| 291 | 291 | $post = Wordlift_Entity_Service::get_instance() |
| 292 | - ->get_entity_post_by_uri( $item_id ); |
|
| 292 | + ->get_entity_post_by_uri($item_id); |
|
| 293 | 293 | |
| 294 | 294 | // If no entity is found, continue to the next one. |
| 295 | - if ( null === $post ) { |
|
| 295 | + if (null === $post) { |
|
| 296 | 296 | continue; |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | // Get the URI for that post. |
| 300 | - $uri = wl_get_entity_uri( $post->ID ); |
|
| 300 | + $uri = wl_get_entity_uri($post->ID); |
|
| 301 | 301 | |
| 302 | 302 | // wl_write_log( "wl_replace_item_id_with_uri [ item id :: $item_id ][ uri :: $uri ]" ); |
| 303 | 303 | |
| 304 | 304 | // If the item ID and the URI differ, replace the item ID with the URI saved in WordPress. |
| 305 | - if ( ! empty( $uri ) && $item_id !== $uri ) { |
|
| 306 | - $uri_e = esc_html( $uri ); |
|
| 307 | - $content = str_replace( " itemid=\"$item_id\"", " itemid=\"$uri_e\"", $content ); |
|
| 305 | + if ( ! empty($uri) && $item_id !== $uri) { |
|
| 306 | + $uri_e = esc_html($uri); |
|
| 307 | + $content = str_replace(" itemid=\"$item_id\"", " itemid=\"$uri_e\"", $content); |
|
| 308 | 308 | } |
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | // Reapply slashes. |
| 313 | - $content = addslashes( $content ); |
|
| 313 | + $content = addslashes($content); |
|
| 314 | 314 | |
| 315 | 315 | return $content; |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | -add_filter( 'content_save_pre', 'wl_replace_item_id_with_uri', 1, 1 ); |
|
| 318 | +add_filter('content_save_pre', 'wl_replace_item_id_with_uri', 1, 1); |
|
| 319 | 319 | |
| 320 | -require_once( 'wordlift_entity_functions.php' ); |
|
| 320 | +require_once('wordlift_entity_functions.php'); |
|
| 321 | 321 | |
| 322 | 322 | // add editor related methods. |
| 323 | -require_once( 'wordlift_editor.php' ); |
|
| 323 | +require_once('wordlift_editor.php'); |
|
| 324 | 324 | |
| 325 | 325 | // add the WordLift entity custom type. |
| 326 | -require_once( 'wordlift_entity_type.php' ); |
|
| 326 | +require_once('wordlift_entity_type.php'); |
|
| 327 | 327 | |
| 328 | 328 | // add callbacks on post save to notify data changes from wp to redlink triple store |
| 329 | -require_once( 'wordlift_to_redlink_data_push_callbacks.php' ); |
|
| 329 | +require_once('wordlift_to_redlink_data_push_callbacks.php'); |
|
| 330 | 330 | |
| 331 | -require_once( 'modules/configuration/wordlift_configuration_settings.php' ); |
|
| 331 | +require_once('modules/configuration/wordlift_configuration_settings.php'); |
|
| 332 | 332 | |
| 333 | 333 | // Load modules |
| 334 | -require_once( 'modules/analyzer/wordlift_analyzer.php' ); |
|
| 335 | -require_once( 'modules/linked_data/wordlift_linked_data.php' ); |
|
| 336 | -require_once( 'modules/prefixes/wordlift_prefixes.php' ); |
|
| 334 | +require_once('modules/analyzer/wordlift_analyzer.php'); |
|
| 335 | +require_once('modules/linked_data/wordlift_linked_data.php'); |
|
| 336 | +require_once('modules/prefixes/wordlift_prefixes.php'); |
|
| 337 | 337 | |
| 338 | 338 | // Shortcodes |
| 339 | 339 | |
| 340 | -require_once( 'modules/geo_widget/wordlift_geo_widget.php' ); |
|
| 341 | -require_once( 'shortcodes/class-wordlift-shortcode-rest.php' ); |
|
| 342 | -require_once( 'shortcodes/wordlift_shortcode_chord.php' ); |
|
| 343 | -require_once( 'shortcodes/wordlift_shortcode_geomap.php' ); |
|
| 344 | -require_once( 'shortcodes/wordlift_shortcode_field.php' ); |
|
| 345 | -require_once( 'shortcodes/wordlift_shortcode_faceted_search.php' ); |
|
| 346 | -require_once( 'shortcodes/wordlift_shortcode_navigator.php' ); |
|
| 347 | -require_once( 'shortcodes/class-wordlift-products-navigator-shortcode-rest.php' ); |
|
| 340 | +require_once('modules/geo_widget/wordlift_geo_widget.php'); |
|
| 341 | +require_once('shortcodes/class-wordlift-shortcode-rest.php'); |
|
| 342 | +require_once('shortcodes/wordlift_shortcode_chord.php'); |
|
| 343 | +require_once('shortcodes/wordlift_shortcode_geomap.php'); |
|
| 344 | +require_once('shortcodes/wordlift_shortcode_field.php'); |
|
| 345 | +require_once('shortcodes/wordlift_shortcode_faceted_search.php'); |
|
| 346 | +require_once('shortcodes/wordlift_shortcode_navigator.php'); |
|
| 347 | +require_once('shortcodes/class-wordlift-products-navigator-shortcode-rest.php'); |
|
| 348 | 348 | |
| 349 | -require_once( 'widgets/wordlift_widget_geo.php' ); |
|
| 350 | -require_once( 'widgets/class-wordlift-chord-widget.php' ); |
|
| 351 | -require_once( 'widgets/wordlift_widget_timeline.php' ); |
|
| 349 | +require_once('widgets/wordlift_widget_geo.php'); |
|
| 350 | +require_once('widgets/class-wordlift-chord-widget.php'); |
|
| 351 | +require_once('widgets/wordlift_widget_timeline.php'); |
|
| 352 | 352 | |
| 353 | -require_once( 'wordlift_redlink.php' ); |
|
| 353 | +require_once('wordlift_redlink.php'); |
|
| 354 | 354 | |
| 355 | 355 | // Add admin functions. |
| 356 | 356 | // TODO: find a way to make 'admin' UI tests work. |
| 357 | 357 | //if ( is_admin() ) { |
| 358 | 358 | |
| 359 | -require_once( 'admin/wordlift_admin.php' ); |
|
| 360 | -require_once( 'admin/wordlift_admin_edit_post.php' ); |
|
| 361 | -require_once( 'admin/wordlift_admin_save_post.php' ); |
|
| 359 | +require_once('admin/wordlift_admin.php'); |
|
| 360 | +require_once('admin/wordlift_admin_edit_post.php'); |
|
| 361 | +require_once('admin/wordlift_admin_save_post.php'); |
|
| 362 | 362 | |
| 363 | 363 | // add the entities meta box. |
| 364 | -require_once( 'admin/wordlift_admin_meta_box_entities.php' ); |
|
| 364 | +require_once('admin/wordlift_admin_meta_box_entities.php'); |
|
| 365 | 365 | |
| 366 | 366 | // add the entity creation AJAX. |
| 367 | -require_once( 'admin/wordlift_admin_ajax_related_posts.php' ); |
|
| 367 | +require_once('admin/wordlift_admin_ajax_related_posts.php'); |
|
| 368 | 368 | |
| 369 | 369 | // Load the wl_chord TinyMCE button and configuration dialog. |
| 370 | -require_once( 'admin/wordlift_admin_shortcodes.php' ); |
|
| 370 | +require_once('admin/wordlift_admin_shortcodes.php'); |
|
| 371 | 371 | |
| 372 | 372 | /** |
| 373 | 373 | * The code that runs during plugin activation. |
@@ -375,11 +375,11 @@ discard block |
||
| 375 | 375 | */ |
| 376 | 376 | function activate_wordlift() { |
| 377 | 377 | |
| 378 | - $log = Wordlift_Log_Service::get_logger( 'activate_wordlift' ); |
|
| 378 | + $log = Wordlift_Log_Service::get_logger('activate_wordlift'); |
|
| 379 | 379 | |
| 380 | - $log->info( 'Activating WordLift...' ); |
|
| 380 | + $log->info('Activating WordLift...'); |
|
| 381 | 381 | |
| 382 | - require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-activator.php'; |
|
| 382 | + require_once plugin_dir_path(__FILE__).'includes/class-wordlift-activator.php'; |
|
| 383 | 383 | Wordlift_Activator::activate(); |
| 384 | 384 | |
| 385 | 385 | /** |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | */ |
| 407 | 407 | function deactivate_wordlift() { |
| 408 | 408 | |
| 409 | - require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-deactivator.php'; |
|
| 409 | + require_once plugin_dir_path(__FILE__).'includes/class-wordlift-deactivator.php'; |
|
| 410 | 410 | Wordlift_Deactivator::deactivate(); |
| 411 | 411 | Wordlift_Http_Api::deactivate(); |
| 412 | 412 | Ttl_Cache_Cleaner::deactivate(); |
@@ -424,14 +424,14 @@ discard block |
||
| 424 | 424 | |
| 425 | 425 | } |
| 426 | 426 | |
| 427 | -register_activation_hook( __FILE__, 'activate_wordlift' ); |
|
| 428 | -register_deactivation_hook( __FILE__, 'deactivate_wordlift' ); |
|
| 427 | +register_activation_hook(__FILE__, 'activate_wordlift'); |
|
| 428 | +register_deactivation_hook(__FILE__, 'deactivate_wordlift'); |
|
| 429 | 429 | |
| 430 | 430 | /** |
| 431 | 431 | * The core plugin class that is used to define internationalization, |
| 432 | 432 | * admin-specific hooks, and public-facing site hooks. |
| 433 | 433 | */ |
| 434 | -require plugin_dir_path( __FILE__ ) . 'includes/class-wordlift.php'; |
|
| 434 | +require plugin_dir_path(__FILE__).'includes/class-wordlift.php'; |
|
| 435 | 435 | |
| 436 | 436 | /** |
| 437 | 437 | * Begins execution of the plugin. |
@@ -451,12 +451,12 @@ discard block |
||
| 451 | 451 | * @return bool |
| 452 | 452 | * @since 3.27.6 |
| 453 | 453 | */ |
| 454 | - if ( apply_filters( 'wl_feature__enable__widgets', true ) ) { |
|
| 455 | - add_action( 'widgets_init', 'wl_register_chord_widget' ); |
|
| 456 | - add_action( 'widgets_init', 'wl_register_geo_widget' ); |
|
| 457 | - add_action( 'widgets_init', 'wl_register_timeline_widget' ); |
|
| 454 | + if (apply_filters('wl_feature__enable__widgets', true)) { |
|
| 455 | + add_action('widgets_init', 'wl_register_chord_widget'); |
|
| 456 | + add_action('widgets_init', 'wl_register_geo_widget'); |
|
| 457 | + add_action('widgets_init', 'wl_register_timeline_widget'); |
|
| 458 | 458 | } |
| 459 | - add_filter( 'widget_text', 'do_shortcode' ); |
|
| 459 | + add_filter('widget_text', 'do_shortcode'); |
|
| 460 | 460 | |
| 461 | 461 | |
| 462 | 462 | /** |
@@ -467,10 +467,10 @@ discard block |
||
| 467 | 467 | * @return bool |
| 468 | 468 | * @since 3.27.6 |
| 469 | 469 | */ |
| 470 | - if ( apply_filters( 'wl_feature__enable__analysis', true ) ) { |
|
| 471 | - add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_action' ); |
|
| 470 | + if (apply_filters('wl_feature__enable__analysis', true)) { |
|
| 471 | + add_action('wp_ajax_wl_analyze', 'wl_ajax_analyze_action'); |
|
| 472 | 472 | } else { |
| 473 | - add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_disabled_action' ); |
|
| 473 | + add_action('wp_ajax_wl_analyze', 'wl_ajax_analyze_disabled_action'); |
|
| 474 | 474 | } |
| 475 | 475 | |
| 476 | 476 | /* |
@@ -490,51 +490,51 @@ discard block |
||
| 490 | 490 | new Post_Adapter(); |
| 491 | 491 | |
| 492 | 492 | // Load the API Data Hooks. |
| 493 | - new Api_Data_Hooks( Wordlift_Configuration_Service::get_instance() ); |
|
| 493 | + new Api_Data_Hooks(Wordlift_Configuration_Service::get_instance()); |
|
| 494 | 494 | |
| 495 | - add_action( 'plugins_loaded', function () { |
|
| 495 | + add_action('plugins_loaded', function() { |
|
| 496 | 496 | // Load early. **PLEASE NOTE** that features are applied only to calls that happen **AFTER** the `plugins_loaded` |
| 497 | 497 | // action. |
| 498 | - require_once plugin_dir_path( __FILE__ ) . 'wordlift/features/index.php'; |
|
| 499 | - }, 1 ); |
|
| 498 | + require_once plugin_dir_path(__FILE__).'wordlift/features/index.php'; |
|
| 499 | + }, 1); |
|
| 500 | 500 | |
| 501 | - add_action( 'plugins_loaded', function () use ( $plugin ) { |
|
| 501 | + add_action('plugins_loaded', function() use ($plugin) { |
|
| 502 | 502 | // Licenses Images. |
| 503 | 503 | $user_agent = User_Agent::get_user_agent(); |
| 504 | 504 | $wordlift_key = Wordlift_Configuration_Service::get_instance()->get_key(); |
| 505 | - $api_service = new Default_Api_Service( apply_filters( 'wl_api_base_url', WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE ), 60, $user_agent, $wordlift_key ); |
|
| 505 | + $api_service = new Default_Api_Service(apply_filters('wl_api_base_url', WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE), 60, $user_agent, $wordlift_key); |
|
| 506 | 506 | $image_license_factory = new Image_License_Factory(); |
| 507 | - $image_license_service = new Image_License_Service( $api_service, $image_license_factory ); |
|
| 508 | - $image_license_cache = new Ttl_Cache( 'image-license', 86400 * 30 ); // 30 days. |
|
| 509 | - $cached_image_license_service = new Cached_Image_License_Service( $image_license_service, $image_license_cache ); |
|
| 507 | + $image_license_service = new Image_License_Service($api_service, $image_license_factory); |
|
| 508 | + $image_license_cache = new Ttl_Cache('image-license', 86400 * 30); // 30 days. |
|
| 509 | + $cached_image_license_service = new Cached_Image_License_Service($image_license_service, $image_license_cache); |
|
| 510 | 510 | |
| 511 | - $image_license_scheduler = new Image_License_Scheduler( $image_license_service, $image_license_cache ); |
|
| 511 | + $image_license_scheduler = new Image_License_Scheduler($image_license_service, $image_license_cache); |
|
| 512 | 512 | $image_license_cleanup_service = new Image_License_Cleanup_Service(); |
| 513 | 513 | |
| 514 | 514 | // Get the cached data. If we have cached data, we load the notifier. |
| 515 | - $image_license_data = $image_license_cache->get( Cached_Image_License_Service::GET_NON_PUBLIC_DOMAIN_IMAGES ); |
|
| 516 | - if ( null !== $image_license_data ) { |
|
| 517 | - $image_license_page = new Image_License_Page( $image_license_data, Wordlift::get_instance()->get_version() ); |
|
| 518 | - new Image_License_Notifier( $image_license_data, $image_license_page ); |
|
| 515 | + $image_license_data = $image_license_cache->get(Cached_Image_License_Service::GET_NON_PUBLIC_DOMAIN_IMAGES); |
|
| 516 | + if (null !== $image_license_data) { |
|
| 517 | + $image_license_page = new Image_License_Page($image_license_data, Wordlift::get_instance()->get_version()); |
|
| 518 | + new Image_License_Notifier($image_license_data, $image_license_page); |
|
| 519 | 519 | } |
| 520 | 520 | |
| 521 | - $remove_all_images_task = new Remove_All_Images_Task( $cached_image_license_service ); |
|
| 522 | - $remove_all_images_task_adapter = new Task_Ajax_Adapter( $remove_all_images_task ); |
|
| 521 | + $remove_all_images_task = new Remove_All_Images_Task($cached_image_license_service); |
|
| 522 | + $remove_all_images_task_adapter = new Task_Ajax_Adapter($remove_all_images_task); |
|
| 523 | 523 | |
| 524 | 524 | $reload_data_task = new Reload_Data_Task(); |
| 525 | - $reload_data_task_adapter = new Task_Ajax_Adapter( $reload_data_task ); |
|
| 525 | + $reload_data_task_adapter = new Task_Ajax_Adapter($reload_data_task); |
|
| 526 | 526 | |
| 527 | - $add_license_caption_or_remove_task = new Add_License_Caption_Or_Remove_Task( $cached_image_license_service ); |
|
| 528 | - $add_license_caption_or_remove_task_adapter = new Task_Ajax_Adapter( $add_license_caption_or_remove_task ); |
|
| 527 | + $add_license_caption_or_remove_task = new Add_License_Caption_Or_Remove_Task($cached_image_license_service); |
|
| 528 | + $add_license_caption_or_remove_task_adapter = new Task_Ajax_Adapter($add_license_caption_or_remove_task); |
|
| 529 | 529 | |
| 530 | - $remove_all_images_task_page = new Remove_All_Images_Page( new Task_Ajax_Adapters_Registry( $remove_all_images_task_adapter ), $plugin->get_version() ); |
|
| 531 | - $reload_data_task_page = new Reload_Data_Page( new Task_Ajax_Adapters_Registry( $reload_data_task_adapter ), $plugin->get_version() ); |
|
| 532 | - $add_license_caption_or_remove_task_page = new Add_License_Caption_Or_Remove_Page( new Task_Ajax_Adapters_Registry( $add_license_caption_or_remove_task_adapter ), $plugin->get_version() ); |
|
| 530 | + $remove_all_images_task_page = new Remove_All_Images_Page(new Task_Ajax_Adapters_Registry($remove_all_images_task_adapter), $plugin->get_version()); |
|
| 531 | + $reload_data_task_page = new Reload_Data_Page(new Task_Ajax_Adapters_Registry($reload_data_task_adapter), $plugin->get_version()); |
|
| 532 | + $add_license_caption_or_remove_task_page = new Add_License_Caption_Or_Remove_Page(new Task_Ajax_Adapters_Registry($add_license_caption_or_remove_task_adapter), $plugin->get_version()); |
|
| 533 | 533 | |
| 534 | 534 | new Wordlift_Products_Navigator_Shortcode_REST(); |
| 535 | 535 | |
| 536 | 536 | // Register the Dataset module, requires `$api_service`. |
| 537 | - require_once plugin_dir_path( __FILE__ ) . 'wordlift/dataset/index.php'; |
|
| 537 | + require_once plugin_dir_path(__FILE__).'wordlift/dataset/index.php'; |
|
| 538 | 538 | |
| 539 | 539 | } ); |
| 540 | 540 | |
@@ -550,24 +550,24 @@ discard block |
||
| 550 | 550 | */ |
| 551 | 551 | function wordlift_plugin_autoload_register() { |
| 552 | 552 | |
| 553 | - spl_autoload_register( function ( $class_name ) { |
|
| 553 | + spl_autoload_register(function($class_name) { |
|
| 554 | 554 | |
| 555 | 555 | // Bail out if these are not our classes. |
| 556 | - if ( 0 !== strpos( $class_name, 'Wordlift\\' ) ) { |
|
| 556 | + if (0 !== strpos($class_name, 'Wordlift\\')) { |
|
| 557 | 557 | return false; |
| 558 | 558 | } |
| 559 | 559 | |
| 560 | - $class_name_lc = strtolower( str_replace( '_', '-', $class_name ) ); |
|
| 560 | + $class_name_lc = strtolower(str_replace('_', '-', $class_name)); |
|
| 561 | 561 | |
| 562 | - preg_match( '|^(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches ); |
|
| 562 | + preg_match('|^(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches); |
|
| 563 | 563 | |
| 564 | - $path = str_replace( '\\', DIRECTORY_SEPARATOR, $matches[1] ); |
|
| 565 | - $file = 'class-' . $matches[2] . '.php'; |
|
| 564 | + $path = str_replace('\\', DIRECTORY_SEPARATOR, $matches[1]); |
|
| 565 | + $file = 'class-'.$matches[2].'.php'; |
|
| 566 | 566 | |
| 567 | - $full_path = plugin_dir_path( __FILE__ ) . $path . DIRECTORY_SEPARATOR . $file; |
|
| 567 | + $full_path = plugin_dir_path(__FILE__).$path.DIRECTORY_SEPARATOR.$file; |
|
| 568 | 568 | |
| 569 | - if ( ! file_exists( $full_path ) ) { |
|
| 570 | - echo( "Class $class_name not found at $full_path." ); |
|
| 569 | + if ( ! file_exists($full_path)) { |
|
| 570 | + echo("Class $class_name not found at $full_path."); |
|
| 571 | 571 | |
| 572 | 572 | return false; |
| 573 | 573 | } |
@@ -579,16 +579,16 @@ discard block |
||
| 579 | 579 | |
| 580 | 580 | } |
| 581 | 581 | |
| 582 | -function wl_block_categories( $categories, $post ) { |
|
| 582 | +function wl_block_categories($categories, $post) { |
|
| 583 | 583 | return array_merge( |
| 584 | 584 | $categories, |
| 585 | 585 | array( |
| 586 | 586 | array( |
| 587 | 587 | 'slug' => 'wordlift', |
| 588 | - 'title' => __( 'WordLift', 'wordlift' ), |
|
| 588 | + 'title' => __('WordLift', 'wordlift'), |
|
| 589 | 589 | ), |
| 590 | 590 | ) |
| 591 | 591 | ); |
| 592 | 592 | } |
| 593 | 593 | |
| 594 | -add_filter( 'block_categories', 'wl_block_categories', 10, 2 ); |
|
| 594 | +add_filter('block_categories', 'wl_block_categories', 10, 2); |
|