@@ -22,39 +22,39 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | class Jsonld_Adapter { |
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * @var Wordlift_Jsonld_Service |
|
| 27 | - */ |
|
| 28 | - private $jsonld_service; |
|
| 25 | + /** |
|
| 26 | + * @var Wordlift_Jsonld_Service |
|
| 27 | + */ |
|
| 28 | + private $jsonld_service; |
|
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * Jsonld_Adapter constructor. |
|
| 32 | - * |
|
| 33 | - * @param \Wordlift_Jsonld_Service $jsonld_service |
|
| 34 | - */ |
|
| 35 | - public function __construct( $jsonld_service ) { |
|
| 30 | + /** |
|
| 31 | + * Jsonld_Adapter constructor. |
|
| 32 | + * |
|
| 33 | + * @param \Wordlift_Jsonld_Service $jsonld_service |
|
| 34 | + */ |
|
| 35 | + public function __construct( $jsonld_service ) { |
|
| 36 | 36 | |
| 37 | - $this->jsonld_service = $jsonld_service; |
|
| 37 | + $this->jsonld_service = $jsonld_service; |
|
| 38 | 38 | |
| 39 | - add_action( 'wp_head', array( $this, 'wp_head' ) ); |
|
| 40 | - add_action( 'amp_post_template_head', array( $this, 'wp_head' ) ); |
|
| 39 | + add_action( 'wp_head', array( $this, 'wp_head' ) ); |
|
| 40 | + add_action( 'amp_post_template_head', array( $this, 'wp_head' ) ); |
|
| 41 | 41 | |
| 42 | - } |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - public function wp_head() { |
|
| 44 | + public function wp_head() { |
|
| 45 | 45 | |
| 46 | - // Bail out if `wl_jsonld_enabled` isn't enabled. |
|
| 47 | - if ( ! apply_filters( 'wl_jsonld_enabled', true ) ) { |
|
| 48 | - return; |
|
| 49 | - } |
|
| 46 | + // Bail out if `wl_jsonld_enabled` isn't enabled. |
|
| 47 | + if ( ! apply_filters( 'wl_jsonld_enabled', true ) ) { |
|
| 48 | + return; |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - $generator = Generator_Factory::get_instance( |
|
| 52 | - $this->jsonld_service, |
|
| 53 | - get_the_ID() |
|
| 54 | - ); |
|
| 51 | + $generator = Generator_Factory::get_instance( |
|
| 52 | + $this->jsonld_service, |
|
| 53 | + get_the_ID() |
|
| 54 | + ); |
|
| 55 | 55 | |
| 56 | - $generator->generate(); |
|
| 56 | + $generator->generate(); |
|
| 57 | 57 | |
| 58 | - } |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | 60 | } |
@@ -32,19 +32,19 @@ |
||
| 32 | 32 | * |
| 33 | 33 | * @param \Wordlift_Jsonld_Service $jsonld_service |
| 34 | 34 | */ |
| 35 | - public function __construct( $jsonld_service ) { |
|
| 35 | + public function __construct($jsonld_service) { |
|
| 36 | 36 | |
| 37 | 37 | $this->jsonld_service = $jsonld_service; |
| 38 | 38 | |
| 39 | - add_action( 'wp_head', array( $this, 'wp_head' ) ); |
|
| 40 | - add_action( 'amp_post_template_head', array( $this, 'wp_head' ) ); |
|
| 39 | + add_action('wp_head', array($this, 'wp_head')); |
|
| 40 | + add_action('amp_post_template_head', array($this, 'wp_head')); |
|
| 41 | 41 | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | public function wp_head() { |
| 45 | 45 | |
| 46 | 46 | // Bail out if `wl_jsonld_enabled` isn't enabled. |
| 47 | - if ( ! apply_filters( 'wl_jsonld_enabled', true ) ) { |
|
| 47 | + if ( ! apply_filters('wl_jsonld_enabled', true)) { |
|
| 48 | 48 | return; |
| 49 | 49 | } |
| 50 | 50 | |
@@ -4,6 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | interface Generator { |
| 6 | 6 | |
| 7 | - function generate(); |
|
| 7 | + function generate(); |
|
| 8 | 8 | |
| 9 | 9 | } |
| 10 | 10 | \ No newline at end of file |
@@ -10,19 +10,19 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class Recipe_Maker_Yoast_Generator implements Generator { |
| 12 | 12 | |
| 13 | - /** |
|
| 14 | - * @var \Wordlift_Jsonld_Service |
|
| 15 | - */ |
|
| 16 | - private $jsonld_service; |
|
| 17 | - |
|
| 18 | - public function __construct( $jsonld_service ) { |
|
| 19 | - $this->jsonld_service = $jsonld_service; |
|
| 20 | - } |
|
| 21 | - |
|
| 22 | - function generate() { |
|
| 23 | - // we should not print our jsonld when yoast + recipe maker is active |
|
| 24 | - // and recipe maker integration is turned on. |
|
| 25 | - } |
|
| 13 | + /** |
|
| 14 | + * @var \Wordlift_Jsonld_Service |
|
| 15 | + */ |
|
| 16 | + private $jsonld_service; |
|
| 17 | + |
|
| 18 | + public function __construct( $jsonld_service ) { |
|
| 19 | + $this->jsonld_service = $jsonld_service; |
|
| 20 | + } |
|
| 21 | + |
|
| 22 | + function generate() { |
|
| 23 | + // we should not print our jsonld when yoast + recipe maker is active |
|
| 24 | + // and recipe maker integration is turned on. |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | } |
| 29 | 29 | \ No newline at end of file |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | private $jsonld_service; |
| 17 | 17 | |
| 18 | - public function __construct( $jsonld_service ) { |
|
| 18 | + public function __construct($jsonld_service) { |
|
| 19 | 19 | $this->jsonld_service = $jsonld_service; |
| 20 | 20 | } |
| 21 | 21 | |
@@ -6,29 +6,29 @@ |
||
| 6 | 6 | use Wordlift_Jsonld_Service; |
| 7 | 7 | |
| 8 | 8 | class Default_Generator implements Generator { |
| 9 | - /** |
|
| 10 | - * @var Wordlift_Jsonld_Service |
|
| 11 | - */ |
|
| 12 | - private $jsonld_service; |
|
| 9 | + /** |
|
| 10 | + * @var Wordlift_Jsonld_Service |
|
| 11 | + */ |
|
| 12 | + private $jsonld_service; |
|
| 13 | 13 | |
| 14 | 14 | |
| 15 | - public function __construct( $jsonld_service ) { |
|
| 16 | - $this->jsonld_service = $jsonld_service; |
|
| 17 | - } |
|
| 15 | + public function __construct( $jsonld_service ) { |
|
| 16 | + $this->jsonld_service = $jsonld_service; |
|
| 17 | + } |
|
| 18 | 18 | |
| 19 | - function generate() { |
|
| 20 | - // Determine whether this is the home page or whether we're displaying a single post. |
|
| 21 | - $is_homepage = is_home() || is_front_page(); |
|
| 22 | - $post_id = is_singular() ? get_the_ID() : null; |
|
| 19 | + function generate() { |
|
| 20 | + // Determine whether this is the home page or whether we're displaying a single post. |
|
| 21 | + $is_homepage = is_home() || is_front_page(); |
|
| 22 | + $post_id = is_singular() ? get_the_ID() : null; |
|
| 23 | 23 | |
| 24 | - // Get the JSON-LD. |
|
| 25 | - $jsonld = json_encode( $this->jsonld_service->get_jsonld( $is_homepage, $post_id, Jsonld_Context_Enum::PAGE ) ); |
|
| 26 | - // Finally print the JSON-LD out. |
|
| 27 | - $jsonld_post_html_output = <<<EOF |
|
| 24 | + // Get the JSON-LD. |
|
| 25 | + $jsonld = json_encode( $this->jsonld_service->get_jsonld( $is_homepage, $post_id, Jsonld_Context_Enum::PAGE ) ); |
|
| 26 | + // Finally print the JSON-LD out. |
|
| 27 | + $jsonld_post_html_output = <<<EOF |
|
| 28 | 28 | <script type="application/ld+json" id="wl-jsonld">$jsonld</script> |
| 29 | 29 | EOF; |
| 30 | - $jsonld_post_html_output = apply_filters( 'wl_jsonld_post_html_output', $jsonld_post_html_output, $post_id ); |
|
| 30 | + $jsonld_post_html_output = apply_filters( 'wl_jsonld_post_html_output', $jsonld_post_html_output, $post_id ); |
|
| 31 | 31 | |
| 32 | - echo $jsonld_post_html_output; |
|
| 33 | - } |
|
| 32 | + echo $jsonld_post_html_output; |
|
| 33 | + } |
|
| 34 | 34 | } |
| 35 | 35 | \ No newline at end of file |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | private $jsonld_service; |
| 13 | 13 | |
| 14 | 14 | |
| 15 | - public function __construct( $jsonld_service ) { |
|
| 15 | + public function __construct($jsonld_service) { |
|
| 16 | 16 | $this->jsonld_service = $jsonld_service; |
| 17 | 17 | } |
| 18 | 18 | |
@@ -22,12 +22,12 @@ discard block |
||
| 22 | 22 | $post_id = is_singular() ? get_the_ID() : null; |
| 23 | 23 | |
| 24 | 24 | // Get the JSON-LD. |
| 25 | - $jsonld = json_encode( $this->jsonld_service->get_jsonld( $is_homepage, $post_id, Jsonld_Context_Enum::PAGE ) ); |
|
| 25 | + $jsonld = json_encode($this->jsonld_service->get_jsonld($is_homepage, $post_id, Jsonld_Context_Enum::PAGE)); |
|
| 26 | 26 | // Finally print the JSON-LD out. |
| 27 | 27 | $jsonld_post_html_output = <<<EOF |
| 28 | 28 | <script type="application/ld+json" id="wl-jsonld">$jsonld</script> |
| 29 | 29 | EOF; |
| 30 | - $jsonld_post_html_output = apply_filters( 'wl_jsonld_post_html_output', $jsonld_post_html_output, $post_id ); |
|
| 30 | + $jsonld_post_html_output = apply_filters('wl_jsonld_post_html_output', $jsonld_post_html_output, $post_id); |
|
| 31 | 31 | |
| 32 | 32 | echo $jsonld_post_html_output; |
| 33 | 33 | } |
@@ -12,27 +12,27 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | class Yoast_Jsonld { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * @var Recipe_Maker_Validation_Service |
|
| 17 | - */ |
|
| 18 | - private $recipe_maker_validation_service; |
|
| 15 | + /** |
|
| 16 | + * @var Recipe_Maker_Validation_Service |
|
| 17 | + */ |
|
| 18 | + private $recipe_maker_validation_service; |
|
| 19 | 19 | |
| 20 | - public function __construct( $recipe_maker_validation_service ) { |
|
| 21 | - $this->recipe_maker_validation_service = $recipe_maker_validation_service; |
|
| 22 | - add_action( 'wpseo_json_ld', array( $this, 'disable_schema_types' ) ); |
|
| 23 | - } |
|
| 20 | + public function __construct( $recipe_maker_validation_service ) { |
|
| 21 | + $this->recipe_maker_validation_service = $recipe_maker_validation_service; |
|
| 22 | + add_action( 'wpseo_json_ld', array( $this, 'disable_schema_types' ) ); |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - public function disable_schema_types() { |
|
| 26 | - if ( ! get_post() instanceof \WP_Post ) { |
|
| 27 | - return false; |
|
| 28 | - } |
|
| 29 | - $post_id = get_the_ID(); |
|
| 30 | - if ( $this->recipe_maker_validation_service |
|
| 31 | - ->is_atleast_once_recipe_present_in_the_post( $post_id ) |
|
| 32 | - && ! $this->recipe_maker_validation_service->is_recipe_maker_yoast_integration_on() ) { |
|
| 33 | - add_filter( 'wpseo_schema_needs_website', '__return_false' ); |
|
| 34 | - add_filter( 'wpseo_schema_needs_webpage', '__return_false' ); |
|
| 35 | - add_filter( 'wpseo_schema_needs_article', '__return_false' ); |
|
| 36 | - } |
|
| 37 | - } |
|
| 25 | + public function disable_schema_types() { |
|
| 26 | + if ( ! get_post() instanceof \WP_Post ) { |
|
| 27 | + return false; |
|
| 28 | + } |
|
| 29 | + $post_id = get_the_ID(); |
|
| 30 | + if ( $this->recipe_maker_validation_service |
|
| 31 | + ->is_atleast_once_recipe_present_in_the_post( $post_id ) |
|
| 32 | + && ! $this->recipe_maker_validation_service->is_recipe_maker_yoast_integration_on() ) { |
|
| 33 | + add_filter( 'wpseo_schema_needs_website', '__return_false' ); |
|
| 34 | + add_filter( 'wpseo_schema_needs_webpage', '__return_false' ); |
|
| 35 | + add_filter( 'wpseo_schema_needs_article', '__return_false' ); |
|
| 36 | + } |
|
| 37 | + } |
|
| 38 | 38 | } |
@@ -17,22 +17,22 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | private $recipe_maker_validation_service; |
| 19 | 19 | |
| 20 | - public function __construct( $recipe_maker_validation_service ) { |
|
| 20 | + public function __construct($recipe_maker_validation_service) { |
|
| 21 | 21 | $this->recipe_maker_validation_service = $recipe_maker_validation_service; |
| 22 | - add_action( 'wpseo_json_ld', array( $this, 'disable_schema_types' ) ); |
|
| 22 | + add_action('wpseo_json_ld', array($this, 'disable_schema_types')); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function disable_schema_types() { |
| 26 | - if ( ! get_post() instanceof \WP_Post ) { |
|
| 26 | + if ( ! get_post() instanceof \WP_Post) { |
|
| 27 | 27 | return false; |
| 28 | 28 | } |
| 29 | 29 | $post_id = get_the_ID(); |
| 30 | - if ( $this->recipe_maker_validation_service |
|
| 31 | - ->is_atleast_once_recipe_present_in_the_post( $post_id ) |
|
| 32 | - && ! $this->recipe_maker_validation_service->is_recipe_maker_yoast_integration_on() ) { |
|
| 33 | - add_filter( 'wpseo_schema_needs_website', '__return_false' ); |
|
| 34 | - add_filter( 'wpseo_schema_needs_webpage', '__return_false' ); |
|
| 35 | - add_filter( 'wpseo_schema_needs_article', '__return_false' ); |
|
| 30 | + if ($this->recipe_maker_validation_service |
|
| 31 | + ->is_atleast_once_recipe_present_in_the_post($post_id) |
|
| 32 | + && ! $this->recipe_maker_validation_service->is_recipe_maker_yoast_integration_on()) { |
|
| 33 | + add_filter('wpseo_schema_needs_website', '__return_false'); |
|
| 34 | + add_filter('wpseo_schema_needs_webpage', '__return_false'); |
|
| 35 | + add_filter('wpseo_schema_needs_article', '__return_false'); |
|
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | } |
@@ -83,1767 +83,1767 @@ |
||
| 83 | 83 | */ |
| 84 | 84 | class Wordlift { |
| 85 | 85 | |
| 86 | - //<editor-fold desc="## FIELDS"> |
|
| 87 | - |
|
| 88 | - /** |
|
| 89 | - * The loader that's responsible for maintaining and registering all hooks that power |
|
| 90 | - * the plugin. |
|
| 91 | - * |
|
| 92 | - * @since 1.0.0 |
|
| 93 | - * @access protected |
|
| 94 | - * @var Wordlift_Loader $loader Maintains and registers all hooks for the plugin. |
|
| 95 | - */ |
|
| 96 | - protected $loader; |
|
| 97 | - |
|
| 98 | - /** |
|
| 99 | - * The unique identifier of this plugin. |
|
| 100 | - * |
|
| 101 | - * @since 1.0.0 |
|
| 102 | - * @access protected |
|
| 103 | - * @var string $plugin_name The string used to uniquely identify this plugin. |
|
| 104 | - */ |
|
| 105 | - protected $plugin_name; |
|
| 106 | - |
|
| 107 | - /** |
|
| 108 | - * The current version of the plugin. |
|
| 109 | - * |
|
| 110 | - * @since 1.0.0 |
|
| 111 | - * @access protected |
|
| 112 | - * @var string $version The current version of the plugin. |
|
| 113 | - */ |
|
| 114 | - protected $version; |
|
| 115 | - |
|
| 116 | - /** |
|
| 117 | - * The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 118 | - * |
|
| 119 | - * @since 3.12.0 |
|
| 120 | - * @access protected |
|
| 121 | - * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 122 | - */ |
|
| 123 | - protected $tinymce_adapter; |
|
| 124 | - |
|
| 125 | - /** |
|
| 126 | - * The Schema service. |
|
| 127 | - * |
|
| 128 | - * @since 3.3.0 |
|
| 129 | - * @access protected |
|
| 130 | - * @var \Wordlift_Schema_Service $schema_service The Schema service. |
|
| 131 | - */ |
|
| 132 | - protected $schema_service; |
|
| 133 | - |
|
| 134 | - /** |
|
| 135 | - * The Topic Taxonomy service. |
|
| 136 | - * |
|
| 137 | - * @since 3.5.0 |
|
| 138 | - * @access private |
|
| 139 | - * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service. |
|
| 140 | - */ |
|
| 141 | - private $topic_taxonomy_service; |
|
| 142 | - |
|
| 143 | - /** |
|
| 144 | - * The Entity Types Taxonomy service. |
|
| 145 | - * |
|
| 146 | - * @since 3.18.0 |
|
| 147 | - * @access private |
|
| 148 | - * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service. |
|
| 149 | - */ |
|
| 150 | - private $entity_types_taxonomy_service; |
|
| 151 | - |
|
| 152 | - /** |
|
| 153 | - * The User service. |
|
| 154 | - * |
|
| 155 | - * @since 3.1.7 |
|
| 156 | - * @access protected |
|
| 157 | - * @var \Wordlift_User_Service $user_service The User service. |
|
| 158 | - */ |
|
| 159 | - protected $user_service; |
|
| 160 | - |
|
| 161 | - /** |
|
| 162 | - * The Timeline service. |
|
| 163 | - * |
|
| 164 | - * @since 3.1.0 |
|
| 165 | - * @access private |
|
| 166 | - * @var \Wordlift_Timeline_Service $timeline_service The Timeline service. |
|
| 167 | - */ |
|
| 168 | - private $timeline_service; |
|
| 169 | - |
|
| 170 | - /** |
|
| 171 | - * The Redirect service. |
|
| 172 | - * |
|
| 173 | - * @since 3.2.0 |
|
| 174 | - * @access private |
|
| 175 | - * @var \Wordlift_Redirect_Service $redirect_service The Redirect service. |
|
| 176 | - */ |
|
| 177 | - private $redirect_service; |
|
| 178 | - |
|
| 179 | - /** |
|
| 180 | - * The Notice service. |
|
| 181 | - * |
|
| 182 | - * @since 3.3.0 |
|
| 183 | - * @access private |
|
| 184 | - * @var \Wordlift_Notice_Service $notice_service The Notice service. |
|
| 185 | - */ |
|
| 186 | - private $notice_service; |
|
| 187 | - |
|
| 188 | - /** |
|
| 189 | - * The Entity list customization. |
|
| 190 | - * |
|
| 191 | - * @since 3.3.0 |
|
| 192 | - * @access protected |
|
| 193 | - * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service. |
|
| 194 | - */ |
|
| 195 | - protected $entity_list_service; |
|
| 196 | - |
|
| 197 | - /** |
|
| 198 | - * The Entity Types Taxonomy Walker. |
|
| 199 | - * |
|
| 200 | - * @since 3.1.0 |
|
| 201 | - * @access private |
|
| 202 | - * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker |
|
| 203 | - */ |
|
| 204 | - private $entity_types_taxonomy_walker; |
|
| 205 | - |
|
| 206 | - /** |
|
| 207 | - * The ShareThis service. |
|
| 208 | - * |
|
| 209 | - * @since 3.2.0 |
|
| 210 | - * @access private |
|
| 211 | - * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service. |
|
| 212 | - */ |
|
| 213 | - private $sharethis_service; |
|
| 214 | - |
|
| 215 | - /** |
|
| 216 | - * The PrimaShop adapter. |
|
| 217 | - * |
|
| 218 | - * @since 3.2.3 |
|
| 219 | - * @access private |
|
| 220 | - * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter. |
|
| 221 | - */ |
|
| 222 | - private $primashop_adapter; |
|
| 223 | - |
|
| 224 | - /** |
|
| 225 | - * The entity type service. |
|
| 226 | - * |
|
| 227 | - * @since 3.6.0 |
|
| 228 | - * @access private |
|
| 229 | - * @var \Wordlift_Entity_Post_Type_Service |
|
| 230 | - */ |
|
| 231 | - private $entity_post_type_service; |
|
| 232 | - |
|
| 233 | - /** |
|
| 234 | - * The entity link service used to mangle links to entities with a custom slug or even w/o a slug. |
|
| 235 | - * |
|
| 236 | - * @since 3.6.0 |
|
| 237 | - * @access private |
|
| 238 | - * @var \Wordlift_Entity_Link_Service $entity_link_service The {@link Wordlift_Entity_Link_Service} instance. |
|
| 239 | - */ |
|
| 240 | - private $entity_link_service; |
|
| 241 | - |
|
| 242 | - /** |
|
| 243 | - * A {@link Wordlift_Jsonld_Service} instance. |
|
| 244 | - * |
|
| 245 | - * @since 3.7.0 |
|
| 246 | - * @access protected |
|
| 247 | - * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance. |
|
| 248 | - */ |
|
| 249 | - protected $jsonld_service; |
|
| 250 | - |
|
| 251 | - /** |
|
| 252 | - * A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 253 | - * |
|
| 254 | - * @since 3.14.0 |
|
| 255 | - * @access protected |
|
| 256 | - * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 257 | - */ |
|
| 258 | - protected $jsonld_website_converter; |
|
| 259 | - |
|
| 260 | - /** |
|
| 261 | - * A {@link Wordlift_Property_Factory} instance. |
|
| 262 | - * |
|
| 263 | - * @since 3.7.0 |
|
| 264 | - * @access private |
|
| 265 | - * @var \Wordlift_Property_Factory $property_factory |
|
| 266 | - */ |
|
| 267 | - private $property_factory; |
|
| 268 | - |
|
| 269 | - /** |
|
| 270 | - * The 'Download Your Data' page. |
|
| 271 | - * |
|
| 272 | - * @since 3.6.0 |
|
| 273 | - * @access private |
|
| 274 | - * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page. |
|
| 275 | - */ |
|
| 276 | - private $download_your_data_page; |
|
| 277 | - |
|
| 278 | - /** |
|
| 279 | - * The 'WordLift Settings' page. |
|
| 280 | - * |
|
| 281 | - * @since 3.11.0 |
|
| 282 | - * @access protected |
|
| 283 | - * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page. |
|
| 284 | - */ |
|
| 285 | - protected $settings_page; |
|
| 286 | - |
|
| 287 | - /** |
|
| 288 | - * The install wizard page. |
|
| 289 | - * |
|
| 290 | - * @since 3.9.0 |
|
| 291 | - * @access private |
|
| 292 | - * @var \Wordlift_Admin_Setup $admin_setup The Install wizard. |
|
| 293 | - */ |
|
| 294 | - public $admin_setup; |
|
| 295 | - |
|
| 296 | - /** |
|
| 297 | - * The Content Filter Service hooks up to the 'the_content' filter and provides |
|
| 298 | - * linking of entities to their pages. |
|
| 299 | - * |
|
| 300 | - * @since 3.8.0 |
|
| 301 | - * @access private |
|
| 302 | - * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance. |
|
| 303 | - */ |
|
| 304 | - private $content_filter_service; |
|
| 305 | - |
|
| 306 | - /** |
|
| 307 | - * The Faq Content filter service |
|
| 308 | - * @since 3.26.0 |
|
| 309 | - * @access private |
|
| 310 | - * @var Faq_Content_Filter $faq_content_filter_service A {@link Faq_Content_Filter} instance. |
|
| 311 | - */ |
|
| 312 | - private $faq_content_filter_service; |
|
| 313 | - |
|
| 314 | - /** |
|
| 315 | - * A {@link Wordlift_Key_Validation_Service} instance. |
|
| 316 | - * |
|
| 317 | - * @since 3.9.0 |
|
| 318 | - * @access private |
|
| 319 | - * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance. |
|
| 320 | - */ |
|
| 321 | - private $key_validation_service; |
|
| 322 | - |
|
| 323 | - /** |
|
| 324 | - * A {@link Wordlift_Rating_Service} instance. |
|
| 325 | - * |
|
| 326 | - * @since 3.10.0 |
|
| 327 | - * @access private |
|
| 328 | - * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance. |
|
| 329 | - */ |
|
| 330 | - private $rating_service; |
|
| 331 | - |
|
| 332 | - /** |
|
| 333 | - * A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 334 | - * |
|
| 335 | - * @since 3.10.0 |
|
| 336 | - * @access protected |
|
| 337 | - * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 338 | - */ |
|
| 339 | - protected $post_to_jsonld_converter; |
|
| 340 | - |
|
| 341 | - /** |
|
| 342 | - * A {@link Wordlift_Install_Service} instance. |
|
| 343 | - * |
|
| 344 | - * @since 3.18.0 |
|
| 345 | - * @access protected |
|
| 346 | - * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance. |
|
| 347 | - */ |
|
| 348 | - protected $install_service; |
|
| 349 | - |
|
| 350 | - /** |
|
| 351 | - * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 352 | - * |
|
| 353 | - * @since 3.10.0 |
|
| 354 | - * @access protected |
|
| 355 | - * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 356 | - */ |
|
| 357 | - protected $entity_post_to_jsonld_converter; |
|
| 358 | - |
|
| 359 | - /** |
|
| 360 | - * A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 361 | - * |
|
| 362 | - * @since 3.10.0 |
|
| 363 | - * @access protected |
|
| 364 | - * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 365 | - */ |
|
| 366 | - protected $postid_to_jsonld_converter; |
|
| 367 | - |
|
| 368 | - /** |
|
| 369 | - * The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 370 | - * |
|
| 371 | - * @since 3.11.0 |
|
| 372 | - * @access protected |
|
| 373 | - * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 374 | - */ |
|
| 375 | - protected $category_taxonomy_service; |
|
| 376 | - |
|
| 377 | - /** |
|
| 378 | - * The {@link Wordlift_Entity_Page_Service} instance. |
|
| 379 | - * |
|
| 380 | - * @since 3.11.0 |
|
| 381 | - * @access protected |
|
| 382 | - * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance. |
|
| 383 | - */ |
|
| 384 | - protected $entity_page_service; |
|
| 385 | - |
|
| 386 | - /** |
|
| 387 | - * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 388 | - * |
|
| 389 | - * @since 3.11.0 |
|
| 390 | - * @access protected |
|
| 391 | - * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 392 | - */ |
|
| 393 | - protected $settings_page_action_link; |
|
| 394 | - |
|
| 395 | - /** |
|
| 396 | - * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 397 | - * |
|
| 398 | - * @since 3.11.0 |
|
| 399 | - * @access protected |
|
| 400 | - * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 401 | - */ |
|
| 402 | - protected $analytics_settings_page_action_link; |
|
| 403 | - |
|
| 404 | - /** |
|
| 405 | - * The {@link Wordlift_Analytics_Connect} class. |
|
| 406 | - * |
|
| 407 | - * @since 3.11.0 |
|
| 408 | - * @access protected |
|
| 409 | - * @var \Wordlift_Analytics_Connect $analytics_connect The {@link Wordlift_Analytics_Connect} class. |
|
| 410 | - */ |
|
| 411 | - protected $analytics_connect; |
|
| 412 | - |
|
| 413 | - /** |
|
| 414 | - * The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 415 | - * |
|
| 416 | - * @since 3.11.0 |
|
| 417 | - * @access protected |
|
| 418 | - * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 419 | - */ |
|
| 420 | - protected $publisher_ajax_adapter; |
|
| 421 | - |
|
| 422 | - /** |
|
| 423 | - * The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 424 | - * |
|
| 425 | - * @since 3.11.0 |
|
| 426 | - * @access protected |
|
| 427 | - * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 428 | - */ |
|
| 429 | - protected $input_element; |
|
| 430 | - |
|
| 431 | - /** |
|
| 432 | - * The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 433 | - * |
|
| 434 | - * @since 3.13.0 |
|
| 435 | - * @access protected |
|
| 436 | - * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 437 | - */ |
|
| 438 | - protected $radio_input_element; |
|
| 439 | - |
|
| 440 | - /** |
|
| 441 | - * The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 442 | - * |
|
| 443 | - * @since 3.11.0 |
|
| 444 | - * @access protected |
|
| 445 | - * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 446 | - */ |
|
| 447 | - protected $language_select_element; |
|
| 448 | - |
|
| 449 | - /** |
|
| 450 | - * The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
| 451 | - * |
|
| 452 | - * @since 3.18.0 |
|
| 453 | - * @access protected |
|
| 454 | - * @var \Wordlift_Admin_Country_Select_Element $country_select_element The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
| 455 | - */ |
|
| 456 | - protected $country_select_element; |
|
| 457 | - |
|
| 458 | - /** |
|
| 459 | - * The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 460 | - * |
|
| 461 | - * @since 3.11.0 |
|
| 462 | - * @access protected |
|
| 463 | - * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 464 | - */ |
|
| 465 | - protected $publisher_element; |
|
| 466 | - |
|
| 467 | - /** |
|
| 468 | - * The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 469 | - * |
|
| 470 | - * @since 3.11.0 |
|
| 471 | - * @access protected |
|
| 472 | - * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 473 | - */ |
|
| 474 | - protected $select2_element; |
|
| 475 | - |
|
| 476 | - /** |
|
| 477 | - * The controller for the entity type list admin page |
|
| 478 | - * |
|
| 479 | - * @since 3.11.0 |
|
| 480 | - * @access private |
|
| 481 | - * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class. |
|
| 482 | - */ |
|
| 483 | - private $entity_type_admin_page; |
|
| 484 | - |
|
| 485 | - /** |
|
| 486 | - * The controller for the entity type settings admin page |
|
| 487 | - * |
|
| 488 | - * @since 3.11.0 |
|
| 489 | - * @access private |
|
| 490 | - * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class. |
|
| 491 | - */ |
|
| 492 | - private $entity_type_settings_admin_page; |
|
| 493 | - |
|
| 494 | - /** |
|
| 495 | - * The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 496 | - * |
|
| 497 | - * @since 3.11.0 |
|
| 498 | - * @access protected |
|
| 499 | - * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 500 | - */ |
|
| 501 | - protected $related_entities_cloud_widget; |
|
| 502 | - |
|
| 503 | - /** |
|
| 504 | - * The {@link Wordlift_Admin_Author_Element} instance. |
|
| 505 | - * |
|
| 506 | - * @since 3.14.0 |
|
| 507 | - * @access protected |
|
| 508 | - * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance. |
|
| 509 | - */ |
|
| 510 | - protected $author_element; |
|
| 511 | - |
|
| 512 | - /** |
|
| 513 | - * The {@link Wordlift_Sample_Data_Service} instance. |
|
| 514 | - * |
|
| 515 | - * @since 3.12.0 |
|
| 516 | - * @access protected |
|
| 517 | - * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance. |
|
| 518 | - */ |
|
| 519 | - protected $sample_data_service; |
|
| 520 | - |
|
| 521 | - /** |
|
| 522 | - * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 523 | - * |
|
| 524 | - * @since 3.12.0 |
|
| 525 | - * @access protected |
|
| 526 | - * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 527 | - */ |
|
| 528 | - protected $sample_data_ajax_adapter; |
|
| 529 | - |
|
| 530 | - /** |
|
| 531 | - * The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 532 | - * |
|
| 533 | - * @since 3.16.0 |
|
| 534 | - * @access protected |
|
| 535 | - * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 536 | - */ |
|
| 537 | - protected $google_analytics_export_service; |
|
| 538 | - |
|
| 539 | - /** |
|
| 540 | - * {@link Wordlift}'s singleton instance. |
|
| 541 | - * |
|
| 542 | - * @since 3.15.0 |
|
| 543 | - * @access protected |
|
| 544 | - * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance. |
|
| 545 | - */ |
|
| 546 | - protected $entity_type_adapter; |
|
| 547 | - |
|
| 548 | - /** |
|
| 549 | - * The {@link Wordlift_Storage_Factory} instance. |
|
| 550 | - * |
|
| 551 | - * @since 3.15.0 |
|
| 552 | - * @access protected |
|
| 553 | - * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance. |
|
| 554 | - */ |
|
| 555 | - protected $storage_factory; |
|
| 556 | - |
|
| 557 | - /** |
|
| 558 | - * The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 559 | - * |
|
| 560 | - * @since 3.15.0 |
|
| 561 | - * @access private |
|
| 562 | - * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 563 | - */ |
|
| 564 | - private $autocomplete_adapter; |
|
| 565 | - |
|
| 566 | - /** |
|
| 567 | - * The {@link Wordlift_Cached_Post_Converter} instance. |
|
| 568 | - * |
|
| 569 | - * @since 3.16.0 |
|
| 570 | - * @access protected |
|
| 571 | - * @var \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance. |
|
| 572 | - * |
|
| 573 | - */ |
|
| 574 | - protected $cached_postid_to_jsonld_converter; |
|
| 575 | - |
|
| 576 | - /** |
|
| 577 | - * The {@link Wordlift_Entity_Uri_Service} instance. |
|
| 578 | - * |
|
| 579 | - * @since 3.16.3 |
|
| 580 | - * @access protected |
|
| 581 | - * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance. |
|
| 582 | - */ |
|
| 583 | - protected $entity_uri_service; |
|
| 584 | - |
|
| 585 | - /** |
|
| 586 | - * The {@link Wordlift_Publisher_Service} instance. |
|
| 587 | - * |
|
| 588 | - * @since 3.19.0 |
|
| 589 | - * @access protected |
|
| 590 | - * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance. |
|
| 591 | - */ |
|
| 592 | - protected $publisher_service; |
|
| 593 | - |
|
| 594 | - /** |
|
| 595 | - * The {@link Wordlift_Context_Cards_Service} instance. |
|
| 596 | - * |
|
| 597 | - * @var \Wordlift_Context_Cards_Service The {@link Wordlift_Context_Cards_Service} instance. |
|
| 598 | - */ |
|
| 599 | - protected $context_cards_service; |
|
| 600 | - |
|
| 601 | - /** |
|
| 602 | - * {@link Wordlift}'s singleton instance. |
|
| 603 | - * |
|
| 604 | - * @since 3.11.2 |
|
| 605 | - * @access private |
|
| 606 | - * @var Wordlift $instance {@link Wordlift}'s singleton instance. |
|
| 607 | - */ |
|
| 608 | - private static $instance; |
|
| 609 | - |
|
| 610 | - /** |
|
| 611 | - * A singleton instance of features registry. |
|
| 612 | - * @since 3.30.0 |
|
| 613 | - * @var Features_Registry |
|
| 614 | - */ |
|
| 615 | - private $features_registry; |
|
| 616 | - |
|
| 617 | - private $analytics_settings_page; |
|
| 618 | - //</editor-fold> |
|
| 619 | - |
|
| 620 | - // Experimental code added by Nishit for feature request 1496 |
|
| 621 | - private $webhook_loader; |
|
| 622 | - // Experimental code ents here |
|
| 623 | - |
|
| 624 | - /** |
|
| 625 | - * Define the core functionality of the plugin. |
|
| 626 | - * |
|
| 627 | - * Set the plugin name and the plugin version that can be used throughout the plugin. |
|
| 628 | - * Load the dependencies, define the locale, and set the hooks for the admin area and |
|
| 629 | - * the public-facing side of the site. |
|
| 630 | - * |
|
| 631 | - * @since 1.0.0 |
|
| 632 | - */ |
|
| 633 | - public function __construct() { |
|
| 634 | - |
|
| 635 | - self::$instance = $this; |
|
| 636 | - |
|
| 637 | - $this->plugin_name = 'wordlift'; |
|
| 638 | - $this->version = '3.35.3'; |
|
| 639 | - $this->load_dependencies(); |
|
| 640 | - $this->set_locale(); |
|
| 641 | - |
|
| 642 | - $that = $this; |
|
| 643 | - add_action( 'plugins_loaded', function () use ( $that ) { |
|
| 644 | - $that->define_admin_hooks( $that ); |
|
| 645 | - $that->define_public_hooks( $that ); |
|
| 646 | - }, 4 ); |
|
| 647 | - |
|
| 648 | - // If we're in `WP_CLI` load the related files. |
|
| 649 | - if ( class_exists( 'WP_CLI' ) ) { |
|
| 650 | - $this->load_cli_dependencies(); |
|
| 651 | - } |
|
| 652 | - |
|
| 653 | - } |
|
| 654 | - |
|
| 655 | - /** |
|
| 656 | - * Get the singleton instance. |
|
| 657 | - * |
|
| 658 | - * @return Wordlift The {@link Wordlift} singleton instance. |
|
| 659 | - * @since 3.11.2 |
|
| 660 | - * |
|
| 661 | - */ |
|
| 662 | - public static function get_instance() { |
|
| 663 | - |
|
| 664 | - return self::$instance; |
|
| 665 | - } |
|
| 666 | - |
|
| 667 | - /** |
|
| 668 | - * Load the required dependencies for this plugin. |
|
| 669 | - * |
|
| 670 | - * Include the following files that make up the plugin: |
|
| 671 | - * |
|
| 672 | - * - Wordlift_Loader. Orchestrates the hooks of the plugin. |
|
| 673 | - * - Wordlift_i18n. Defines internationalization functionality. |
|
| 674 | - * - Wordlift_Admin. Defines all hooks for the admin area. |
|
| 675 | - * - Wordlift_Public. Defines all hooks for the public side of the site. |
|
| 676 | - * |
|
| 677 | - * Create an instance of the loader which will be used to register the hooks |
|
| 678 | - * with WordPress. |
|
| 679 | - * |
|
| 680 | - * @throws Exception |
|
| 681 | - * @since 1.0.0 |
|
| 682 | - * @access private |
|
| 683 | - */ |
|
| 684 | - private function load_dependencies() { |
|
| 685 | - |
|
| 686 | - /** |
|
| 687 | - * The class responsible for orchestrating the actions and filters of the |
|
| 688 | - * core plugin. |
|
| 689 | - */ |
|
| 690 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 691 | - |
|
| 692 | - // The class responsible for plugin uninstall. |
|
| 693 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
|
| 694 | - |
|
| 695 | - /** |
|
| 696 | - * The class responsible for defining internationalization functionality |
|
| 697 | - * of the plugin. |
|
| 698 | - */ |
|
| 699 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 700 | - |
|
| 701 | - /** |
|
| 702 | - * WordLift's supported languages. |
|
| 703 | - */ |
|
| 704 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 705 | - |
|
| 706 | - /** |
|
| 707 | - * WordLift's supported countries. |
|
| 708 | - */ |
|
| 709 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php'; |
|
| 710 | - |
|
| 711 | - /** |
|
| 712 | - * Provide support functions to sanitize data. |
|
| 713 | - */ |
|
| 714 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 715 | - |
|
| 716 | - /** Services. */ |
|
| 717 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 718 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
|
| 719 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 720 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 721 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 722 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 723 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 724 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 725 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php'; |
|
| 726 | - |
|
| 727 | - /** |
|
| 728 | - * The Schema service. |
|
| 729 | - */ |
|
| 730 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 731 | - |
|
| 732 | - /** |
|
| 733 | - * The schema:url property service. |
|
| 734 | - */ |
|
| 735 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 736 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 737 | - |
|
| 738 | - /** |
|
| 739 | - * The UI service. |
|
| 740 | - */ |
|
| 741 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 742 | - |
|
| 743 | - /** |
|
| 744 | - * The Entity Types Taxonomy service. |
|
| 745 | - */ |
|
| 746 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 747 | - |
|
| 748 | - /** |
|
| 749 | - * The Entity service. |
|
| 750 | - */ |
|
| 751 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
|
| 752 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 753 | - |
|
| 754 | - // Add the entity rating service. |
|
| 755 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 756 | - |
|
| 757 | - /** |
|
| 758 | - * The User service. |
|
| 759 | - */ |
|
| 760 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 761 | - |
|
| 762 | - /** |
|
| 763 | - * The Timeline service. |
|
| 764 | - */ |
|
| 765 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 766 | - |
|
| 767 | - /** |
|
| 768 | - * The Topic Taxonomy service. |
|
| 769 | - */ |
|
| 770 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 771 | - |
|
| 772 | - /** |
|
| 773 | - * The WordLift URI service. |
|
| 774 | - */ |
|
| 775 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 776 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 777 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 778 | - |
|
| 779 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 780 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 781 | - |
|
| 782 | - /** |
|
| 783 | - * Load the converters. |
|
| 784 | - */ |
|
| 785 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 786 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 787 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 788 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 789 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 790 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 791 | - |
|
| 792 | - /** |
|
| 793 | - * Load cache-related files. |
|
| 794 | - */ |
|
| 795 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
|
| 796 | - |
|
| 797 | - /** |
|
| 798 | - * Load the content filter. |
|
| 799 | - */ |
|
| 800 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 801 | - |
|
| 802 | - /* |
|
| 86 | + //<editor-fold desc="## FIELDS"> |
|
| 87 | + |
|
| 88 | + /** |
|
| 89 | + * The loader that's responsible for maintaining and registering all hooks that power |
|
| 90 | + * the plugin. |
|
| 91 | + * |
|
| 92 | + * @since 1.0.0 |
|
| 93 | + * @access protected |
|
| 94 | + * @var Wordlift_Loader $loader Maintains and registers all hooks for the plugin. |
|
| 95 | + */ |
|
| 96 | + protected $loader; |
|
| 97 | + |
|
| 98 | + /** |
|
| 99 | + * The unique identifier of this plugin. |
|
| 100 | + * |
|
| 101 | + * @since 1.0.0 |
|
| 102 | + * @access protected |
|
| 103 | + * @var string $plugin_name The string used to uniquely identify this plugin. |
|
| 104 | + */ |
|
| 105 | + protected $plugin_name; |
|
| 106 | + |
|
| 107 | + /** |
|
| 108 | + * The current version of the plugin. |
|
| 109 | + * |
|
| 110 | + * @since 1.0.0 |
|
| 111 | + * @access protected |
|
| 112 | + * @var string $version The current version of the plugin. |
|
| 113 | + */ |
|
| 114 | + protected $version; |
|
| 115 | + |
|
| 116 | + /** |
|
| 117 | + * The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 118 | + * |
|
| 119 | + * @since 3.12.0 |
|
| 120 | + * @access protected |
|
| 121 | + * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 122 | + */ |
|
| 123 | + protected $tinymce_adapter; |
|
| 124 | + |
|
| 125 | + /** |
|
| 126 | + * The Schema service. |
|
| 127 | + * |
|
| 128 | + * @since 3.3.0 |
|
| 129 | + * @access protected |
|
| 130 | + * @var \Wordlift_Schema_Service $schema_service The Schema service. |
|
| 131 | + */ |
|
| 132 | + protected $schema_service; |
|
| 133 | + |
|
| 134 | + /** |
|
| 135 | + * The Topic Taxonomy service. |
|
| 136 | + * |
|
| 137 | + * @since 3.5.0 |
|
| 138 | + * @access private |
|
| 139 | + * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service. |
|
| 140 | + */ |
|
| 141 | + private $topic_taxonomy_service; |
|
| 142 | + |
|
| 143 | + /** |
|
| 144 | + * The Entity Types Taxonomy service. |
|
| 145 | + * |
|
| 146 | + * @since 3.18.0 |
|
| 147 | + * @access private |
|
| 148 | + * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service. |
|
| 149 | + */ |
|
| 150 | + private $entity_types_taxonomy_service; |
|
| 151 | + |
|
| 152 | + /** |
|
| 153 | + * The User service. |
|
| 154 | + * |
|
| 155 | + * @since 3.1.7 |
|
| 156 | + * @access protected |
|
| 157 | + * @var \Wordlift_User_Service $user_service The User service. |
|
| 158 | + */ |
|
| 159 | + protected $user_service; |
|
| 160 | + |
|
| 161 | + /** |
|
| 162 | + * The Timeline service. |
|
| 163 | + * |
|
| 164 | + * @since 3.1.0 |
|
| 165 | + * @access private |
|
| 166 | + * @var \Wordlift_Timeline_Service $timeline_service The Timeline service. |
|
| 167 | + */ |
|
| 168 | + private $timeline_service; |
|
| 169 | + |
|
| 170 | + /** |
|
| 171 | + * The Redirect service. |
|
| 172 | + * |
|
| 173 | + * @since 3.2.0 |
|
| 174 | + * @access private |
|
| 175 | + * @var \Wordlift_Redirect_Service $redirect_service The Redirect service. |
|
| 176 | + */ |
|
| 177 | + private $redirect_service; |
|
| 178 | + |
|
| 179 | + /** |
|
| 180 | + * The Notice service. |
|
| 181 | + * |
|
| 182 | + * @since 3.3.0 |
|
| 183 | + * @access private |
|
| 184 | + * @var \Wordlift_Notice_Service $notice_service The Notice service. |
|
| 185 | + */ |
|
| 186 | + private $notice_service; |
|
| 187 | + |
|
| 188 | + /** |
|
| 189 | + * The Entity list customization. |
|
| 190 | + * |
|
| 191 | + * @since 3.3.0 |
|
| 192 | + * @access protected |
|
| 193 | + * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service. |
|
| 194 | + */ |
|
| 195 | + protected $entity_list_service; |
|
| 196 | + |
|
| 197 | + /** |
|
| 198 | + * The Entity Types Taxonomy Walker. |
|
| 199 | + * |
|
| 200 | + * @since 3.1.0 |
|
| 201 | + * @access private |
|
| 202 | + * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker |
|
| 203 | + */ |
|
| 204 | + private $entity_types_taxonomy_walker; |
|
| 205 | + |
|
| 206 | + /** |
|
| 207 | + * The ShareThis service. |
|
| 208 | + * |
|
| 209 | + * @since 3.2.0 |
|
| 210 | + * @access private |
|
| 211 | + * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service. |
|
| 212 | + */ |
|
| 213 | + private $sharethis_service; |
|
| 214 | + |
|
| 215 | + /** |
|
| 216 | + * The PrimaShop adapter. |
|
| 217 | + * |
|
| 218 | + * @since 3.2.3 |
|
| 219 | + * @access private |
|
| 220 | + * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter. |
|
| 221 | + */ |
|
| 222 | + private $primashop_adapter; |
|
| 223 | + |
|
| 224 | + /** |
|
| 225 | + * The entity type service. |
|
| 226 | + * |
|
| 227 | + * @since 3.6.0 |
|
| 228 | + * @access private |
|
| 229 | + * @var \Wordlift_Entity_Post_Type_Service |
|
| 230 | + */ |
|
| 231 | + private $entity_post_type_service; |
|
| 232 | + |
|
| 233 | + /** |
|
| 234 | + * The entity link service used to mangle links to entities with a custom slug or even w/o a slug. |
|
| 235 | + * |
|
| 236 | + * @since 3.6.0 |
|
| 237 | + * @access private |
|
| 238 | + * @var \Wordlift_Entity_Link_Service $entity_link_service The {@link Wordlift_Entity_Link_Service} instance. |
|
| 239 | + */ |
|
| 240 | + private $entity_link_service; |
|
| 241 | + |
|
| 242 | + /** |
|
| 243 | + * A {@link Wordlift_Jsonld_Service} instance. |
|
| 244 | + * |
|
| 245 | + * @since 3.7.0 |
|
| 246 | + * @access protected |
|
| 247 | + * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance. |
|
| 248 | + */ |
|
| 249 | + protected $jsonld_service; |
|
| 250 | + |
|
| 251 | + /** |
|
| 252 | + * A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 253 | + * |
|
| 254 | + * @since 3.14.0 |
|
| 255 | + * @access protected |
|
| 256 | + * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 257 | + */ |
|
| 258 | + protected $jsonld_website_converter; |
|
| 259 | + |
|
| 260 | + /** |
|
| 261 | + * A {@link Wordlift_Property_Factory} instance. |
|
| 262 | + * |
|
| 263 | + * @since 3.7.0 |
|
| 264 | + * @access private |
|
| 265 | + * @var \Wordlift_Property_Factory $property_factory |
|
| 266 | + */ |
|
| 267 | + private $property_factory; |
|
| 268 | + |
|
| 269 | + /** |
|
| 270 | + * The 'Download Your Data' page. |
|
| 271 | + * |
|
| 272 | + * @since 3.6.0 |
|
| 273 | + * @access private |
|
| 274 | + * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page. |
|
| 275 | + */ |
|
| 276 | + private $download_your_data_page; |
|
| 277 | + |
|
| 278 | + /** |
|
| 279 | + * The 'WordLift Settings' page. |
|
| 280 | + * |
|
| 281 | + * @since 3.11.0 |
|
| 282 | + * @access protected |
|
| 283 | + * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page. |
|
| 284 | + */ |
|
| 285 | + protected $settings_page; |
|
| 286 | + |
|
| 287 | + /** |
|
| 288 | + * The install wizard page. |
|
| 289 | + * |
|
| 290 | + * @since 3.9.0 |
|
| 291 | + * @access private |
|
| 292 | + * @var \Wordlift_Admin_Setup $admin_setup The Install wizard. |
|
| 293 | + */ |
|
| 294 | + public $admin_setup; |
|
| 295 | + |
|
| 296 | + /** |
|
| 297 | + * The Content Filter Service hooks up to the 'the_content' filter and provides |
|
| 298 | + * linking of entities to their pages. |
|
| 299 | + * |
|
| 300 | + * @since 3.8.0 |
|
| 301 | + * @access private |
|
| 302 | + * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance. |
|
| 303 | + */ |
|
| 304 | + private $content_filter_service; |
|
| 305 | + |
|
| 306 | + /** |
|
| 307 | + * The Faq Content filter service |
|
| 308 | + * @since 3.26.0 |
|
| 309 | + * @access private |
|
| 310 | + * @var Faq_Content_Filter $faq_content_filter_service A {@link Faq_Content_Filter} instance. |
|
| 311 | + */ |
|
| 312 | + private $faq_content_filter_service; |
|
| 313 | + |
|
| 314 | + /** |
|
| 315 | + * A {@link Wordlift_Key_Validation_Service} instance. |
|
| 316 | + * |
|
| 317 | + * @since 3.9.0 |
|
| 318 | + * @access private |
|
| 319 | + * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance. |
|
| 320 | + */ |
|
| 321 | + private $key_validation_service; |
|
| 322 | + |
|
| 323 | + /** |
|
| 324 | + * A {@link Wordlift_Rating_Service} instance. |
|
| 325 | + * |
|
| 326 | + * @since 3.10.0 |
|
| 327 | + * @access private |
|
| 328 | + * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance. |
|
| 329 | + */ |
|
| 330 | + private $rating_service; |
|
| 331 | + |
|
| 332 | + /** |
|
| 333 | + * A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 334 | + * |
|
| 335 | + * @since 3.10.0 |
|
| 336 | + * @access protected |
|
| 337 | + * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 338 | + */ |
|
| 339 | + protected $post_to_jsonld_converter; |
|
| 340 | + |
|
| 341 | + /** |
|
| 342 | + * A {@link Wordlift_Install_Service} instance. |
|
| 343 | + * |
|
| 344 | + * @since 3.18.0 |
|
| 345 | + * @access protected |
|
| 346 | + * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance. |
|
| 347 | + */ |
|
| 348 | + protected $install_service; |
|
| 349 | + |
|
| 350 | + /** |
|
| 351 | + * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 352 | + * |
|
| 353 | + * @since 3.10.0 |
|
| 354 | + * @access protected |
|
| 355 | + * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 356 | + */ |
|
| 357 | + protected $entity_post_to_jsonld_converter; |
|
| 358 | + |
|
| 359 | + /** |
|
| 360 | + * A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 361 | + * |
|
| 362 | + * @since 3.10.0 |
|
| 363 | + * @access protected |
|
| 364 | + * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 365 | + */ |
|
| 366 | + protected $postid_to_jsonld_converter; |
|
| 367 | + |
|
| 368 | + /** |
|
| 369 | + * The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 370 | + * |
|
| 371 | + * @since 3.11.0 |
|
| 372 | + * @access protected |
|
| 373 | + * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 374 | + */ |
|
| 375 | + protected $category_taxonomy_service; |
|
| 376 | + |
|
| 377 | + /** |
|
| 378 | + * The {@link Wordlift_Entity_Page_Service} instance. |
|
| 379 | + * |
|
| 380 | + * @since 3.11.0 |
|
| 381 | + * @access protected |
|
| 382 | + * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance. |
|
| 383 | + */ |
|
| 384 | + protected $entity_page_service; |
|
| 385 | + |
|
| 386 | + /** |
|
| 387 | + * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 388 | + * |
|
| 389 | + * @since 3.11.0 |
|
| 390 | + * @access protected |
|
| 391 | + * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 392 | + */ |
|
| 393 | + protected $settings_page_action_link; |
|
| 394 | + |
|
| 395 | + /** |
|
| 396 | + * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 397 | + * |
|
| 398 | + * @since 3.11.0 |
|
| 399 | + * @access protected |
|
| 400 | + * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 401 | + */ |
|
| 402 | + protected $analytics_settings_page_action_link; |
|
| 403 | + |
|
| 404 | + /** |
|
| 405 | + * The {@link Wordlift_Analytics_Connect} class. |
|
| 406 | + * |
|
| 407 | + * @since 3.11.0 |
|
| 408 | + * @access protected |
|
| 409 | + * @var \Wordlift_Analytics_Connect $analytics_connect The {@link Wordlift_Analytics_Connect} class. |
|
| 410 | + */ |
|
| 411 | + protected $analytics_connect; |
|
| 412 | + |
|
| 413 | + /** |
|
| 414 | + * The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 415 | + * |
|
| 416 | + * @since 3.11.0 |
|
| 417 | + * @access protected |
|
| 418 | + * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 419 | + */ |
|
| 420 | + protected $publisher_ajax_adapter; |
|
| 421 | + |
|
| 422 | + /** |
|
| 423 | + * The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 424 | + * |
|
| 425 | + * @since 3.11.0 |
|
| 426 | + * @access protected |
|
| 427 | + * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 428 | + */ |
|
| 429 | + protected $input_element; |
|
| 430 | + |
|
| 431 | + /** |
|
| 432 | + * The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 433 | + * |
|
| 434 | + * @since 3.13.0 |
|
| 435 | + * @access protected |
|
| 436 | + * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 437 | + */ |
|
| 438 | + protected $radio_input_element; |
|
| 439 | + |
|
| 440 | + /** |
|
| 441 | + * The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 442 | + * |
|
| 443 | + * @since 3.11.0 |
|
| 444 | + * @access protected |
|
| 445 | + * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 446 | + */ |
|
| 447 | + protected $language_select_element; |
|
| 448 | + |
|
| 449 | + /** |
|
| 450 | + * The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
| 451 | + * |
|
| 452 | + * @since 3.18.0 |
|
| 453 | + * @access protected |
|
| 454 | + * @var \Wordlift_Admin_Country_Select_Element $country_select_element The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
| 455 | + */ |
|
| 456 | + protected $country_select_element; |
|
| 457 | + |
|
| 458 | + /** |
|
| 459 | + * The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 460 | + * |
|
| 461 | + * @since 3.11.0 |
|
| 462 | + * @access protected |
|
| 463 | + * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 464 | + */ |
|
| 465 | + protected $publisher_element; |
|
| 466 | + |
|
| 467 | + /** |
|
| 468 | + * The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 469 | + * |
|
| 470 | + * @since 3.11.0 |
|
| 471 | + * @access protected |
|
| 472 | + * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 473 | + */ |
|
| 474 | + protected $select2_element; |
|
| 475 | + |
|
| 476 | + /** |
|
| 477 | + * The controller for the entity type list admin page |
|
| 478 | + * |
|
| 479 | + * @since 3.11.0 |
|
| 480 | + * @access private |
|
| 481 | + * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class. |
|
| 482 | + */ |
|
| 483 | + private $entity_type_admin_page; |
|
| 484 | + |
|
| 485 | + /** |
|
| 486 | + * The controller for the entity type settings admin page |
|
| 487 | + * |
|
| 488 | + * @since 3.11.0 |
|
| 489 | + * @access private |
|
| 490 | + * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class. |
|
| 491 | + */ |
|
| 492 | + private $entity_type_settings_admin_page; |
|
| 493 | + |
|
| 494 | + /** |
|
| 495 | + * The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 496 | + * |
|
| 497 | + * @since 3.11.0 |
|
| 498 | + * @access protected |
|
| 499 | + * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 500 | + */ |
|
| 501 | + protected $related_entities_cloud_widget; |
|
| 502 | + |
|
| 503 | + /** |
|
| 504 | + * The {@link Wordlift_Admin_Author_Element} instance. |
|
| 505 | + * |
|
| 506 | + * @since 3.14.0 |
|
| 507 | + * @access protected |
|
| 508 | + * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance. |
|
| 509 | + */ |
|
| 510 | + protected $author_element; |
|
| 511 | + |
|
| 512 | + /** |
|
| 513 | + * The {@link Wordlift_Sample_Data_Service} instance. |
|
| 514 | + * |
|
| 515 | + * @since 3.12.0 |
|
| 516 | + * @access protected |
|
| 517 | + * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance. |
|
| 518 | + */ |
|
| 519 | + protected $sample_data_service; |
|
| 520 | + |
|
| 521 | + /** |
|
| 522 | + * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 523 | + * |
|
| 524 | + * @since 3.12.0 |
|
| 525 | + * @access protected |
|
| 526 | + * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 527 | + */ |
|
| 528 | + protected $sample_data_ajax_adapter; |
|
| 529 | + |
|
| 530 | + /** |
|
| 531 | + * The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 532 | + * |
|
| 533 | + * @since 3.16.0 |
|
| 534 | + * @access protected |
|
| 535 | + * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 536 | + */ |
|
| 537 | + protected $google_analytics_export_service; |
|
| 538 | + |
|
| 539 | + /** |
|
| 540 | + * {@link Wordlift}'s singleton instance. |
|
| 541 | + * |
|
| 542 | + * @since 3.15.0 |
|
| 543 | + * @access protected |
|
| 544 | + * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance. |
|
| 545 | + */ |
|
| 546 | + protected $entity_type_adapter; |
|
| 547 | + |
|
| 548 | + /** |
|
| 549 | + * The {@link Wordlift_Storage_Factory} instance. |
|
| 550 | + * |
|
| 551 | + * @since 3.15.0 |
|
| 552 | + * @access protected |
|
| 553 | + * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance. |
|
| 554 | + */ |
|
| 555 | + protected $storage_factory; |
|
| 556 | + |
|
| 557 | + /** |
|
| 558 | + * The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 559 | + * |
|
| 560 | + * @since 3.15.0 |
|
| 561 | + * @access private |
|
| 562 | + * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 563 | + */ |
|
| 564 | + private $autocomplete_adapter; |
|
| 565 | + |
|
| 566 | + /** |
|
| 567 | + * The {@link Wordlift_Cached_Post_Converter} instance. |
|
| 568 | + * |
|
| 569 | + * @since 3.16.0 |
|
| 570 | + * @access protected |
|
| 571 | + * @var \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance. |
|
| 572 | + * |
|
| 573 | + */ |
|
| 574 | + protected $cached_postid_to_jsonld_converter; |
|
| 575 | + |
|
| 576 | + /** |
|
| 577 | + * The {@link Wordlift_Entity_Uri_Service} instance. |
|
| 578 | + * |
|
| 579 | + * @since 3.16.3 |
|
| 580 | + * @access protected |
|
| 581 | + * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance. |
|
| 582 | + */ |
|
| 583 | + protected $entity_uri_service; |
|
| 584 | + |
|
| 585 | + /** |
|
| 586 | + * The {@link Wordlift_Publisher_Service} instance. |
|
| 587 | + * |
|
| 588 | + * @since 3.19.0 |
|
| 589 | + * @access protected |
|
| 590 | + * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance. |
|
| 591 | + */ |
|
| 592 | + protected $publisher_service; |
|
| 593 | + |
|
| 594 | + /** |
|
| 595 | + * The {@link Wordlift_Context_Cards_Service} instance. |
|
| 596 | + * |
|
| 597 | + * @var \Wordlift_Context_Cards_Service The {@link Wordlift_Context_Cards_Service} instance. |
|
| 598 | + */ |
|
| 599 | + protected $context_cards_service; |
|
| 600 | + |
|
| 601 | + /** |
|
| 602 | + * {@link Wordlift}'s singleton instance. |
|
| 603 | + * |
|
| 604 | + * @since 3.11.2 |
|
| 605 | + * @access private |
|
| 606 | + * @var Wordlift $instance {@link Wordlift}'s singleton instance. |
|
| 607 | + */ |
|
| 608 | + private static $instance; |
|
| 609 | + |
|
| 610 | + /** |
|
| 611 | + * A singleton instance of features registry. |
|
| 612 | + * @since 3.30.0 |
|
| 613 | + * @var Features_Registry |
|
| 614 | + */ |
|
| 615 | + private $features_registry; |
|
| 616 | + |
|
| 617 | + private $analytics_settings_page; |
|
| 618 | + //</editor-fold> |
|
| 619 | + |
|
| 620 | + // Experimental code added by Nishit for feature request 1496 |
|
| 621 | + private $webhook_loader; |
|
| 622 | + // Experimental code ents here |
|
| 623 | + |
|
| 624 | + /** |
|
| 625 | + * Define the core functionality of the plugin. |
|
| 626 | + * |
|
| 627 | + * Set the plugin name and the plugin version that can be used throughout the plugin. |
|
| 628 | + * Load the dependencies, define the locale, and set the hooks for the admin area and |
|
| 629 | + * the public-facing side of the site. |
|
| 630 | + * |
|
| 631 | + * @since 1.0.0 |
|
| 632 | + */ |
|
| 633 | + public function __construct() { |
|
| 634 | + |
|
| 635 | + self::$instance = $this; |
|
| 636 | + |
|
| 637 | + $this->plugin_name = 'wordlift'; |
|
| 638 | + $this->version = '3.35.3'; |
|
| 639 | + $this->load_dependencies(); |
|
| 640 | + $this->set_locale(); |
|
| 641 | + |
|
| 642 | + $that = $this; |
|
| 643 | + add_action( 'plugins_loaded', function () use ( $that ) { |
|
| 644 | + $that->define_admin_hooks( $that ); |
|
| 645 | + $that->define_public_hooks( $that ); |
|
| 646 | + }, 4 ); |
|
| 647 | + |
|
| 648 | + // If we're in `WP_CLI` load the related files. |
|
| 649 | + if ( class_exists( 'WP_CLI' ) ) { |
|
| 650 | + $this->load_cli_dependencies(); |
|
| 651 | + } |
|
| 652 | + |
|
| 653 | + } |
|
| 654 | + |
|
| 655 | + /** |
|
| 656 | + * Get the singleton instance. |
|
| 657 | + * |
|
| 658 | + * @return Wordlift The {@link Wordlift} singleton instance. |
|
| 659 | + * @since 3.11.2 |
|
| 660 | + * |
|
| 661 | + */ |
|
| 662 | + public static function get_instance() { |
|
| 663 | + |
|
| 664 | + return self::$instance; |
|
| 665 | + } |
|
| 666 | + |
|
| 667 | + /** |
|
| 668 | + * Load the required dependencies for this plugin. |
|
| 669 | + * |
|
| 670 | + * Include the following files that make up the plugin: |
|
| 671 | + * |
|
| 672 | + * - Wordlift_Loader. Orchestrates the hooks of the plugin. |
|
| 673 | + * - Wordlift_i18n. Defines internationalization functionality. |
|
| 674 | + * - Wordlift_Admin. Defines all hooks for the admin area. |
|
| 675 | + * - Wordlift_Public. Defines all hooks for the public side of the site. |
|
| 676 | + * |
|
| 677 | + * Create an instance of the loader which will be used to register the hooks |
|
| 678 | + * with WordPress. |
|
| 679 | + * |
|
| 680 | + * @throws Exception |
|
| 681 | + * @since 1.0.0 |
|
| 682 | + * @access private |
|
| 683 | + */ |
|
| 684 | + private function load_dependencies() { |
|
| 685 | + |
|
| 686 | + /** |
|
| 687 | + * The class responsible for orchestrating the actions and filters of the |
|
| 688 | + * core plugin. |
|
| 689 | + */ |
|
| 690 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 691 | + |
|
| 692 | + // The class responsible for plugin uninstall. |
|
| 693 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
|
| 694 | + |
|
| 695 | + /** |
|
| 696 | + * The class responsible for defining internationalization functionality |
|
| 697 | + * of the plugin. |
|
| 698 | + */ |
|
| 699 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 700 | + |
|
| 701 | + /** |
|
| 702 | + * WordLift's supported languages. |
|
| 703 | + */ |
|
| 704 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 705 | + |
|
| 706 | + /** |
|
| 707 | + * WordLift's supported countries. |
|
| 708 | + */ |
|
| 709 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php'; |
|
| 710 | + |
|
| 711 | + /** |
|
| 712 | + * Provide support functions to sanitize data. |
|
| 713 | + */ |
|
| 714 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 715 | + |
|
| 716 | + /** Services. */ |
|
| 717 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 718 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
|
| 719 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 720 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 721 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 722 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 723 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 724 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 725 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php'; |
|
| 726 | + |
|
| 727 | + /** |
|
| 728 | + * The Schema service. |
|
| 729 | + */ |
|
| 730 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 731 | + |
|
| 732 | + /** |
|
| 733 | + * The schema:url property service. |
|
| 734 | + */ |
|
| 735 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 736 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 737 | + |
|
| 738 | + /** |
|
| 739 | + * The UI service. |
|
| 740 | + */ |
|
| 741 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 742 | + |
|
| 743 | + /** |
|
| 744 | + * The Entity Types Taxonomy service. |
|
| 745 | + */ |
|
| 746 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 747 | + |
|
| 748 | + /** |
|
| 749 | + * The Entity service. |
|
| 750 | + */ |
|
| 751 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
|
| 752 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 753 | + |
|
| 754 | + // Add the entity rating service. |
|
| 755 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 756 | + |
|
| 757 | + /** |
|
| 758 | + * The User service. |
|
| 759 | + */ |
|
| 760 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 761 | + |
|
| 762 | + /** |
|
| 763 | + * The Timeline service. |
|
| 764 | + */ |
|
| 765 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 766 | + |
|
| 767 | + /** |
|
| 768 | + * The Topic Taxonomy service. |
|
| 769 | + */ |
|
| 770 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 771 | + |
|
| 772 | + /** |
|
| 773 | + * The WordLift URI service. |
|
| 774 | + */ |
|
| 775 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 776 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 777 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 778 | + |
|
| 779 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 780 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 781 | + |
|
| 782 | + /** |
|
| 783 | + * Load the converters. |
|
| 784 | + */ |
|
| 785 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 786 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 787 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 788 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 789 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 790 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 791 | + |
|
| 792 | + /** |
|
| 793 | + * Load cache-related files. |
|
| 794 | + */ |
|
| 795 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
|
| 796 | + |
|
| 797 | + /** |
|
| 798 | + * Load the content filter. |
|
| 799 | + */ |
|
| 800 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 801 | + |
|
| 802 | + /* |
|
| 803 | 803 | * Load the excerpt helper. |
| 804 | 804 | */ |
| 805 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 806 | - |
|
| 807 | - /** |
|
| 808 | - * Load the JSON-LD service to publish entities using JSON-LD.s |
|
| 809 | - * |
|
| 810 | - * @since 3.8.0 |
|
| 811 | - */ |
|
| 812 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 813 | - |
|
| 814 | - // The Publisher Service and the AJAX adapter. |
|
| 815 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 816 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 817 | - |
|
| 818 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 819 | - |
|
| 820 | - /** |
|
| 821 | - * Load the WordLift key validation service. |
|
| 822 | - */ |
|
| 823 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 824 | - |
|
| 825 | - // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
|
| 826 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 827 | - |
|
| 828 | - // Load the `Wordlift_Entity_Page_Service` class definition. |
|
| 829 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
| 830 | - |
|
| 831 | - /** Linked Data. */ |
|
| 832 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 833 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 834 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 835 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 836 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 837 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 838 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 839 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 840 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 841 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 842 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 843 | - |
|
| 844 | - /** Services. */ |
|
| 845 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 846 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php'; |
|
| 847 | - |
|
| 848 | - /** Adapters. */ |
|
| 849 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 850 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 851 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 852 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 853 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php'; |
|
| 854 | - |
|
| 855 | - /** Autocomplete. */ |
|
| 856 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 857 | - |
|
| 858 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
|
| 859 | - |
|
| 860 | - /** Analytics */ |
|
| 861 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 862 | - |
|
| 863 | - /** |
|
| 864 | - * The class responsible for defining all actions that occur in the admin area. |
|
| 865 | - */ |
|
| 866 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 867 | - |
|
| 868 | - /** |
|
| 869 | - * The class to customize the entity list admin page. |
|
| 870 | - */ |
|
| 871 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 872 | - |
|
| 873 | - /** |
|
| 874 | - * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
|
| 875 | - */ |
|
| 876 | - global $wp_version; |
|
| 877 | - if ( version_compare( $wp_version, '5.3', '<' ) ) { |
|
| 878 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 879 | - } else { |
|
| 880 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
| 881 | - } |
|
| 882 | - |
|
| 883 | - /** |
|
| 884 | - * The Notice service. |
|
| 885 | - */ |
|
| 886 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 887 | - |
|
| 888 | - /** |
|
| 889 | - * The PrimaShop adapter. |
|
| 890 | - */ |
|
| 891 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 892 | - |
|
| 893 | - /** |
|
| 894 | - * The WordLift Dashboard service. |
|
| 895 | - */ |
|
| 896 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 897 | - |
|
| 898 | - /** |
|
| 899 | - * The admin 'Install wizard' page. |
|
| 900 | - */ |
|
| 901 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 902 | - |
|
| 903 | - /** |
|
| 904 | - * The WordLift entity type list admin page controller. |
|
| 905 | - */ |
|
| 906 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 907 | - |
|
| 908 | - /** |
|
| 909 | - * The WordLift entity type settings admin page controller. |
|
| 910 | - */ |
|
| 911 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 912 | - |
|
| 913 | - /** |
|
| 914 | - * The admin 'Download Your Data' page. |
|
| 915 | - */ |
|
| 916 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 917 | - |
|
| 918 | - /** |
|
| 919 | - * The admin 'WordLift Settings' page. |
|
| 920 | - */ |
|
| 921 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php'; |
|
| 922 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 923 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 924 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 925 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 926 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 927 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 928 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 929 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 930 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 931 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 932 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 933 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
| 934 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 935 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
| 936 | - |
|
| 937 | - /** Admin Pages */ |
|
| 938 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 939 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 940 | - |
|
| 941 | - /** |
|
| 942 | - * The class responsible for defining all actions that occur in the public-facing |
|
| 943 | - * side of the site. |
|
| 944 | - */ |
|
| 945 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 946 | - |
|
| 947 | - /** |
|
| 948 | - * The shortcode abstract class. |
|
| 949 | - */ |
|
| 950 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 951 | - |
|
| 952 | - /** |
|
| 953 | - * The Timeline shortcode. |
|
| 954 | - */ |
|
| 955 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 956 | - |
|
| 957 | - /** |
|
| 958 | - * The Navigator shortcode. |
|
| 959 | - */ |
|
| 960 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 961 | - |
|
| 962 | - /** |
|
| 963 | - * The Products Navigator shortcode. |
|
| 964 | - */ |
|
| 965 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php'; |
|
| 966 | - |
|
| 967 | - /** |
|
| 968 | - * The chord shortcode. |
|
| 969 | - */ |
|
| 970 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 971 | - |
|
| 972 | - /** |
|
| 973 | - * The geomap shortcode. |
|
| 974 | - */ |
|
| 975 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 976 | - |
|
| 977 | - /** |
|
| 978 | - * The entity cloud shortcode. |
|
| 979 | - */ |
|
| 980 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 981 | - |
|
| 982 | - /** |
|
| 983 | - * The entity glossary shortcode. |
|
| 984 | - */ |
|
| 985 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
|
| 986 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 987 | - |
|
| 988 | - /** |
|
| 989 | - * Faceted Search shortcode. |
|
| 990 | - */ |
|
| 991 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 992 | - |
|
| 993 | - /** |
|
| 994 | - * The ShareThis service. |
|
| 995 | - */ |
|
| 996 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 997 | - |
|
| 998 | - /** |
|
| 999 | - * The SEO service. |
|
| 1000 | - */ |
|
| 1001 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 1002 | - |
|
| 1003 | - /** |
|
| 1004 | - * The AMP service. |
|
| 1005 | - */ |
|
| 1006 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1007 | - |
|
| 1008 | - /** Widgets */ |
|
| 1009 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1010 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1011 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php'; |
|
| 1012 | - |
|
| 1013 | - /* |
|
| 805 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 806 | + |
|
| 807 | + /** |
|
| 808 | + * Load the JSON-LD service to publish entities using JSON-LD.s |
|
| 809 | + * |
|
| 810 | + * @since 3.8.0 |
|
| 811 | + */ |
|
| 812 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 813 | + |
|
| 814 | + // The Publisher Service and the AJAX adapter. |
|
| 815 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 816 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 817 | + |
|
| 818 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 819 | + |
|
| 820 | + /** |
|
| 821 | + * Load the WordLift key validation service. |
|
| 822 | + */ |
|
| 823 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 824 | + |
|
| 825 | + // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
|
| 826 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 827 | + |
|
| 828 | + // Load the `Wordlift_Entity_Page_Service` class definition. |
|
| 829 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
| 830 | + |
|
| 831 | + /** Linked Data. */ |
|
| 832 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 833 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 834 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 835 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 836 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 837 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 838 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 839 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 840 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 841 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 842 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 843 | + |
|
| 844 | + /** Services. */ |
|
| 845 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 846 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php'; |
|
| 847 | + |
|
| 848 | + /** Adapters. */ |
|
| 849 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 850 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 851 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 852 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 853 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php'; |
|
| 854 | + |
|
| 855 | + /** Autocomplete. */ |
|
| 856 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 857 | + |
|
| 858 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
|
| 859 | + |
|
| 860 | + /** Analytics */ |
|
| 861 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 862 | + |
|
| 863 | + /** |
|
| 864 | + * The class responsible for defining all actions that occur in the admin area. |
|
| 865 | + */ |
|
| 866 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 867 | + |
|
| 868 | + /** |
|
| 869 | + * The class to customize the entity list admin page. |
|
| 870 | + */ |
|
| 871 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 872 | + |
|
| 873 | + /** |
|
| 874 | + * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
|
| 875 | + */ |
|
| 876 | + global $wp_version; |
|
| 877 | + if ( version_compare( $wp_version, '5.3', '<' ) ) { |
|
| 878 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 879 | + } else { |
|
| 880 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
| 881 | + } |
|
| 882 | + |
|
| 883 | + /** |
|
| 884 | + * The Notice service. |
|
| 885 | + */ |
|
| 886 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 887 | + |
|
| 888 | + /** |
|
| 889 | + * The PrimaShop adapter. |
|
| 890 | + */ |
|
| 891 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 892 | + |
|
| 893 | + /** |
|
| 894 | + * The WordLift Dashboard service. |
|
| 895 | + */ |
|
| 896 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 897 | + |
|
| 898 | + /** |
|
| 899 | + * The admin 'Install wizard' page. |
|
| 900 | + */ |
|
| 901 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 902 | + |
|
| 903 | + /** |
|
| 904 | + * The WordLift entity type list admin page controller. |
|
| 905 | + */ |
|
| 906 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 907 | + |
|
| 908 | + /** |
|
| 909 | + * The WordLift entity type settings admin page controller. |
|
| 910 | + */ |
|
| 911 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 912 | + |
|
| 913 | + /** |
|
| 914 | + * The admin 'Download Your Data' page. |
|
| 915 | + */ |
|
| 916 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 917 | + |
|
| 918 | + /** |
|
| 919 | + * The admin 'WordLift Settings' page. |
|
| 920 | + */ |
|
| 921 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php'; |
|
| 922 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 923 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 924 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 925 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 926 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 927 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 928 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 929 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 930 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 931 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 932 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 933 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
| 934 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 935 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
| 936 | + |
|
| 937 | + /** Admin Pages */ |
|
| 938 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 939 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 940 | + |
|
| 941 | + /** |
|
| 942 | + * The class responsible for defining all actions that occur in the public-facing |
|
| 943 | + * side of the site. |
|
| 944 | + */ |
|
| 945 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 946 | + |
|
| 947 | + /** |
|
| 948 | + * The shortcode abstract class. |
|
| 949 | + */ |
|
| 950 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 951 | + |
|
| 952 | + /** |
|
| 953 | + * The Timeline shortcode. |
|
| 954 | + */ |
|
| 955 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 956 | + |
|
| 957 | + /** |
|
| 958 | + * The Navigator shortcode. |
|
| 959 | + */ |
|
| 960 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 961 | + |
|
| 962 | + /** |
|
| 963 | + * The Products Navigator shortcode. |
|
| 964 | + */ |
|
| 965 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php'; |
|
| 966 | + |
|
| 967 | + /** |
|
| 968 | + * The chord shortcode. |
|
| 969 | + */ |
|
| 970 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 971 | + |
|
| 972 | + /** |
|
| 973 | + * The geomap shortcode. |
|
| 974 | + */ |
|
| 975 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 976 | + |
|
| 977 | + /** |
|
| 978 | + * The entity cloud shortcode. |
|
| 979 | + */ |
|
| 980 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 981 | + |
|
| 982 | + /** |
|
| 983 | + * The entity glossary shortcode. |
|
| 984 | + */ |
|
| 985 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
|
| 986 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 987 | + |
|
| 988 | + /** |
|
| 989 | + * Faceted Search shortcode. |
|
| 990 | + */ |
|
| 991 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 992 | + |
|
| 993 | + /** |
|
| 994 | + * The ShareThis service. |
|
| 995 | + */ |
|
| 996 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 997 | + |
|
| 998 | + /** |
|
| 999 | + * The SEO service. |
|
| 1000 | + */ |
|
| 1001 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 1002 | + |
|
| 1003 | + /** |
|
| 1004 | + * The AMP service. |
|
| 1005 | + */ |
|
| 1006 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1007 | + |
|
| 1008 | + /** Widgets */ |
|
| 1009 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1010 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1011 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php'; |
|
| 1012 | + |
|
| 1013 | + /* |
|
| 1014 | 1014 | * Batch Operations. They're similar to Batch Actions but do not require working on post types. |
| 1015 | 1015 | * |
| 1016 | 1016 | * Eventually Batch Actions will become Batch Operations. |
| 1017 | 1017 | * |
| 1018 | 1018 | * @since 3.20.0 |
| 1019 | 1019 | */ |
| 1020 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1021 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1020 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1021 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1022 | 1022 | |
| 1023 | - /* |
|
| 1023 | + /* |
|
| 1024 | 1024 | * Schema.org Services. |
| 1025 | 1025 | * |
| 1026 | 1026 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1027 | 1027 | */ |
| 1028 | - if ( WL_ALL_ENTITY_TYPES ) { |
|
| 1029 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1030 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1031 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1032 | - new Wordlift_Schemaorg_Sync_Service(); |
|
| 1033 | - $schemaorg_property_service = Wordlift_Schemaorg_Property_Service::get_instance(); |
|
| 1034 | - new Wordlift_Schemaorg_Class_Service(); |
|
| 1035 | - } else { |
|
| 1036 | - $schemaorg_property_service = null; |
|
| 1037 | - } |
|
| 1038 | - |
|
| 1039 | - $this->loader = new Wordlift_Loader(); |
|
| 1040 | - /** |
|
| 1041 | - * @since 3.30.0 |
|
| 1042 | - */ |
|
| 1043 | - $this->features_registry = Features_Registry::get_instance(); |
|
| 1044 | - |
|
| 1045 | - // Instantiate a global logger. |
|
| 1046 | - global $wl_logger; |
|
| 1047 | - $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1048 | - |
|
| 1049 | - // Load the `wl-api` end-point. |
|
| 1050 | - new Wordlift_Http_Api(); |
|
| 1051 | - |
|
| 1052 | - // Load the Install Service. |
|
| 1053 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
|
| 1054 | - $this->install_service = new Wordlift_Install_Service(); |
|
| 1055 | - $this->notice_service = new Wordlift_Notice_Service(); |
|
| 1056 | - $this->user_service = Wordlift_User_Service::get_instance(); |
|
| 1057 | - // create an instance of the entity type list admin page controller. |
|
| 1058 | - $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
|
| 1059 | - $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
|
| 1060 | - $this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service(); |
|
| 1061 | - // Create an entity type service instance. It'll be later bound to the init action. |
|
| 1062 | - $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( |
|
| 1063 | - Wordlift_Entity_Service::TYPE_NAME, Wordlift_Configuration_Service::get_instance()->get_entity_base_path() ); |
|
| 1064 | - /* WordPress Admin. */ |
|
| 1065 | - $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page(); |
|
| 1066 | - // create an instance of the entity type setting admin page controller. |
|
| 1067 | - $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
|
| 1068 | - |
|
| 1069 | - |
|
| 1070 | - $that = $this; |
|
| 1071 | - add_action( 'plugins_loaded', function () use ( &$that, $schemaorg_property_service ) { |
|
| 1072 | - |
|
| 1073 | - /** Services. */ |
|
| 1074 | - // Create the configuration service. |
|
| 1075 | - $api_service = new Wordlift_Api_Service(); |
|
| 1076 | - |
|
| 1077 | - // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
|
| 1078 | - $that->entity_link_service = new Wordlift_Entity_Link_Service( $that->entity_post_type_service, Wordlift_Configuration_Service::get_instance()->get_entity_base_path() ); |
|
| 1079 | - |
|
| 1080 | - $schema_url_property_service = new Wordlift_Schema_Url_Property_Service(); |
|
| 1081 | - |
|
| 1082 | - $that->entity_uri_service = Wordlift_Entity_Uri_Service::get_instance(); |
|
| 1083 | - |
|
| 1084 | - // Create a new instance of the Redirect service. |
|
| 1085 | - $that->redirect_service = new Wordlift_Redirect_Service( $that->entity_uri_service ); |
|
| 1086 | - |
|
| 1087 | - // Create a new instance of the Timeline service and Timeline shortcode. |
|
| 1088 | - $that->timeline_service = new Wordlift_Timeline_Service(); |
|
| 1089 | - |
|
| 1090 | - $that->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
|
| 1091 | - |
|
| 1092 | - // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
|
| 1093 | - $that->sharethis_service = new Wordlift_ShareThis_Service(); |
|
| 1094 | - |
|
| 1095 | - // Create an instance of the PrimaShop adapter. |
|
| 1096 | - $that->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
|
| 1097 | - |
|
| 1098 | - $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1099 | - |
|
| 1100 | - // Create the entity rating service. |
|
| 1101 | - $that->rating_service = Wordlift_Rating_Service::get_instance(); |
|
| 1102 | - |
|
| 1103 | - // Create entity list customization (wp-admin/edit.php). |
|
| 1104 | - $that->entity_list_service = new Wordlift_Entity_List_Service( $that->rating_service ); |
|
| 1105 | - |
|
| 1106 | - // Create an instance of the Publisher Service and the AJAX Adapter. |
|
| 1107 | - $that->publisher_service = Wordlift_Publisher_Service::get_instance(); |
|
| 1108 | - $that->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1109 | - $that->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1110 | - |
|
| 1111 | - $attachment_service = Wordlift_Attachment_Service::get_instance(); |
|
| 1112 | - |
|
| 1113 | - // Instantiate the JSON-LD service. |
|
| 1114 | - $property_getter = Wordlift_Property_Getter_Factory::create(); |
|
| 1115 | - $that->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service ); |
|
| 1116 | - $that->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $that->post_to_jsonld_converter ); |
|
| 1117 | - $that->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter( $that->entity_post_to_jsonld_converter, $that->post_to_jsonld_converter ); |
|
| 1118 | - $that->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service ); |
|
| 1119 | - |
|
| 1120 | - $jsonld_cache = new Ttl_Cache( 'jsonld', 86400 ); |
|
| 1121 | - $that->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $that->postid_to_jsonld_converter, $jsonld_cache ); |
|
| 1122 | - /* |
|
| 1028 | + if ( WL_ALL_ENTITY_TYPES ) { |
|
| 1029 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1030 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1031 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1032 | + new Wordlift_Schemaorg_Sync_Service(); |
|
| 1033 | + $schemaorg_property_service = Wordlift_Schemaorg_Property_Service::get_instance(); |
|
| 1034 | + new Wordlift_Schemaorg_Class_Service(); |
|
| 1035 | + } else { |
|
| 1036 | + $schemaorg_property_service = null; |
|
| 1037 | + } |
|
| 1038 | + |
|
| 1039 | + $this->loader = new Wordlift_Loader(); |
|
| 1040 | + /** |
|
| 1041 | + * @since 3.30.0 |
|
| 1042 | + */ |
|
| 1043 | + $this->features_registry = Features_Registry::get_instance(); |
|
| 1044 | + |
|
| 1045 | + // Instantiate a global logger. |
|
| 1046 | + global $wl_logger; |
|
| 1047 | + $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1048 | + |
|
| 1049 | + // Load the `wl-api` end-point. |
|
| 1050 | + new Wordlift_Http_Api(); |
|
| 1051 | + |
|
| 1052 | + // Load the Install Service. |
|
| 1053 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
|
| 1054 | + $this->install_service = new Wordlift_Install_Service(); |
|
| 1055 | + $this->notice_service = new Wordlift_Notice_Service(); |
|
| 1056 | + $this->user_service = Wordlift_User_Service::get_instance(); |
|
| 1057 | + // create an instance of the entity type list admin page controller. |
|
| 1058 | + $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
|
| 1059 | + $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
|
| 1060 | + $this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service(); |
|
| 1061 | + // Create an entity type service instance. It'll be later bound to the init action. |
|
| 1062 | + $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( |
|
| 1063 | + Wordlift_Entity_Service::TYPE_NAME, Wordlift_Configuration_Service::get_instance()->get_entity_base_path() ); |
|
| 1064 | + /* WordPress Admin. */ |
|
| 1065 | + $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page(); |
|
| 1066 | + // create an instance of the entity type setting admin page controller. |
|
| 1067 | + $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
|
| 1068 | + |
|
| 1069 | + |
|
| 1070 | + $that = $this; |
|
| 1071 | + add_action( 'plugins_loaded', function () use ( &$that, $schemaorg_property_service ) { |
|
| 1072 | + |
|
| 1073 | + /** Services. */ |
|
| 1074 | + // Create the configuration service. |
|
| 1075 | + $api_service = new Wordlift_Api_Service(); |
|
| 1076 | + |
|
| 1077 | + // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
|
| 1078 | + $that->entity_link_service = new Wordlift_Entity_Link_Service( $that->entity_post_type_service, Wordlift_Configuration_Service::get_instance()->get_entity_base_path() ); |
|
| 1079 | + |
|
| 1080 | + $schema_url_property_service = new Wordlift_Schema_Url_Property_Service(); |
|
| 1081 | + |
|
| 1082 | + $that->entity_uri_service = Wordlift_Entity_Uri_Service::get_instance(); |
|
| 1083 | + |
|
| 1084 | + // Create a new instance of the Redirect service. |
|
| 1085 | + $that->redirect_service = new Wordlift_Redirect_Service( $that->entity_uri_service ); |
|
| 1086 | + |
|
| 1087 | + // Create a new instance of the Timeline service and Timeline shortcode. |
|
| 1088 | + $that->timeline_service = new Wordlift_Timeline_Service(); |
|
| 1089 | + |
|
| 1090 | + $that->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
|
| 1091 | + |
|
| 1092 | + // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
|
| 1093 | + $that->sharethis_service = new Wordlift_ShareThis_Service(); |
|
| 1094 | + |
|
| 1095 | + // Create an instance of the PrimaShop adapter. |
|
| 1096 | + $that->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
|
| 1097 | + |
|
| 1098 | + $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1099 | + |
|
| 1100 | + // Create the entity rating service. |
|
| 1101 | + $that->rating_service = Wordlift_Rating_Service::get_instance(); |
|
| 1102 | + |
|
| 1103 | + // Create entity list customization (wp-admin/edit.php). |
|
| 1104 | + $that->entity_list_service = new Wordlift_Entity_List_Service( $that->rating_service ); |
|
| 1105 | + |
|
| 1106 | + // Create an instance of the Publisher Service and the AJAX Adapter. |
|
| 1107 | + $that->publisher_service = Wordlift_Publisher_Service::get_instance(); |
|
| 1108 | + $that->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1109 | + $that->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1110 | + |
|
| 1111 | + $attachment_service = Wordlift_Attachment_Service::get_instance(); |
|
| 1112 | + |
|
| 1113 | + // Instantiate the JSON-LD service. |
|
| 1114 | + $property_getter = Wordlift_Property_Getter_Factory::create(); |
|
| 1115 | + $that->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service ); |
|
| 1116 | + $that->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $that->post_to_jsonld_converter ); |
|
| 1117 | + $that->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter( $that->entity_post_to_jsonld_converter, $that->post_to_jsonld_converter ); |
|
| 1118 | + $that->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service ); |
|
| 1119 | + |
|
| 1120 | + $jsonld_cache = new Ttl_Cache( 'jsonld', 86400 ); |
|
| 1121 | + $that->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $that->postid_to_jsonld_converter, $jsonld_cache ); |
|
| 1122 | + /* |
|
| 1123 | 1123 | * Load the `Wordlift_Term_JsonLd_Adapter`. |
| 1124 | 1124 | * |
| 1125 | 1125 | * @see https://github.com/insideout10/wordlift-plugin/issues/892 |
| 1126 | 1126 | * |
| 1127 | 1127 | * @since 3.20.0 |
| 1128 | 1128 | */ |
| 1129 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1130 | - |
|
| 1131 | - $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $that->entity_uri_service, $that->cached_postid_to_jsonld_converter ); |
|
| 1132 | - $that->jsonld_service = new Wordlift_Jsonld_Service( Wordlift_Entity_Service::get_instance(), $that->cached_postid_to_jsonld_converter, $that->jsonld_website_converter, $term_jsonld_adapter ); |
|
| 1133 | - |
|
| 1134 | - $jsonld_service = new Jsonld_Service( |
|
| 1135 | - $that->jsonld_service, |
|
| 1136 | - $term_jsonld_adapter, |
|
| 1137 | - new Jsonld_User_Service( $that->user_service ) ); |
|
| 1138 | - new Jsonld_Endpoint( $jsonld_service, $that->entity_uri_service ); |
|
| 1139 | - |
|
| 1140 | - // Prints the JSON-LD in the head. |
|
| 1141 | - new Jsonld_Adapter( $that->jsonld_service ); |
|
| 1142 | - |
|
| 1143 | - new Jsonld_By_Id_Endpoint( $that->jsonld_service, $that->entity_uri_service ); |
|
| 1144 | - |
|
| 1145 | - $that->key_validation_service = new Wordlift_Key_Validation_Service(); |
|
| 1146 | - $that->content_filter_service = Wordlift_Content_Filter_Service::get_instance(); |
|
| 1147 | - // Creating Faq Content filter service. |
|
| 1148 | - $that->faq_content_filter_service = new Faq_Content_Filter(); |
|
| 1149 | - $that->sample_data_service = Wordlift_Sample_Data_Service::get_instance(); |
|
| 1150 | - $that->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $that->sample_data_service ); |
|
| 1151 | - |
|
| 1152 | - $that->loader->add_action( 'enqueue_block_editor_assets', $that, 'add_wl_enabled_blocks' ); |
|
| 1153 | - $that->loader->add_action( 'admin_enqueue_scripts', $that, 'add_wl_enabled_blocks' ); |
|
| 1154 | - |
|
| 1155 | - /** |
|
| 1156 | - * Filter: wl_feature__enable__blocks. |
|
| 1157 | - * |
|
| 1158 | - * @param bool whether the blocks needed to be registered, defaults to true. |
|
| 1159 | - * |
|
| 1160 | - * @return bool |
|
| 1161 | - * @since 3.27.6 |
|
| 1162 | - */ |
|
| 1163 | - if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 1164 | - // Initialize the short-codes. |
|
| 1165 | - new Async_Template_Decorator( new Wordlift_Navigator_Shortcode() ); |
|
| 1166 | - new Wordlift_Chord_Shortcode(); |
|
| 1167 | - new Wordlift_Geomap_Shortcode(); |
|
| 1168 | - new Wordlift_Timeline_Shortcode(); |
|
| 1169 | - new Wordlift_Related_Entities_Cloud_Shortcode( Wordlift_Relation_Service::get_instance(), Wordlift_Entity_Service::get_instance() ); |
|
| 1170 | - new Wordlift_Vocabulary_Shortcode(); |
|
| 1171 | - new Async_Template_Decorator( new Wordlift_Faceted_Search_Shortcode() ); |
|
| 1172 | - } |
|
| 1173 | - |
|
| 1174 | - new Wordlift_Products_Navigator_Shortcode(); |
|
| 1175 | - |
|
| 1176 | - |
|
| 1177 | - // Initialize the Context Cards Service |
|
| 1178 | - $that->context_cards_service = new Wordlift_Context_Cards_Service(); |
|
| 1179 | - |
|
| 1180 | - // Initialize the SEO service. |
|
| 1181 | - new Wordlift_Seo_Service(); |
|
| 1182 | - |
|
| 1183 | - // Initialize the AMP service. |
|
| 1184 | - new Wordlift_AMP_Service( $that->jsonld_service ); |
|
| 1185 | - |
|
| 1186 | - /** Services. */ |
|
| 1187 | - $that->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
|
| 1188 | - new Wordlift_Image_Service(); |
|
| 1189 | - |
|
| 1190 | - /** Adapters. */ |
|
| 1191 | - $that->entity_type_adapter = new Wordlift_Entity_Type_Adapter( Wordlift_Entity_Type_Service::get_instance() ); |
|
| 1192 | - $that->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $that->publisher_service ); |
|
| 1193 | - $that->tinymce_adapter = new Wordlift_Tinymce_Adapter( $that ); |
|
| 1194 | - |
|
| 1195 | - /* |
|
| 1129 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1130 | + |
|
| 1131 | + $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $that->entity_uri_service, $that->cached_postid_to_jsonld_converter ); |
|
| 1132 | + $that->jsonld_service = new Wordlift_Jsonld_Service( Wordlift_Entity_Service::get_instance(), $that->cached_postid_to_jsonld_converter, $that->jsonld_website_converter, $term_jsonld_adapter ); |
|
| 1133 | + |
|
| 1134 | + $jsonld_service = new Jsonld_Service( |
|
| 1135 | + $that->jsonld_service, |
|
| 1136 | + $term_jsonld_adapter, |
|
| 1137 | + new Jsonld_User_Service( $that->user_service ) ); |
|
| 1138 | + new Jsonld_Endpoint( $jsonld_service, $that->entity_uri_service ); |
|
| 1139 | + |
|
| 1140 | + // Prints the JSON-LD in the head. |
|
| 1141 | + new Jsonld_Adapter( $that->jsonld_service ); |
|
| 1142 | + |
|
| 1143 | + new Jsonld_By_Id_Endpoint( $that->jsonld_service, $that->entity_uri_service ); |
|
| 1144 | + |
|
| 1145 | + $that->key_validation_service = new Wordlift_Key_Validation_Service(); |
|
| 1146 | + $that->content_filter_service = Wordlift_Content_Filter_Service::get_instance(); |
|
| 1147 | + // Creating Faq Content filter service. |
|
| 1148 | + $that->faq_content_filter_service = new Faq_Content_Filter(); |
|
| 1149 | + $that->sample_data_service = Wordlift_Sample_Data_Service::get_instance(); |
|
| 1150 | + $that->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $that->sample_data_service ); |
|
| 1151 | + |
|
| 1152 | + $that->loader->add_action( 'enqueue_block_editor_assets', $that, 'add_wl_enabled_blocks' ); |
|
| 1153 | + $that->loader->add_action( 'admin_enqueue_scripts', $that, 'add_wl_enabled_blocks' ); |
|
| 1154 | + |
|
| 1155 | + /** |
|
| 1156 | + * Filter: wl_feature__enable__blocks. |
|
| 1157 | + * |
|
| 1158 | + * @param bool whether the blocks needed to be registered, defaults to true. |
|
| 1159 | + * |
|
| 1160 | + * @return bool |
|
| 1161 | + * @since 3.27.6 |
|
| 1162 | + */ |
|
| 1163 | + if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 1164 | + // Initialize the short-codes. |
|
| 1165 | + new Async_Template_Decorator( new Wordlift_Navigator_Shortcode() ); |
|
| 1166 | + new Wordlift_Chord_Shortcode(); |
|
| 1167 | + new Wordlift_Geomap_Shortcode(); |
|
| 1168 | + new Wordlift_Timeline_Shortcode(); |
|
| 1169 | + new Wordlift_Related_Entities_Cloud_Shortcode( Wordlift_Relation_Service::get_instance(), Wordlift_Entity_Service::get_instance() ); |
|
| 1170 | + new Wordlift_Vocabulary_Shortcode(); |
|
| 1171 | + new Async_Template_Decorator( new Wordlift_Faceted_Search_Shortcode() ); |
|
| 1172 | + } |
|
| 1173 | + |
|
| 1174 | + new Wordlift_Products_Navigator_Shortcode(); |
|
| 1175 | + |
|
| 1176 | + |
|
| 1177 | + // Initialize the Context Cards Service |
|
| 1178 | + $that->context_cards_service = new Wordlift_Context_Cards_Service(); |
|
| 1179 | + |
|
| 1180 | + // Initialize the SEO service. |
|
| 1181 | + new Wordlift_Seo_Service(); |
|
| 1182 | + |
|
| 1183 | + // Initialize the AMP service. |
|
| 1184 | + new Wordlift_AMP_Service( $that->jsonld_service ); |
|
| 1185 | + |
|
| 1186 | + /** Services. */ |
|
| 1187 | + $that->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
|
| 1188 | + new Wordlift_Image_Service(); |
|
| 1189 | + |
|
| 1190 | + /** Adapters. */ |
|
| 1191 | + $that->entity_type_adapter = new Wordlift_Entity_Type_Adapter( Wordlift_Entity_Type_Service::get_instance() ); |
|
| 1192 | + $that->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $that->publisher_service ); |
|
| 1193 | + $that->tinymce_adapter = new Wordlift_Tinymce_Adapter( $that ); |
|
| 1194 | + |
|
| 1195 | + /* |
|
| 1196 | 1196 | * Exclude our public js from WP-Rocket. |
| 1197 | 1197 | * |
| 1198 | 1198 | * @since 3.19.4 |
| 1199 | 1199 | * |
| 1200 | 1200 | * @see https://github.com/insideout10/wordlift-plugin/issues/842. |
| 1201 | 1201 | */ |
| 1202 | - new Wordlift_WpRocket_Adapter(); |
|
| 1202 | + new Wordlift_WpRocket_Adapter(); |
|
| 1203 | 1203 | |
| 1204 | - /** WordPress Admin UI. */ |
|
| 1204 | + /** WordPress Admin UI. */ |
|
| 1205 | 1205 | |
| 1206 | - // UI elements. |
|
| 1207 | - $that->input_element = new Wordlift_Admin_Input_Element(); |
|
| 1208 | - $that->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
|
| 1209 | - $that->select2_element = new Wordlift_Admin_Select2_Element(); |
|
| 1210 | - $that->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
|
| 1211 | - $that->country_select_element = new Wordlift_Admin_Country_Select_Element(); |
|
| 1212 | - $tabs_element = new Wordlift_Admin_Tabs_Element(); |
|
| 1213 | - $that->publisher_element = new Wordlift_Admin_Publisher_Element( $that->publisher_service, $tabs_element, $that->select2_element ); |
|
| 1214 | - $that->author_element = new Wordlift_Admin_Author_Element( $that->publisher_service, $that->select2_element ); |
|
| 1206 | + // UI elements. |
|
| 1207 | + $that->input_element = new Wordlift_Admin_Input_Element(); |
|
| 1208 | + $that->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
|
| 1209 | + $that->select2_element = new Wordlift_Admin_Select2_Element(); |
|
| 1210 | + $that->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
|
| 1211 | + $that->country_select_element = new Wordlift_Admin_Country_Select_Element(); |
|
| 1212 | + $tabs_element = new Wordlift_Admin_Tabs_Element(); |
|
| 1213 | + $that->publisher_element = new Wordlift_Admin_Publisher_Element( $that->publisher_service, $tabs_element, $that->select2_element ); |
|
| 1214 | + $that->author_element = new Wordlift_Admin_Author_Element( $that->publisher_service, $that->select2_element ); |
|
| 1215 | 1215 | |
| 1216 | - $that->settings_page = Wordlift_Admin_Settings_Page::get_instance(); |
|
| 1217 | - $that->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $that->settings_page ); |
|
| 1216 | + $that->settings_page = Wordlift_Admin_Settings_Page::get_instance(); |
|
| 1217 | + $that->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $that->settings_page ); |
|
| 1218 | 1218 | |
| 1219 | - $that->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page( $that->input_element, $that->radio_input_element ); |
|
| 1220 | - $that->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $that->analytics_settings_page ); |
|
| 1221 | - $that->analytics_connect = new Wordlift_Analytics_Connect(); |
|
| 1219 | + $that->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page( $that->input_element, $that->radio_input_element ); |
|
| 1220 | + $that->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $that->analytics_settings_page ); |
|
| 1221 | + $that->analytics_connect = new Wordlift_Analytics_Connect(); |
|
| 1222 | 1222 | |
| 1223 | - // Pages. |
|
| 1224 | - /* |
|
| 1223 | + // Pages. |
|
| 1224 | + /* |
|
| 1225 | 1225 | * Call the `wl_can_see_classification_box` filter to determine whether we can display the classification box. |
| 1226 | 1226 | * |
| 1227 | 1227 | * @since 3.20.3 |
| 1228 | 1228 | * |
| 1229 | 1229 | * @see https://github.com/insideout10/wordlift-plugin/issues/914 |
| 1230 | 1230 | */ |
| 1231 | - if ( apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 1232 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1233 | - new Wordlift_Admin_Post_Edit_Page( $that ); |
|
| 1234 | - } |
|
| 1235 | - new Wordlift_Entity_Type_Admin_Service(); |
|
| 1231 | + if ( apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 1232 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1233 | + new Wordlift_Admin_Post_Edit_Page( $that ); |
|
| 1234 | + } |
|
| 1235 | + new Wordlift_Entity_Type_Admin_Service(); |
|
| 1236 | 1236 | |
| 1237 | - /** Widgets */ |
|
| 1238 | - $that->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
|
| 1237 | + /** Widgets */ |
|
| 1238 | + $that->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
|
| 1239 | 1239 | |
| 1240 | - // Create an instance of the install wizard. |
|
| 1241 | - $that->admin_setup = new Wordlift_Admin_Setup( $that->key_validation_service, Wordlift_Entity_Service::get_instance(), $that->language_select_element, $that->country_select_element ); |
|
| 1240 | + // Create an instance of the install wizard. |
|
| 1241 | + $that->admin_setup = new Wordlift_Admin_Setup( $that->key_validation_service, Wordlift_Entity_Service::get_instance(), $that->language_select_element, $that->country_select_element ); |
|
| 1242 | 1242 | |
| 1243 | - $that->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $that->entity_post_type_service ); |
|
| 1243 | + $that->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $that->entity_post_type_service ); |
|
| 1244 | 1244 | |
| 1245 | - // User Profile. |
|
| 1246 | - new Wordlift_Admin_User_Profile_Page( $that->author_element, $that->user_service ); |
|
| 1245 | + // User Profile. |
|
| 1246 | + new Wordlift_Admin_User_Profile_Page( $that->author_element, $that->user_service ); |
|
| 1247 | 1247 | |
| 1248 | - $that->entity_page_service = new Wordlift_Entity_Page_Service(); |
|
| 1248 | + $that->entity_page_service = new Wordlift_Entity_Page_Service(); |
|
| 1249 | 1249 | |
| 1250 | - // Load the debug service if WP is in debug mode. |
|
| 1251 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1252 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1253 | - new Wordlift_Debug_Service( Wordlift_Entity_Service::get_instance(), $uri_service ); |
|
| 1254 | - } |
|
| 1250 | + // Load the debug service if WP is in debug mode. |
|
| 1251 | + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1252 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1253 | + new Wordlift_Debug_Service( Wordlift_Entity_Service::get_instance(), $uri_service ); |
|
| 1254 | + } |
|
| 1255 | 1255 | |
| 1256 | - // Remote Image Service. |
|
| 1257 | - new Wordlift_Remote_Image_Service(); |
|
| 1256 | + // Remote Image Service. |
|
| 1257 | + new Wordlift_Remote_Image_Service(); |
|
| 1258 | 1258 | |
| 1259 | - /* |
|
| 1259 | + /* |
|
| 1260 | 1260 | * Provides mappings between post types and entity types. |
| 1261 | 1261 | * |
| 1262 | 1262 | * @since 3.20.0 |
| 1263 | 1263 | * |
| 1264 | 1264 | * @see https://github.com/insideout10/wordlift-plugin/issues/852. |
| 1265 | 1265 | */ |
| 1266 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php'; |
|
| 1267 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1268 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1266 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php'; |
|
| 1267 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1268 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1269 | 1269 | |
| 1270 | - // Create an instance of the Mapping Service and assign it to the Ajax Adapter. |
|
| 1271 | - new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) ); |
|
| 1270 | + // Create an instance of the Mapping Service and assign it to the Ajax Adapter. |
|
| 1271 | + new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) ); |
|
| 1272 | 1272 | |
| 1273 | - /* |
|
| 1273 | + /* |
|
| 1274 | 1274 | * Load the Mappings JSON-LD post processing. |
| 1275 | 1275 | * |
| 1276 | 1276 | * @since 3.25.0 |
| 1277 | 1277 | */ |
| 1278 | 1278 | |
| 1279 | - $mappings_dbo = new Mappings_DBO(); |
|
| 1280 | - $default_rule_validator = new Taxonomy_Rule_Validator(); |
|
| 1281 | - new Post_Type_Rule_Validator(); |
|
| 1282 | - // Taxonomy term rule validator for validating rules for term pages. |
|
| 1283 | - new Taxonomy_Term_Rule_Validator(); |
|
| 1284 | - new Post_Taxonomy_Term_Rule_Validator(); |
|
| 1285 | - $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator ); |
|
| 1286 | - $rule_groups_validator = new Rule_Groups_Validator( $rule_validators_registry ); |
|
| 1287 | - $mappings_validator = new Mappings_Validator( $mappings_dbo, $rule_groups_validator ); |
|
| 1288 | - |
|
| 1289 | - new Url_To_Entity_Transform_Function( $that->entity_uri_service ); |
|
| 1290 | - new Taxonomy_To_Terms_Transform_Function(); |
|
| 1291 | - new Post_Id_To_Entity_Transform_Function(); |
|
| 1292 | - $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry(); |
|
| 1293 | - |
|
| 1294 | - /** |
|
| 1295 | - * @since 3.27.1 |
|
| 1296 | - * Intiailize the acf group data formatter. |
|
| 1297 | - */ |
|
| 1298 | - new Acf_Group_Formatter(); |
|
| 1299 | - new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry ); |
|
| 1300 | - |
|
| 1301 | - /** |
|
| 1302 | - * @since 3.26.0 |
|
| 1303 | - * Initialize the Faq JSON LD converter here - disabled. |
|
| 1304 | - */ |
|
| 1305 | - // new Faq_To_Jsonld_Converter(); |
|
| 1306 | - /* |
|
| 1279 | + $mappings_dbo = new Mappings_DBO(); |
|
| 1280 | + $default_rule_validator = new Taxonomy_Rule_Validator(); |
|
| 1281 | + new Post_Type_Rule_Validator(); |
|
| 1282 | + // Taxonomy term rule validator for validating rules for term pages. |
|
| 1283 | + new Taxonomy_Term_Rule_Validator(); |
|
| 1284 | + new Post_Taxonomy_Term_Rule_Validator(); |
|
| 1285 | + $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator ); |
|
| 1286 | + $rule_groups_validator = new Rule_Groups_Validator( $rule_validators_registry ); |
|
| 1287 | + $mappings_validator = new Mappings_Validator( $mappings_dbo, $rule_groups_validator ); |
|
| 1288 | + |
|
| 1289 | + new Url_To_Entity_Transform_Function( $that->entity_uri_service ); |
|
| 1290 | + new Taxonomy_To_Terms_Transform_Function(); |
|
| 1291 | + new Post_Id_To_Entity_Transform_Function(); |
|
| 1292 | + $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry(); |
|
| 1293 | + |
|
| 1294 | + /** |
|
| 1295 | + * @since 3.27.1 |
|
| 1296 | + * Intiailize the acf group data formatter. |
|
| 1297 | + */ |
|
| 1298 | + new Acf_Group_Formatter(); |
|
| 1299 | + new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry ); |
|
| 1300 | + |
|
| 1301 | + /** |
|
| 1302 | + * @since 3.26.0 |
|
| 1303 | + * Initialize the Faq JSON LD converter here - disabled. |
|
| 1304 | + */ |
|
| 1305 | + // new Faq_To_Jsonld_Converter(); |
|
| 1306 | + /* |
|
| 1307 | 1307 | * Use the Templates Ajax Endpoint to load HTML templates for the legacy Angular app via admin-ajax.php |
| 1308 | 1308 | * end-point. |
| 1309 | 1309 | * |
| 1310 | 1310 | * @see https://github.com/insideout10/wordlift-plugin/issues/834 |
| 1311 | 1311 | * @since 3.24.4 |
| 1312 | 1312 | */ |
| 1313 | - new Templates_Ajax_Endpoint(); |
|
| 1314 | - // Call this static method to register FAQ routes to rest api - disabled |
|
| 1315 | - //Faq_Rest_Controller::register_routes(); |
|
| 1316 | - |
|
| 1317 | - $that->storage_factory = new Wordlift_Storage_Factory( Wordlift_Entity_Service::get_instance(), $that->user_service, $property_getter ); |
|
| 1318 | - |
|
| 1319 | - /** WL Autocomplete. */ |
|
| 1320 | - $autocomplete_service = new All_Autocomplete_Service( array( |
|
| 1321 | - new Local_Autocomplete_Service(), |
|
| 1322 | - new Linked_Data_Autocomplete_Service( Entity_Helper::get_instance(), $that->entity_uri_service, Wordlift_Entity_Service::get_instance() ), |
|
| 1323 | - ) ); |
|
| 1324 | - $that->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service ); |
|
| 1325 | - |
|
| 1326 | - /** |
|
| 1327 | - * @since 3.27.2 |
|
| 1328 | - * Integrate the recipe maker jsonld & set recipe |
|
| 1329 | - * as default entity type to the wprm_recipe CPT. |
|
| 1330 | - */ |
|
| 1331 | - new Recipe_Maker_Post_Type_Hook(); |
|
| 1332 | - $recipe_maker_validation_service = Recipe_Maker_Validation_Service::get_instance(); |
|
| 1333 | - new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service ); |
|
| 1334 | - new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service ); |
|
| 1335 | - new Recipe_Maker_Jsonld_Swap( $recipe_maker_validation_service, $that->jsonld_service ); |
|
| 1336 | - new Recipe_Maker_Warning( $recipe_maker_validation_service ); |
|
| 1337 | - new Yoast_Jsonld( $recipe_maker_validation_service ); |
|
| 1338 | - |
|
| 1339 | - /** |
|
| 1340 | - * @since 3.27.4 |
|
| 1341 | - * Add the faq duplicate markup hook. |
|
| 1342 | - */ |
|
| 1343 | - new Faq_Duplicate_Markup_Remover(); |
|
| 1344 | - /** |
|
| 1345 | - * @since 3.33.1 |
|
| 1346 | - * Remove the duplicate HowTo Markup. |
|
| 1347 | - */ |
|
| 1348 | - new How_To_Duplicate_Markup_Remover(); |
|
| 1349 | - |
|
| 1350 | - /** |
|
| 1351 | - * @since 3.27.8 |
|
| 1352 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1248 |
|
| 1353 | - */ |
|
| 1354 | - new Key_Validation_Notice( $that->key_validation_service, Wordlift_Configuration_Service::get_instance() ); |
|
| 1355 | - /** |
|
| 1356 | - * @since 3.28.0 |
|
| 1357 | - * @see https://github.com/insideout10/wordlift-plugin/issues?q=assignee%3Anaveen17797+is%3Aopen |
|
| 1358 | - */ |
|
| 1359 | - new Entity_No_Index_Flag(); |
|
| 1360 | - |
|
| 1361 | - /** |
|
| 1362 | - * @since 3.29.0 |
|
| 1363 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1304 |
|
| 1364 | - */ |
|
| 1365 | - new Entity_Rest_Service( Wordlift_Entity_Type_Service::get_instance() ); |
|
| 1366 | - |
|
| 1367 | - /** |
|
| 1368 | - * Expand author in to references. |
|
| 1369 | - * @since 3.30.0 |
|
| 1370 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1318 |
|
| 1371 | - */ |
|
| 1372 | - |
|
| 1373 | - |
|
| 1374 | - if ( apply_filters( 'wl_feature__enable__article-wrapper', false ) ) { |
|
| 1375 | - new Jsonld_Article_Wrapper( Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter ); |
|
| 1376 | - } |
|
| 1377 | - |
|
| 1378 | - |
|
| 1379 | - if ( apply_filters( 'wl_feature__enable__match-terms', false ) ) { |
|
| 1380 | - $vocabulary_loader = new Vocabulary_Loader(); |
|
| 1381 | - $vocabulary_loader->init_vocabulary(); |
|
| 1382 | - } |
|
| 1383 | - |
|
| 1384 | - /** |
|
| 1385 | - *Added for feature request 1496 (Webhooks) |
|
| 1386 | - */ |
|
| 1387 | - if ( apply_filters( 'wl_feature__enable__webhooks', false ) ) { |
|
| 1388 | - $that->webhook_loader = new Webhooks_Loader(); |
|
| 1389 | - $that->webhook_loader->init(); |
|
| 1390 | - } |
|
| 1391 | - |
|
| 1392 | - /** |
|
| 1393 | - * @since 3.30.0 |
|
| 1394 | - * Add a checkbox to user option screen for wordlift admin. |
|
| 1395 | - */ |
|
| 1396 | - $wordlift_admin_checkbox = new Admin_User_Option(); |
|
| 1397 | - $wordlift_admin_checkbox->connect_hook(); |
|
| 1398 | - |
|
| 1399 | - /** |
|
| 1400 | - * @since 3.31.0 |
|
| 1401 | - * Init loader class for videoobject. |
|
| 1402 | - */ |
|
| 1403 | - $videoobject_loader = new Loader(); |
|
| 1404 | - $videoobject_loader->init_feature(); |
|
| 1405 | - |
|
| 1406 | - /** |
|
| 1407 | - * @since 3.35.0 |
|
| 1408 | - */ |
|
| 1409 | - $google_addon_integration_loader = new \Wordlift\Google_Addon_Integration\Loader(); |
|
| 1410 | - $google_addon_integration_loader->init_feature(); |
|
| 1411 | - |
|
| 1412 | - /** |
|
| 1413 | - * @since 3.31.5 |
|
| 1414 | - * Create configuration endpoint for webapp to configure. |
|
| 1415 | - */ |
|
| 1416 | - new Config( $that->admin_setup, $that->key_validation_service ); |
|
| 1417 | - /** |
|
| 1418 | - * @since 3.31.7 |
|
| 1419 | - * Remove duplicate videoobject. |
|
| 1420 | - */ |
|
| 1421 | - new Videoobject_Duplicate_Remover(); |
|
| 1422 | - $synonym_loader = new \Wordlift\Synonym\Loader(); |
|
| 1423 | - $synonym_loader->init_feature(); |
|
| 1424 | - /** |
|
| 1425 | - * @since 3.32.0 |
|
| 1426 | - * Create loader for vocabulary terms. |
|
| 1427 | - */ |
|
| 1428 | - $vocabulary_terms_loader = new Vocabulary_Terms_Loader( Wordlift_Entity_Type_Service::get_instance(), $property_getter ); |
|
| 1429 | - $vocabulary_terms_loader->init_feature(); |
|
| 1430 | - |
|
| 1431 | - new Entity_Type_Change_Handler( |
|
| 1432 | - Wordlift_Entity_Service::get_instance(), |
|
| 1433 | - Wordlift_Entity_Type_Service::get_instance() |
|
| 1434 | - ); |
|
| 1435 | - |
|
| 1436 | - }, 3 ); |
|
| 1437 | - |
|
| 1438 | - |
|
| 1439 | - new Entity_Type_Setter(); |
|
| 1440 | - $no_editor_analysis_loader = new \Wordlift\No_Editor_Analysis\Loader(); |
|
| 1441 | - $no_editor_analysis_loader->init_feature(); |
|
| 1442 | - } |
|
| 1443 | - |
|
| 1444 | - /** |
|
| 1445 | - * Define the locale for this plugin for internationalization. |
|
| 1446 | - * |
|
| 1447 | - * Uses the Wordlift_i18n class in order to set the domain and to register the hook |
|
| 1448 | - * with WordPress. |
|
| 1449 | - * |
|
| 1450 | - * @since 1.0.0 |
|
| 1451 | - * @access private |
|
| 1452 | - */ |
|
| 1453 | - private function set_locale() { |
|
| 1454 | - |
|
| 1455 | - $plugin_i18n = new Wordlift_i18n(); |
|
| 1456 | - $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1457 | - |
|
| 1458 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1459 | - |
|
| 1460 | - } |
|
| 1461 | - |
|
| 1462 | - /** |
|
| 1463 | - * Register all of the hooks related to the admin area functionality |
|
| 1464 | - * of the plugin. |
|
| 1465 | - * |
|
| 1466 | - * @since 1.0.0 |
|
| 1467 | - * @access private |
|
| 1468 | - */ |
|
| 1469 | - private function define_admin_hooks( $that ) { |
|
| 1470 | - $plugin_admin = new |
|
| 1471 | - Wordlift_Admin( |
|
| 1472 | - $that->get_plugin_name(), |
|
| 1473 | - $that->get_version(), |
|
| 1474 | - $that->notice_service, |
|
| 1475 | - $that->user_service |
|
| 1476 | - ); |
|
| 1477 | - |
|
| 1478 | - $that->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1479 | - $that->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 ); |
|
| 1480 | - |
|
| 1481 | - // Hook the `admin_init` function to the Admin Setup. |
|
| 1482 | - Assertions::is_set( $that->admin_setup, '`admin_setup` must be set' ); |
|
| 1483 | - $that->loader->add_action( 'admin_init', $that->admin_setup, 'admin_init' ); |
|
| 1484 | - |
|
| 1485 | - // Hook the admin_init to the settings page. |
|
| 1486 | - Assertions::is_set( $that->settings_page, '`setting_page` must be set' ); |
|
| 1487 | - $that->loader->add_action( 'admin_init', $that->settings_page, 'admin_init' ); |
|
| 1488 | - |
|
| 1489 | - // Hook the admin_init to the analytics settings page. |
|
| 1490 | - Assertions::is_set( $that->analytics_settings_page, '`analytics_setting_page` must be set' ); |
|
| 1491 | - $that->loader->add_action( 'admin_init', $that->analytics_settings_page, 'admin_init' ); |
|
| 1492 | - |
|
| 1493 | - // Hook the init action to taxonomy services. |
|
| 1494 | - $that->loader->add_action( 'init', $that->topic_taxonomy_service, 'init', 0 ); |
|
| 1495 | - $that->loader->add_action( 'init', $that->entity_types_taxonomy_service, 'init', 0 ); |
|
| 1496 | - |
|
| 1497 | - // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1498 | - $that->loader->add_action( 'wp_ajax_wl_timeline', $that->timeline_service, 'ajax_timeline' ); |
|
| 1499 | - |
|
| 1500 | - // Register custom allowed redirect hosts. |
|
| 1501 | - $that->loader->add_filter( 'allowed_redirect_hosts', $that->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1502 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1503 | - $that->loader->add_action( 'wp_ajax_wordlift_redirect', $that->redirect_service, 'ajax_redirect' ); |
|
| 1504 | - |
|
| 1505 | - // Hook save_post to the entity service to update custom fields (such as alternate labels). |
|
| 1506 | - // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
|
| 1507 | - $that->loader->add_action( 'save_post', Wordlift_Entity_Service::get_instance(), 'save_post', 9, 3 ); |
|
| 1508 | - $that->loader->add_action( 'save_post', $that->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1509 | - |
|
| 1510 | - $that->loader->add_action( 'edit_form_before_permalink', Wordlift_Entity_Service::get_instance(), 'edit_form_before_permalink', 10, 1 ); |
|
| 1511 | - $that->loader->add_action( 'in_admin_header', $that->rating_service, 'in_admin_header' ); |
|
| 1512 | - |
|
| 1513 | - // Entity listing customization (wp-admin/edit.php) |
|
| 1514 | - // Add custom columns. |
|
| 1515 | - $that->loader->add_filter( 'manage_entity_posts_columns', $that->entity_list_service, 'register_custom_columns' ); |
|
| 1516 | - // no explicit entity as it prevents handling of other post types. |
|
| 1517 | - $that->loader->add_filter( 'manage_posts_custom_column', $that->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1518 | - // Add 4W selection. |
|
| 1519 | - $that->loader->add_action( 'restrict_manage_posts', $that->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1520 | - $that->loader->add_filter( 'posts_clauses', $that->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1521 | - $that->loader->add_action( 'pre_get_posts', $that->entity_list_service, 'pre_get_posts' ); |
|
| 1522 | - $that->loader->add_action( 'load-edit.php', $that->entity_list_service, 'load_edit' ); |
|
| 1523 | - |
|
| 1524 | - /* |
|
| 1313 | + new Templates_Ajax_Endpoint(); |
|
| 1314 | + // Call this static method to register FAQ routes to rest api - disabled |
|
| 1315 | + //Faq_Rest_Controller::register_routes(); |
|
| 1316 | + |
|
| 1317 | + $that->storage_factory = new Wordlift_Storage_Factory( Wordlift_Entity_Service::get_instance(), $that->user_service, $property_getter ); |
|
| 1318 | + |
|
| 1319 | + /** WL Autocomplete. */ |
|
| 1320 | + $autocomplete_service = new All_Autocomplete_Service( array( |
|
| 1321 | + new Local_Autocomplete_Service(), |
|
| 1322 | + new Linked_Data_Autocomplete_Service( Entity_Helper::get_instance(), $that->entity_uri_service, Wordlift_Entity_Service::get_instance() ), |
|
| 1323 | + ) ); |
|
| 1324 | + $that->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service ); |
|
| 1325 | + |
|
| 1326 | + /** |
|
| 1327 | + * @since 3.27.2 |
|
| 1328 | + * Integrate the recipe maker jsonld & set recipe |
|
| 1329 | + * as default entity type to the wprm_recipe CPT. |
|
| 1330 | + */ |
|
| 1331 | + new Recipe_Maker_Post_Type_Hook(); |
|
| 1332 | + $recipe_maker_validation_service = Recipe_Maker_Validation_Service::get_instance(); |
|
| 1333 | + new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service ); |
|
| 1334 | + new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service ); |
|
| 1335 | + new Recipe_Maker_Jsonld_Swap( $recipe_maker_validation_service, $that->jsonld_service ); |
|
| 1336 | + new Recipe_Maker_Warning( $recipe_maker_validation_service ); |
|
| 1337 | + new Yoast_Jsonld( $recipe_maker_validation_service ); |
|
| 1338 | + |
|
| 1339 | + /** |
|
| 1340 | + * @since 3.27.4 |
|
| 1341 | + * Add the faq duplicate markup hook. |
|
| 1342 | + */ |
|
| 1343 | + new Faq_Duplicate_Markup_Remover(); |
|
| 1344 | + /** |
|
| 1345 | + * @since 3.33.1 |
|
| 1346 | + * Remove the duplicate HowTo Markup. |
|
| 1347 | + */ |
|
| 1348 | + new How_To_Duplicate_Markup_Remover(); |
|
| 1349 | + |
|
| 1350 | + /** |
|
| 1351 | + * @since 3.27.8 |
|
| 1352 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1248 |
|
| 1353 | + */ |
|
| 1354 | + new Key_Validation_Notice( $that->key_validation_service, Wordlift_Configuration_Service::get_instance() ); |
|
| 1355 | + /** |
|
| 1356 | + * @since 3.28.0 |
|
| 1357 | + * @see https://github.com/insideout10/wordlift-plugin/issues?q=assignee%3Anaveen17797+is%3Aopen |
|
| 1358 | + */ |
|
| 1359 | + new Entity_No_Index_Flag(); |
|
| 1360 | + |
|
| 1361 | + /** |
|
| 1362 | + * @since 3.29.0 |
|
| 1363 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1304 |
|
| 1364 | + */ |
|
| 1365 | + new Entity_Rest_Service( Wordlift_Entity_Type_Service::get_instance() ); |
|
| 1366 | + |
|
| 1367 | + /** |
|
| 1368 | + * Expand author in to references. |
|
| 1369 | + * @since 3.30.0 |
|
| 1370 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1318 |
|
| 1371 | + */ |
|
| 1372 | + |
|
| 1373 | + |
|
| 1374 | + if ( apply_filters( 'wl_feature__enable__article-wrapper', false ) ) { |
|
| 1375 | + new Jsonld_Article_Wrapper( Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter ); |
|
| 1376 | + } |
|
| 1377 | + |
|
| 1378 | + |
|
| 1379 | + if ( apply_filters( 'wl_feature__enable__match-terms', false ) ) { |
|
| 1380 | + $vocabulary_loader = new Vocabulary_Loader(); |
|
| 1381 | + $vocabulary_loader->init_vocabulary(); |
|
| 1382 | + } |
|
| 1383 | + |
|
| 1384 | + /** |
|
| 1385 | + *Added for feature request 1496 (Webhooks) |
|
| 1386 | + */ |
|
| 1387 | + if ( apply_filters( 'wl_feature__enable__webhooks', false ) ) { |
|
| 1388 | + $that->webhook_loader = new Webhooks_Loader(); |
|
| 1389 | + $that->webhook_loader->init(); |
|
| 1390 | + } |
|
| 1391 | + |
|
| 1392 | + /** |
|
| 1393 | + * @since 3.30.0 |
|
| 1394 | + * Add a checkbox to user option screen for wordlift admin. |
|
| 1395 | + */ |
|
| 1396 | + $wordlift_admin_checkbox = new Admin_User_Option(); |
|
| 1397 | + $wordlift_admin_checkbox->connect_hook(); |
|
| 1398 | + |
|
| 1399 | + /** |
|
| 1400 | + * @since 3.31.0 |
|
| 1401 | + * Init loader class for videoobject. |
|
| 1402 | + */ |
|
| 1403 | + $videoobject_loader = new Loader(); |
|
| 1404 | + $videoobject_loader->init_feature(); |
|
| 1405 | + |
|
| 1406 | + /** |
|
| 1407 | + * @since 3.35.0 |
|
| 1408 | + */ |
|
| 1409 | + $google_addon_integration_loader = new \Wordlift\Google_Addon_Integration\Loader(); |
|
| 1410 | + $google_addon_integration_loader->init_feature(); |
|
| 1411 | + |
|
| 1412 | + /** |
|
| 1413 | + * @since 3.31.5 |
|
| 1414 | + * Create configuration endpoint for webapp to configure. |
|
| 1415 | + */ |
|
| 1416 | + new Config( $that->admin_setup, $that->key_validation_service ); |
|
| 1417 | + /** |
|
| 1418 | + * @since 3.31.7 |
|
| 1419 | + * Remove duplicate videoobject. |
|
| 1420 | + */ |
|
| 1421 | + new Videoobject_Duplicate_Remover(); |
|
| 1422 | + $synonym_loader = new \Wordlift\Synonym\Loader(); |
|
| 1423 | + $synonym_loader->init_feature(); |
|
| 1424 | + /** |
|
| 1425 | + * @since 3.32.0 |
|
| 1426 | + * Create loader for vocabulary terms. |
|
| 1427 | + */ |
|
| 1428 | + $vocabulary_terms_loader = new Vocabulary_Terms_Loader( Wordlift_Entity_Type_Service::get_instance(), $property_getter ); |
|
| 1429 | + $vocabulary_terms_loader->init_feature(); |
|
| 1430 | + |
|
| 1431 | + new Entity_Type_Change_Handler( |
|
| 1432 | + Wordlift_Entity_Service::get_instance(), |
|
| 1433 | + Wordlift_Entity_Type_Service::get_instance() |
|
| 1434 | + ); |
|
| 1435 | + |
|
| 1436 | + }, 3 ); |
|
| 1437 | + |
|
| 1438 | + |
|
| 1439 | + new Entity_Type_Setter(); |
|
| 1440 | + $no_editor_analysis_loader = new \Wordlift\No_Editor_Analysis\Loader(); |
|
| 1441 | + $no_editor_analysis_loader->init_feature(); |
|
| 1442 | + } |
|
| 1443 | + |
|
| 1444 | + /** |
|
| 1445 | + * Define the locale for this plugin for internationalization. |
|
| 1446 | + * |
|
| 1447 | + * Uses the Wordlift_i18n class in order to set the domain and to register the hook |
|
| 1448 | + * with WordPress. |
|
| 1449 | + * |
|
| 1450 | + * @since 1.0.0 |
|
| 1451 | + * @access private |
|
| 1452 | + */ |
|
| 1453 | + private function set_locale() { |
|
| 1454 | + |
|
| 1455 | + $plugin_i18n = new Wordlift_i18n(); |
|
| 1456 | + $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1457 | + |
|
| 1458 | + $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1459 | + |
|
| 1460 | + } |
|
| 1461 | + |
|
| 1462 | + /** |
|
| 1463 | + * Register all of the hooks related to the admin area functionality |
|
| 1464 | + * of the plugin. |
|
| 1465 | + * |
|
| 1466 | + * @since 1.0.0 |
|
| 1467 | + * @access private |
|
| 1468 | + */ |
|
| 1469 | + private function define_admin_hooks( $that ) { |
|
| 1470 | + $plugin_admin = new |
|
| 1471 | + Wordlift_Admin( |
|
| 1472 | + $that->get_plugin_name(), |
|
| 1473 | + $that->get_version(), |
|
| 1474 | + $that->notice_service, |
|
| 1475 | + $that->user_service |
|
| 1476 | + ); |
|
| 1477 | + |
|
| 1478 | + $that->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1479 | + $that->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 ); |
|
| 1480 | + |
|
| 1481 | + // Hook the `admin_init` function to the Admin Setup. |
|
| 1482 | + Assertions::is_set( $that->admin_setup, '`admin_setup` must be set' ); |
|
| 1483 | + $that->loader->add_action( 'admin_init', $that->admin_setup, 'admin_init' ); |
|
| 1484 | + |
|
| 1485 | + // Hook the admin_init to the settings page. |
|
| 1486 | + Assertions::is_set( $that->settings_page, '`setting_page` must be set' ); |
|
| 1487 | + $that->loader->add_action( 'admin_init', $that->settings_page, 'admin_init' ); |
|
| 1488 | + |
|
| 1489 | + // Hook the admin_init to the analytics settings page. |
|
| 1490 | + Assertions::is_set( $that->analytics_settings_page, '`analytics_setting_page` must be set' ); |
|
| 1491 | + $that->loader->add_action( 'admin_init', $that->analytics_settings_page, 'admin_init' ); |
|
| 1492 | + |
|
| 1493 | + // Hook the init action to taxonomy services. |
|
| 1494 | + $that->loader->add_action( 'init', $that->topic_taxonomy_service, 'init', 0 ); |
|
| 1495 | + $that->loader->add_action( 'init', $that->entity_types_taxonomy_service, 'init', 0 ); |
|
| 1496 | + |
|
| 1497 | + // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1498 | + $that->loader->add_action( 'wp_ajax_wl_timeline', $that->timeline_service, 'ajax_timeline' ); |
|
| 1499 | + |
|
| 1500 | + // Register custom allowed redirect hosts. |
|
| 1501 | + $that->loader->add_filter( 'allowed_redirect_hosts', $that->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1502 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1503 | + $that->loader->add_action( 'wp_ajax_wordlift_redirect', $that->redirect_service, 'ajax_redirect' ); |
|
| 1504 | + |
|
| 1505 | + // Hook save_post to the entity service to update custom fields (such as alternate labels). |
|
| 1506 | + // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
|
| 1507 | + $that->loader->add_action( 'save_post', Wordlift_Entity_Service::get_instance(), 'save_post', 9, 3 ); |
|
| 1508 | + $that->loader->add_action( 'save_post', $that->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1509 | + |
|
| 1510 | + $that->loader->add_action( 'edit_form_before_permalink', Wordlift_Entity_Service::get_instance(), 'edit_form_before_permalink', 10, 1 ); |
|
| 1511 | + $that->loader->add_action( 'in_admin_header', $that->rating_service, 'in_admin_header' ); |
|
| 1512 | + |
|
| 1513 | + // Entity listing customization (wp-admin/edit.php) |
|
| 1514 | + // Add custom columns. |
|
| 1515 | + $that->loader->add_filter( 'manage_entity_posts_columns', $that->entity_list_service, 'register_custom_columns' ); |
|
| 1516 | + // no explicit entity as it prevents handling of other post types. |
|
| 1517 | + $that->loader->add_filter( 'manage_posts_custom_column', $that->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1518 | + // Add 4W selection. |
|
| 1519 | + $that->loader->add_action( 'restrict_manage_posts', $that->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1520 | + $that->loader->add_filter( 'posts_clauses', $that->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1521 | + $that->loader->add_action( 'pre_get_posts', $that->entity_list_service, 'pre_get_posts' ); |
|
| 1522 | + $that->loader->add_action( 'load-edit.php', $that->entity_list_service, 'load_edit' ); |
|
| 1523 | + |
|
| 1524 | + /* |
|
| 1525 | 1525 | * If `All Entity Types` is disable, use the radio button Walker. |
| 1526 | 1526 | * |
| 1527 | 1527 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1528 | 1528 | */ |
| 1529 | - if ( ! WL_ALL_ENTITY_TYPES ) { |
|
| 1530 | - $that->loader->add_filter( 'wp_terms_checklist_args', $that->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1531 | - } |
|
| 1532 | - |
|
| 1533 | - // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
|
| 1534 | - // entities. |
|
| 1535 | - $that->loader->add_filter( 'prima_metabox_entity_header_args', $that->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1536 | - |
|
| 1537 | - /** |
|
| 1538 | - * Filter: wl_feature__enable__settings-download. |
|
| 1539 | - * |
|
| 1540 | - * @param bool whether the screens needed to be registered, defaults to true. |
|
| 1541 | - * |
|
| 1542 | - * @return bool |
|
| 1543 | - * @since 3.27.6 |
|
| 1544 | - */ |
|
| 1545 | - $that->features_registry->register_feature_from_slug( 'settings-download', true, array( |
|
| 1546 | - $that, |
|
| 1547 | - 'register_screens' |
|
| 1548 | - ) ); |
|
| 1549 | - |
|
| 1550 | - |
|
| 1551 | - // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
|
| 1552 | - $that->loader->add_action( 'wp_ajax_wl_download_your_data', $that->download_your_data_page, 'download_your_data', 10 ); |
|
| 1553 | - |
|
| 1554 | - // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1555 | - $that->loader->add_action( 'wp_ajax_wl_jsonld', $that->jsonld_service, 'get' ); |
|
| 1556 | - $that->loader->add_action( 'admin_post_wl_jsonld', $that->jsonld_service, 'get' ); |
|
| 1557 | - $that->loader->add_action( 'admin_post_nopriv_wl_jsonld', $that->jsonld_service, 'get' ); |
|
| 1558 | - |
|
| 1559 | - // Hook the AJAX wl_validate_key action to the Key Validation service. |
|
| 1560 | - $that->loader->add_action( 'wp_ajax_wl_validate_key', $that->key_validation_service, 'validate_key' ); |
|
| 1561 | - |
|
| 1562 | - // Hook the AJAX wl_update_country_options action to the countries. |
|
| 1563 | - $that->loader->add_action( 'wp_ajax_wl_update_country_options', $that->country_select_element, 'get_options_html' ); |
|
| 1564 | - |
|
| 1565 | - $that->loader->add_filter( 'admin_post_thumbnail_html', $that->publisher_service, 'add_featured_image_instruction' ); |
|
| 1566 | - |
|
| 1567 | - // Hook the menu creation on the general wordlift menu creation. |
|
| 1568 | - /** |
|
| 1569 | - * Filter: wl_feature__enable__screens. |
|
| 1570 | - * |
|
| 1571 | - * @param bool whether the screens needed to be registered, defaults to true. |
|
| 1572 | - * |
|
| 1573 | - * @return bool |
|
| 1574 | - * @since 3.27.6 |
|
| 1575 | - * |
|
| 1576 | - * Since 3.30.0 this feature is registered using registry. |
|
| 1577 | - */ |
|
| 1578 | - if ( apply_filters( 'wl_feature__enable__settings-screen', true ) || Admin_User_Option::is_wordlift_admin() ) { |
|
| 1579 | - add_action( 'wl_admin_menu', array( $that->settings_page, 'admin_menu' ), 10, 2 ); |
|
| 1580 | - } |
|
| 1581 | - |
|
| 1582 | - // Hook key update. |
|
| 1583 | - $that->loader->add_action( 'pre_update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1584 | - $that->loader->add_action( 'update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'update_key', 10, 2 ); |
|
| 1585 | - |
|
| 1586 | - // Add additional action links to the WordLift plugin in the plugins page. |
|
| 1587 | - $that->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $that->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1588 | - |
|
| 1589 | - /* |
|
| 1529 | + if ( ! WL_ALL_ENTITY_TYPES ) { |
|
| 1530 | + $that->loader->add_filter( 'wp_terms_checklist_args', $that->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1531 | + } |
|
| 1532 | + |
|
| 1533 | + // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
|
| 1534 | + // entities. |
|
| 1535 | + $that->loader->add_filter( 'prima_metabox_entity_header_args', $that->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1536 | + |
|
| 1537 | + /** |
|
| 1538 | + * Filter: wl_feature__enable__settings-download. |
|
| 1539 | + * |
|
| 1540 | + * @param bool whether the screens needed to be registered, defaults to true. |
|
| 1541 | + * |
|
| 1542 | + * @return bool |
|
| 1543 | + * @since 3.27.6 |
|
| 1544 | + */ |
|
| 1545 | + $that->features_registry->register_feature_from_slug( 'settings-download', true, array( |
|
| 1546 | + $that, |
|
| 1547 | + 'register_screens' |
|
| 1548 | + ) ); |
|
| 1549 | + |
|
| 1550 | + |
|
| 1551 | + // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
|
| 1552 | + $that->loader->add_action( 'wp_ajax_wl_download_your_data', $that->download_your_data_page, 'download_your_data', 10 ); |
|
| 1553 | + |
|
| 1554 | + // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1555 | + $that->loader->add_action( 'wp_ajax_wl_jsonld', $that->jsonld_service, 'get' ); |
|
| 1556 | + $that->loader->add_action( 'admin_post_wl_jsonld', $that->jsonld_service, 'get' ); |
|
| 1557 | + $that->loader->add_action( 'admin_post_nopriv_wl_jsonld', $that->jsonld_service, 'get' ); |
|
| 1558 | + |
|
| 1559 | + // Hook the AJAX wl_validate_key action to the Key Validation service. |
|
| 1560 | + $that->loader->add_action( 'wp_ajax_wl_validate_key', $that->key_validation_service, 'validate_key' ); |
|
| 1561 | + |
|
| 1562 | + // Hook the AJAX wl_update_country_options action to the countries. |
|
| 1563 | + $that->loader->add_action( 'wp_ajax_wl_update_country_options', $that->country_select_element, 'get_options_html' ); |
|
| 1564 | + |
|
| 1565 | + $that->loader->add_filter( 'admin_post_thumbnail_html', $that->publisher_service, 'add_featured_image_instruction' ); |
|
| 1566 | + |
|
| 1567 | + // Hook the menu creation on the general wordlift menu creation. |
|
| 1568 | + /** |
|
| 1569 | + * Filter: wl_feature__enable__screens. |
|
| 1570 | + * |
|
| 1571 | + * @param bool whether the screens needed to be registered, defaults to true. |
|
| 1572 | + * |
|
| 1573 | + * @return bool |
|
| 1574 | + * @since 3.27.6 |
|
| 1575 | + * |
|
| 1576 | + * Since 3.30.0 this feature is registered using registry. |
|
| 1577 | + */ |
|
| 1578 | + if ( apply_filters( 'wl_feature__enable__settings-screen', true ) || Admin_User_Option::is_wordlift_admin() ) { |
|
| 1579 | + add_action( 'wl_admin_menu', array( $that->settings_page, 'admin_menu' ), 10, 2 ); |
|
| 1580 | + } |
|
| 1581 | + |
|
| 1582 | + // Hook key update. |
|
| 1583 | + $that->loader->add_action( 'pre_update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1584 | + $that->loader->add_action( 'update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'update_key', 10, 2 ); |
|
| 1585 | + |
|
| 1586 | + // Add additional action links to the WordLift plugin in the plugins page. |
|
| 1587 | + $that->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $that->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1588 | + |
|
| 1589 | + /* |
|
| 1590 | 1590 | * Remove the Analytics Settings link from the plugin page. |
| 1591 | 1591 | * |
| 1592 | 1592 | * @see https://github.com/insideout10/wordlift-plugin/issues/932 |
| 1593 | 1593 | * @since 3.21.1 |
| 1594 | 1594 | */ |
| 1595 | - // $that->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $that->analytics_settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1596 | - |
|
| 1597 | - // Hook the AJAX `wl_publisher` action name. |
|
| 1598 | - $that->loader->add_action( 'wp_ajax_wl_publisher', $that->publisher_ajax_adapter, 'publisher' ); |
|
| 1599 | - |
|
| 1600 | - // Hook row actions for the entity type list admin. |
|
| 1601 | - $that->loader->add_filter( 'wl_entity_type_row_actions', $that->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1602 | - |
|
| 1603 | - /** Ajax actions. */ |
|
| 1604 | - $that->loader->add_action( 'wp_ajax_wl_google_analytics_export', $that->google_analytics_export_service, 'export' ); |
|
| 1605 | - |
|
| 1606 | - // Hook capabilities manipulation to allow access to entity type admin |
|
| 1607 | - // page on WordPress versions before 4.7. |
|
| 1608 | - global $wp_version; |
|
| 1609 | - if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1610 | - $that->loader->add_filter( 'map_meta_cap', $that->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1611 | - } |
|
| 1612 | - |
|
| 1613 | - /** Adapters. */ |
|
| 1614 | - $that->loader->add_filter( 'mce_external_plugins', $that->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1615 | - /** |
|
| 1616 | - * Disabling Faq temporarily. |
|
| 1617 | - * Load the tinymce editor button on the tool bar. |
|
| 1618 | - * @since 3.26.0 |
|
| 1619 | - */ |
|
| 1620 | - //$that->loader->add_filter( 'tiny_mce_before_init', $that->faq_tinymce_adapter, 'register_custom_tags' ); |
|
| 1621 | - //$that->loader->add_filter( 'mce_buttons', $that->faq_tinymce_adapter, 'register_faq_toolbar_button', 10, 1 ); |
|
| 1622 | - //$that->loader->add_filter( 'mce_external_plugins', $that->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 ); |
|
| 1623 | - |
|
| 1624 | - |
|
| 1625 | - $that->loader->add_action( 'wp_ajax_wl_sample_data_create', $that->sample_data_ajax_adapter, 'create' ); |
|
| 1626 | - $that->loader->add_action( 'wp_ajax_wl_sample_data_delete', $that->sample_data_ajax_adapter, 'delete' ); |
|
| 1627 | - |
|
| 1628 | - /** |
|
| 1629 | - * @since 3.26.0 |
|
| 1630 | - */ |
|
| 1631 | - $excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter(); |
|
| 1632 | - $that->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' ); |
|
| 1633 | - // Adding Rest route for the post excerpt |
|
| 1634 | - Post_Excerpt_Rest_Controller::register_routes(); |
|
| 1635 | - |
|
| 1636 | - // Handle the autocomplete request. |
|
| 1637 | - add_action( 'wp_ajax_wl_autocomplete', array( |
|
| 1638 | - $that->autocomplete_adapter, |
|
| 1639 | - 'wl_autocomplete', |
|
| 1640 | - ) ); |
|
| 1641 | - add_action( 'wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1642 | - $that->autocomplete_adapter, |
|
| 1643 | - 'wl_autocomplete', |
|
| 1644 | - ) ); |
|
| 1645 | - |
|
| 1646 | - // Hooks to restrict multisite super admin from manipulating entity types. |
|
| 1647 | - if ( is_multisite() ) { |
|
| 1648 | - $that->loader->add_filter( 'map_meta_cap', $that->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1649 | - } |
|
| 1650 | - |
|
| 1651 | - $deactivator_feedback = new Wordlift_Deactivator_Feedback(); |
|
| 1652 | - |
|
| 1653 | - add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) ); |
|
| 1654 | - add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) ); |
|
| 1655 | - add_action( 'wp_ajax_wl_deactivation_feedback', array( |
|
| 1656 | - $deactivator_feedback, |
|
| 1657 | - 'wl_deactivation_feedback' |
|
| 1658 | - ) ); |
|
| 1659 | - |
|
| 1660 | - /** |
|
| 1661 | - * Always allow the `wordlift/classification` block. |
|
| 1662 | - * |
|
| 1663 | - * @since 3.23.0 |
|
| 1664 | - */ |
|
| 1665 | - add_filter( 'allowed_block_types', function ( $value ) { |
|
| 1666 | - |
|
| 1667 | - if ( true === $value ) { |
|
| 1668 | - return $value; |
|
| 1669 | - } |
|
| 1670 | - |
|
| 1671 | - return array_merge( (array) $value, array( 'wordlift/classification' ) ); |
|
| 1672 | - }, PHP_INT_MAX ); |
|
| 1673 | - |
|
| 1674 | - /** |
|
| 1675 | - * @since 3.27.7 |
|
| 1676 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
| 1677 | - */ |
|
| 1678 | - new Top_Entities(); |
|
| 1679 | - |
|
| 1680 | - } |
|
| 1681 | - |
|
| 1682 | - /** |
|
| 1683 | - * Register all of the hooks related to the public-facing functionality |
|
| 1684 | - * of the plugin. |
|
| 1685 | - * |
|
| 1686 | - * @since 1.0.0 |
|
| 1687 | - * @access private |
|
| 1688 | - */ |
|
| 1689 | - private function define_public_hooks( $that ) { |
|
| 1690 | - |
|
| 1691 | - $plugin_public = new Wordlift_Public( $that->get_plugin_name(), $that->get_version() ); |
|
| 1692 | - |
|
| 1693 | - // Register the entity post type. |
|
| 1694 | - $that->loader->add_action( 'init', $that->entity_post_type_service, 'register' ); |
|
| 1695 | - |
|
| 1696 | - // Bind the link generation and handling hooks to the entity link service. |
|
| 1697 | - $that->loader->add_filter( 'post_type_link', $that->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1698 | - $that->loader->add_action( 'pre_get_posts', $that->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1699 | - // $that->loader->add_filter( 'wp_unique_post_slug_is_bad_flat_slug', $that->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3 ); |
|
| 1700 | - // $that->loader->add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', $that->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4 ); |
|
| 1701 | - |
|
| 1702 | - $that->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1703 | - $that->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1704 | - $that->loader->add_action( 'wp_enqueue_scripts', $that->context_cards_service, 'enqueue_scripts' ); |
|
| 1705 | - |
|
| 1706 | - // Registering Faq_Content_Filter service used for removing faq question and answer tags from the html. |
|
| 1707 | - $that->loader->add_filter( 'the_content', $that->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' ); |
|
| 1708 | - // Hook the content filter service to add entity links. |
|
| 1709 | - if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) { |
|
| 1710 | - $that->loader->add_filter( 'the_content', $that->content_filter_service, 'the_content' ); |
|
| 1711 | - } |
|
| 1712 | - |
|
| 1713 | - // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1714 | - $that->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $that->timeline_service, 'ajax_timeline' ); |
|
| 1715 | - |
|
| 1716 | - // Hook the ShareThis service. |
|
| 1717 | - $that->loader->add_filter( 'the_content', $that->sharethis_service, 'the_content', 99 ); |
|
| 1718 | - $that->loader->add_filter( 'the_excerpt', $that->sharethis_service, 'the_excerpt', 99 ); |
|
| 1719 | - |
|
| 1720 | - // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1721 | - $that->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $that->jsonld_service, 'get' ); |
|
| 1722 | - |
|
| 1723 | - // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
|
| 1724 | - // in order to tweak WP's `WP_Query` to include entities in queries related |
|
| 1725 | - // to categories. |
|
| 1726 | - $that->loader->add_action( 'pre_get_posts', $that->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1727 | - |
|
| 1728 | - /* |
|
| 1595 | + // $that->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $that->analytics_settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1596 | + |
|
| 1597 | + // Hook the AJAX `wl_publisher` action name. |
|
| 1598 | + $that->loader->add_action( 'wp_ajax_wl_publisher', $that->publisher_ajax_adapter, 'publisher' ); |
|
| 1599 | + |
|
| 1600 | + // Hook row actions for the entity type list admin. |
|
| 1601 | + $that->loader->add_filter( 'wl_entity_type_row_actions', $that->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1602 | + |
|
| 1603 | + /** Ajax actions. */ |
|
| 1604 | + $that->loader->add_action( 'wp_ajax_wl_google_analytics_export', $that->google_analytics_export_service, 'export' ); |
|
| 1605 | + |
|
| 1606 | + // Hook capabilities manipulation to allow access to entity type admin |
|
| 1607 | + // page on WordPress versions before 4.7. |
|
| 1608 | + global $wp_version; |
|
| 1609 | + if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1610 | + $that->loader->add_filter( 'map_meta_cap', $that->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1611 | + } |
|
| 1612 | + |
|
| 1613 | + /** Adapters. */ |
|
| 1614 | + $that->loader->add_filter( 'mce_external_plugins', $that->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1615 | + /** |
|
| 1616 | + * Disabling Faq temporarily. |
|
| 1617 | + * Load the tinymce editor button on the tool bar. |
|
| 1618 | + * @since 3.26.0 |
|
| 1619 | + */ |
|
| 1620 | + //$that->loader->add_filter( 'tiny_mce_before_init', $that->faq_tinymce_adapter, 'register_custom_tags' ); |
|
| 1621 | + //$that->loader->add_filter( 'mce_buttons', $that->faq_tinymce_adapter, 'register_faq_toolbar_button', 10, 1 ); |
|
| 1622 | + //$that->loader->add_filter( 'mce_external_plugins', $that->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 ); |
|
| 1623 | + |
|
| 1624 | + |
|
| 1625 | + $that->loader->add_action( 'wp_ajax_wl_sample_data_create', $that->sample_data_ajax_adapter, 'create' ); |
|
| 1626 | + $that->loader->add_action( 'wp_ajax_wl_sample_data_delete', $that->sample_data_ajax_adapter, 'delete' ); |
|
| 1627 | + |
|
| 1628 | + /** |
|
| 1629 | + * @since 3.26.0 |
|
| 1630 | + */ |
|
| 1631 | + $excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter(); |
|
| 1632 | + $that->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' ); |
|
| 1633 | + // Adding Rest route for the post excerpt |
|
| 1634 | + Post_Excerpt_Rest_Controller::register_routes(); |
|
| 1635 | + |
|
| 1636 | + // Handle the autocomplete request. |
|
| 1637 | + add_action( 'wp_ajax_wl_autocomplete', array( |
|
| 1638 | + $that->autocomplete_adapter, |
|
| 1639 | + 'wl_autocomplete', |
|
| 1640 | + ) ); |
|
| 1641 | + add_action( 'wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1642 | + $that->autocomplete_adapter, |
|
| 1643 | + 'wl_autocomplete', |
|
| 1644 | + ) ); |
|
| 1645 | + |
|
| 1646 | + // Hooks to restrict multisite super admin from manipulating entity types. |
|
| 1647 | + if ( is_multisite() ) { |
|
| 1648 | + $that->loader->add_filter( 'map_meta_cap', $that->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1649 | + } |
|
| 1650 | + |
|
| 1651 | + $deactivator_feedback = new Wordlift_Deactivator_Feedback(); |
|
| 1652 | + |
|
| 1653 | + add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) ); |
|
| 1654 | + add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) ); |
|
| 1655 | + add_action( 'wp_ajax_wl_deactivation_feedback', array( |
|
| 1656 | + $deactivator_feedback, |
|
| 1657 | + 'wl_deactivation_feedback' |
|
| 1658 | + ) ); |
|
| 1659 | + |
|
| 1660 | + /** |
|
| 1661 | + * Always allow the `wordlift/classification` block. |
|
| 1662 | + * |
|
| 1663 | + * @since 3.23.0 |
|
| 1664 | + */ |
|
| 1665 | + add_filter( 'allowed_block_types', function ( $value ) { |
|
| 1666 | + |
|
| 1667 | + if ( true === $value ) { |
|
| 1668 | + return $value; |
|
| 1669 | + } |
|
| 1670 | + |
|
| 1671 | + return array_merge( (array) $value, array( 'wordlift/classification' ) ); |
|
| 1672 | + }, PHP_INT_MAX ); |
|
| 1673 | + |
|
| 1674 | + /** |
|
| 1675 | + * @since 3.27.7 |
|
| 1676 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
| 1677 | + */ |
|
| 1678 | + new Top_Entities(); |
|
| 1679 | + |
|
| 1680 | + } |
|
| 1681 | + |
|
| 1682 | + /** |
|
| 1683 | + * Register all of the hooks related to the public-facing functionality |
|
| 1684 | + * of the plugin. |
|
| 1685 | + * |
|
| 1686 | + * @since 1.0.0 |
|
| 1687 | + * @access private |
|
| 1688 | + */ |
|
| 1689 | + private function define_public_hooks( $that ) { |
|
| 1690 | + |
|
| 1691 | + $plugin_public = new Wordlift_Public( $that->get_plugin_name(), $that->get_version() ); |
|
| 1692 | + |
|
| 1693 | + // Register the entity post type. |
|
| 1694 | + $that->loader->add_action( 'init', $that->entity_post_type_service, 'register' ); |
|
| 1695 | + |
|
| 1696 | + // Bind the link generation and handling hooks to the entity link service. |
|
| 1697 | + $that->loader->add_filter( 'post_type_link', $that->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1698 | + $that->loader->add_action( 'pre_get_posts', $that->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1699 | + // $that->loader->add_filter( 'wp_unique_post_slug_is_bad_flat_slug', $that->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3 ); |
|
| 1700 | + // $that->loader->add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', $that->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4 ); |
|
| 1701 | + |
|
| 1702 | + $that->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1703 | + $that->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1704 | + $that->loader->add_action( 'wp_enqueue_scripts', $that->context_cards_service, 'enqueue_scripts' ); |
|
| 1705 | + |
|
| 1706 | + // Registering Faq_Content_Filter service used for removing faq question and answer tags from the html. |
|
| 1707 | + $that->loader->add_filter( 'the_content', $that->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' ); |
|
| 1708 | + // Hook the content filter service to add entity links. |
|
| 1709 | + if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) { |
|
| 1710 | + $that->loader->add_filter( 'the_content', $that->content_filter_service, 'the_content' ); |
|
| 1711 | + } |
|
| 1712 | + |
|
| 1713 | + // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1714 | + $that->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $that->timeline_service, 'ajax_timeline' ); |
|
| 1715 | + |
|
| 1716 | + // Hook the ShareThis service. |
|
| 1717 | + $that->loader->add_filter( 'the_content', $that->sharethis_service, 'the_content', 99 ); |
|
| 1718 | + $that->loader->add_filter( 'the_excerpt', $that->sharethis_service, 'the_excerpt', 99 ); |
|
| 1719 | + |
|
| 1720 | + // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1721 | + $that->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $that->jsonld_service, 'get' ); |
|
| 1722 | + |
|
| 1723 | + // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
|
| 1724 | + // in order to tweak WP's `WP_Query` to include entities in queries related |
|
| 1725 | + // to categories. |
|
| 1726 | + $that->loader->add_action( 'pre_get_posts', $that->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1727 | + |
|
| 1728 | + /* |
|
| 1729 | 1729 | * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service` |
| 1730 | 1730 | * in order to tweak WP's `WP_Query` to show event related entities in reverse |
| 1731 | 1731 | * order of start time. |
| 1732 | 1732 | */ |
| 1733 | - $that->loader->add_action( 'pre_get_posts', $that->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1734 | - |
|
| 1735 | - // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
|
| 1736 | - $that->loader->add_action( 'save_post', $that->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1737 | - |
|
| 1738 | - // Analytics Script Frontend. |
|
| 1739 | - if ( apply_filters( 'wl_feature__enable__analytics', true ) && Wordlift_Configuration_Service::get_instance()->is_analytics_enable() ) { |
|
| 1740 | - $that->loader->add_action( 'wp_enqueue_scripts', $that->analytics_connect, 'enqueue_scripts', 10 ); |
|
| 1741 | - } |
|
| 1742 | - |
|
| 1743 | - } |
|
| 1744 | - |
|
| 1745 | - /** |
|
| 1746 | - * Run the loader to execute all of the hooks with WordPress. |
|
| 1747 | - * |
|
| 1748 | - * @since 1.0.0 |
|
| 1749 | - */ |
|
| 1750 | - public function run() { |
|
| 1751 | - $this->loader->run(); |
|
| 1752 | - } |
|
| 1753 | - |
|
| 1754 | - /** |
|
| 1755 | - * The name of the plugin used to uniquely identify it within the context of |
|
| 1756 | - * WordPress and to define internationalization functionality. |
|
| 1757 | - * |
|
| 1758 | - * @return string The name of the plugin. |
|
| 1759 | - * @since 1.0.0 |
|
| 1760 | - */ |
|
| 1761 | - public function get_plugin_name() { |
|
| 1762 | - return $this->plugin_name; |
|
| 1763 | - } |
|
| 1764 | - |
|
| 1765 | - /** |
|
| 1766 | - * The reference to the class that orchestrates the hooks with the plugin. |
|
| 1767 | - * |
|
| 1768 | - * @return Wordlift_Loader Orchestrates the hooks of the plugin. |
|
| 1769 | - * @since 1.0.0 |
|
| 1770 | - */ |
|
| 1771 | - public function get_loader() { |
|
| 1772 | - return $this->loader; |
|
| 1773 | - } |
|
| 1774 | - |
|
| 1775 | - /** |
|
| 1776 | - * Retrieve the version number of the plugin. |
|
| 1777 | - * |
|
| 1778 | - * @return string The version number of the plugin. |
|
| 1779 | - * @since 1.0.0 |
|
| 1780 | - */ |
|
| 1781 | - public function get_version() { |
|
| 1782 | - return $this->version; |
|
| 1783 | - } |
|
| 1784 | - |
|
| 1785 | - /** |
|
| 1786 | - * Load dependencies for WP-CLI. |
|
| 1787 | - * |
|
| 1788 | - * @throws Exception |
|
| 1789 | - * @since 3.18.0 |
|
| 1790 | - */ |
|
| 1791 | - private function load_cli_dependencies() { |
|
| 1792 | - |
|
| 1793 | - } |
|
| 1794 | - |
|
| 1795 | - public function add_wl_enabled_blocks() { |
|
| 1796 | - /** |
|
| 1797 | - * Filter: wl_feature__enable__blocks. |
|
| 1798 | - * |
|
| 1799 | - * @param bool whether the blocks needed to be registered, defaults to true. |
|
| 1800 | - * |
|
| 1801 | - * @return bool |
|
| 1802 | - * @since 3.27.6 |
|
| 1803 | - */ |
|
| 1804 | - |
|
| 1805 | - wp_register_script( 'wl_enabled_blocks', false ); |
|
| 1806 | - |
|
| 1807 | - $enabled_blocks = array(); |
|
| 1808 | - |
|
| 1809 | - /** |
|
| 1810 | - * Filter name: wl_feature__enable__product-navigator |
|
| 1811 | - * @since 3.32.3 |
|
| 1812 | - */ |
|
| 1813 | - if ( apply_filters( 'wl_feature__enable__product-navigator', true ) ) { |
|
| 1814 | - $enabled_blocks[] = 'wordlift/products-navigator'; |
|
| 1815 | - } |
|
| 1816 | - |
|
| 1817 | - if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 1818 | - // To intimate JS |
|
| 1819 | - $enabled_blocks = array_merge( $enabled_blocks, array( |
|
| 1820 | - 'wordlift/navigator', |
|
| 1821 | - 'wordlift/chord', |
|
| 1822 | - 'wordlift/geomap', |
|
| 1823 | - 'wordlift/timeline', |
|
| 1824 | - 'wordlift/cloud', |
|
| 1825 | - 'wordlift/vocabulary', |
|
| 1826 | - 'wordlift/faceted-search' |
|
| 1827 | - ) ); |
|
| 1828 | - } |
|
| 1829 | - |
|
| 1830 | - wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks ); |
|
| 1831 | - wp_enqueue_script( 'wl_enabled_blocks' ); |
|
| 1832 | - } |
|
| 1833 | - |
|
| 1834 | - /** |
|
| 1835 | - * Register screens based on the filter. |
|
| 1836 | - */ |
|
| 1837 | - public function register_screens() { |
|
| 1838 | - // Hook the menu to the Download Your Data page. |
|
| 1839 | - if ( apply_filters( 'wl_feature__enable__settings-download', true ) ) { |
|
| 1840 | - Assertions::is_set( $this->download_your_data_page, "`download_your_data_page` can't be null" ); |
|
| 1841 | - add_action( 'admin_menu', array( $this->download_your_data_page, 'admin_menu' ), 100, 0 ); |
|
| 1842 | - } |
|
| 1843 | - |
|
| 1844 | - Assertions::is_set( $this->entity_type_settings_admin_page, "`entity_type_settings_admin_page` can't be null" ); |
|
| 1845 | - add_action( 'admin_menu', array( $this->entity_type_settings_admin_page, 'admin_menu' ), 100, 0 ); |
|
| 1846 | - |
|
| 1847 | - } |
|
| 1733 | + $that->loader->add_action( 'pre_get_posts', $that->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1734 | + |
|
| 1735 | + // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
|
| 1736 | + $that->loader->add_action( 'save_post', $that->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1737 | + |
|
| 1738 | + // Analytics Script Frontend. |
|
| 1739 | + if ( apply_filters( 'wl_feature__enable__analytics', true ) && Wordlift_Configuration_Service::get_instance()->is_analytics_enable() ) { |
|
| 1740 | + $that->loader->add_action( 'wp_enqueue_scripts', $that->analytics_connect, 'enqueue_scripts', 10 ); |
|
| 1741 | + } |
|
| 1742 | + |
|
| 1743 | + } |
|
| 1744 | + |
|
| 1745 | + /** |
|
| 1746 | + * Run the loader to execute all of the hooks with WordPress. |
|
| 1747 | + * |
|
| 1748 | + * @since 1.0.0 |
|
| 1749 | + */ |
|
| 1750 | + public function run() { |
|
| 1751 | + $this->loader->run(); |
|
| 1752 | + } |
|
| 1753 | + |
|
| 1754 | + /** |
|
| 1755 | + * The name of the plugin used to uniquely identify it within the context of |
|
| 1756 | + * WordPress and to define internationalization functionality. |
|
| 1757 | + * |
|
| 1758 | + * @return string The name of the plugin. |
|
| 1759 | + * @since 1.0.0 |
|
| 1760 | + */ |
|
| 1761 | + public function get_plugin_name() { |
|
| 1762 | + return $this->plugin_name; |
|
| 1763 | + } |
|
| 1764 | + |
|
| 1765 | + /** |
|
| 1766 | + * The reference to the class that orchestrates the hooks with the plugin. |
|
| 1767 | + * |
|
| 1768 | + * @return Wordlift_Loader Orchestrates the hooks of the plugin. |
|
| 1769 | + * @since 1.0.0 |
|
| 1770 | + */ |
|
| 1771 | + public function get_loader() { |
|
| 1772 | + return $this->loader; |
|
| 1773 | + } |
|
| 1774 | + |
|
| 1775 | + /** |
|
| 1776 | + * Retrieve the version number of the plugin. |
|
| 1777 | + * |
|
| 1778 | + * @return string The version number of the plugin. |
|
| 1779 | + * @since 1.0.0 |
|
| 1780 | + */ |
|
| 1781 | + public function get_version() { |
|
| 1782 | + return $this->version; |
|
| 1783 | + } |
|
| 1784 | + |
|
| 1785 | + /** |
|
| 1786 | + * Load dependencies for WP-CLI. |
|
| 1787 | + * |
|
| 1788 | + * @throws Exception |
|
| 1789 | + * @since 3.18.0 |
|
| 1790 | + */ |
|
| 1791 | + private function load_cli_dependencies() { |
|
| 1792 | + |
|
| 1793 | + } |
|
| 1794 | + |
|
| 1795 | + public function add_wl_enabled_blocks() { |
|
| 1796 | + /** |
|
| 1797 | + * Filter: wl_feature__enable__blocks. |
|
| 1798 | + * |
|
| 1799 | + * @param bool whether the blocks needed to be registered, defaults to true. |
|
| 1800 | + * |
|
| 1801 | + * @return bool |
|
| 1802 | + * @since 3.27.6 |
|
| 1803 | + */ |
|
| 1804 | + |
|
| 1805 | + wp_register_script( 'wl_enabled_blocks', false ); |
|
| 1806 | + |
|
| 1807 | + $enabled_blocks = array(); |
|
| 1808 | + |
|
| 1809 | + /** |
|
| 1810 | + * Filter name: wl_feature__enable__product-navigator |
|
| 1811 | + * @since 3.32.3 |
|
| 1812 | + */ |
|
| 1813 | + if ( apply_filters( 'wl_feature__enable__product-navigator', true ) ) { |
|
| 1814 | + $enabled_blocks[] = 'wordlift/products-navigator'; |
|
| 1815 | + } |
|
| 1816 | + |
|
| 1817 | + if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 1818 | + // To intimate JS |
|
| 1819 | + $enabled_blocks = array_merge( $enabled_blocks, array( |
|
| 1820 | + 'wordlift/navigator', |
|
| 1821 | + 'wordlift/chord', |
|
| 1822 | + 'wordlift/geomap', |
|
| 1823 | + 'wordlift/timeline', |
|
| 1824 | + 'wordlift/cloud', |
|
| 1825 | + 'wordlift/vocabulary', |
|
| 1826 | + 'wordlift/faceted-search' |
|
| 1827 | + ) ); |
|
| 1828 | + } |
|
| 1829 | + |
|
| 1830 | + wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks ); |
|
| 1831 | + wp_enqueue_script( 'wl_enabled_blocks' ); |
|
| 1832 | + } |
|
| 1833 | + |
|
| 1834 | + /** |
|
| 1835 | + * Register screens based on the filter. |
|
| 1836 | + */ |
|
| 1837 | + public function register_screens() { |
|
| 1838 | + // Hook the menu to the Download Your Data page. |
|
| 1839 | + if ( apply_filters( 'wl_feature__enable__settings-download', true ) ) { |
|
| 1840 | + Assertions::is_set( $this->download_your_data_page, "`download_your_data_page` can't be null" ); |
|
| 1841 | + add_action( 'admin_menu', array( $this->download_your_data_page, 'admin_menu' ), 100, 0 ); |
|
| 1842 | + } |
|
| 1843 | + |
|
| 1844 | + Assertions::is_set( $this->entity_type_settings_admin_page, "`entity_type_settings_admin_page` can't be null" ); |
|
| 1845 | + add_action( 'admin_menu', array( $this->entity_type_settings_admin_page, 'admin_menu' ), 100, 0 ); |
|
| 1846 | + |
|
| 1847 | + } |
|
| 1848 | 1848 | |
| 1849 | 1849 | } |
@@ -640,13 +640,13 @@ discard block |
||
| 640 | 640 | $this->set_locale(); |
| 641 | 641 | |
| 642 | 642 | $that = $this; |
| 643 | - add_action( 'plugins_loaded', function () use ( $that ) { |
|
| 644 | - $that->define_admin_hooks( $that ); |
|
| 645 | - $that->define_public_hooks( $that ); |
|
| 646 | - }, 4 ); |
|
| 643 | + add_action('plugins_loaded', function() use ($that) { |
|
| 644 | + $that->define_admin_hooks($that); |
|
| 645 | + $that->define_public_hooks($that); |
|
| 646 | + }, 4); |
|
| 647 | 647 | |
| 648 | 648 | // If we're in `WP_CLI` load the related files. |
| 649 | - if ( class_exists( 'WP_CLI' ) ) { |
|
| 649 | + if (class_exists('WP_CLI')) { |
|
| 650 | 650 | $this->load_cli_dependencies(); |
| 651 | 651 | } |
| 652 | 652 | |
@@ -687,328 +687,328 @@ discard block |
||
| 687 | 687 | * The class responsible for orchestrating the actions and filters of the |
| 688 | 688 | * core plugin. |
| 689 | 689 | */ |
| 690 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 690 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-loader.php'; |
|
| 691 | 691 | |
| 692 | 692 | // The class responsible for plugin uninstall. |
| 693 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
|
| 693 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-deactivator-feedback.php'; |
|
| 694 | 694 | |
| 695 | 695 | /** |
| 696 | 696 | * The class responsible for defining internationalization functionality |
| 697 | 697 | * of the plugin. |
| 698 | 698 | */ |
| 699 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 699 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-i18n.php'; |
|
| 700 | 700 | |
| 701 | 701 | /** |
| 702 | 702 | * WordLift's supported languages. |
| 703 | 703 | */ |
| 704 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 704 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-languages.php'; |
|
| 705 | 705 | |
| 706 | 706 | /** |
| 707 | 707 | * WordLift's supported countries. |
| 708 | 708 | */ |
| 709 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php'; |
|
| 709 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-countries.php'; |
|
| 710 | 710 | |
| 711 | 711 | /** |
| 712 | 712 | * Provide support functions to sanitize data. |
| 713 | 713 | */ |
| 714 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 714 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sanitizer.php'; |
|
| 715 | 715 | |
| 716 | 716 | /** Services. */ |
| 717 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 718 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
|
| 719 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 720 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 721 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 722 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 723 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 724 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 725 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php'; |
|
| 717 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-log-service.php'; |
|
| 718 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-http-api.php'; |
|
| 719 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-redirect-service.php'; |
|
| 720 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-configuration-service.php'; |
|
| 721 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-type-service.php'; |
|
| 722 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-service.php'; |
|
| 723 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-link-service.php'; |
|
| 724 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-relation-service.php'; |
|
| 725 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-image-service.php'; |
|
| 726 | 726 | |
| 727 | 727 | /** |
| 728 | 728 | * The Schema service. |
| 729 | 729 | */ |
| 730 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 730 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-service.php'; |
|
| 731 | 731 | |
| 732 | 732 | /** |
| 733 | 733 | * The schema:url property service. |
| 734 | 734 | */ |
| 735 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 736 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 735 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-service.php'; |
|
| 736 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-url-property-service.php'; |
|
| 737 | 737 | |
| 738 | 738 | /** |
| 739 | 739 | * The UI service. |
| 740 | 740 | */ |
| 741 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 741 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-ui-service.php'; |
|
| 742 | 742 | |
| 743 | 743 | /** |
| 744 | 744 | * The Entity Types Taxonomy service. |
| 745 | 745 | */ |
| 746 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 746 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 747 | 747 | |
| 748 | 748 | /** |
| 749 | 749 | * The Entity service. |
| 750 | 750 | */ |
| 751 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
|
| 752 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 751 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-uri-service.php'; |
|
| 752 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-service.php'; |
|
| 753 | 753 | |
| 754 | 754 | // Add the entity rating service. |
| 755 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 755 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rating-service.php'; |
|
| 756 | 756 | |
| 757 | 757 | /** |
| 758 | 758 | * The User service. |
| 759 | 759 | */ |
| 760 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 760 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-user-service.php'; |
|
| 761 | 761 | |
| 762 | 762 | /** |
| 763 | 763 | * The Timeline service. |
| 764 | 764 | */ |
| 765 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 765 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-timeline-service.php'; |
|
| 766 | 766 | |
| 767 | 767 | /** |
| 768 | 768 | * The Topic Taxonomy service. |
| 769 | 769 | */ |
| 770 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 770 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 771 | 771 | |
| 772 | 772 | /** |
| 773 | 773 | * The WordLift URI service. |
| 774 | 774 | */ |
| 775 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 776 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 777 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 775 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-uri-service.php'; |
|
| 776 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-factory.php'; |
|
| 777 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-service.php'; |
|
| 778 | 778 | |
| 779 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 780 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 779 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 780 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-attachment-service.php'; |
|
| 781 | 781 | |
| 782 | 782 | /** |
| 783 | 783 | * Load the converters. |
| 784 | 784 | */ |
| 785 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 786 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 787 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 788 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 789 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 790 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 785 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/intf-wordlift-post-converter.php'; |
|
| 786 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 787 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 788 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 789 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 790 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 791 | 791 | |
| 792 | 792 | /** |
| 793 | 793 | * Load cache-related files. |
| 794 | 794 | */ |
| 795 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
|
| 795 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/cache/require.php'; |
|
| 796 | 796 | |
| 797 | 797 | /** |
| 798 | 798 | * Load the content filter. |
| 799 | 799 | */ |
| 800 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 800 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-content-filter-service.php'; |
|
| 801 | 801 | |
| 802 | 802 | /* |
| 803 | 803 | * Load the excerpt helper. |
| 804 | 804 | */ |
| 805 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 805 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 806 | 806 | |
| 807 | 807 | /** |
| 808 | 808 | * Load the JSON-LD service to publish entities using JSON-LD.s |
| 809 | 809 | * |
| 810 | 810 | * @since 3.8.0 |
| 811 | 811 | */ |
| 812 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 812 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-service.php'; |
|
| 813 | 813 | |
| 814 | 814 | // The Publisher Service and the AJAX adapter. |
| 815 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 816 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 815 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-service.php'; |
|
| 816 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 817 | 817 | |
| 818 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 818 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-adapter.php'; |
|
| 819 | 819 | |
| 820 | 820 | /** |
| 821 | 821 | * Load the WordLift key validation service. |
| 822 | 822 | */ |
| 823 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 823 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-key-validation-service.php'; |
|
| 824 | 824 | |
| 825 | 825 | // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
| 826 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 826 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 827 | 827 | |
| 828 | 828 | // Load the `Wordlift_Entity_Page_Service` class definition. |
| 829 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
| 829 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-page-service.php'; |
|
| 830 | 830 | |
| 831 | 831 | /** Linked Data. */ |
| 832 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 833 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 834 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 835 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 836 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 837 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 838 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 839 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 840 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 841 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 842 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 832 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 833 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 834 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 835 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 836 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 837 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 838 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 839 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 840 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 841 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 842 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 843 | 843 | |
| 844 | 844 | /** Services. */ |
| 845 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 846 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php'; |
|
| 845 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 846 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-api-service.php'; |
|
| 847 | 847 | |
| 848 | 848 | /** Adapters. */ |
| 849 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 850 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 851 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 852 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 853 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php'; |
|
| 849 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-tinymce-adapter.php'; |
|
| 850 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-newrelic-adapter.php'; |
|
| 851 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 852 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-adapter.php'; |
|
| 853 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-wprocket-adapter.php'; |
|
| 854 | 854 | |
| 855 | 855 | /** Autocomplete. */ |
| 856 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 856 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 857 | 857 | |
| 858 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
|
| 858 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-remote-image-service.php'; |
|
| 859 | 859 | |
| 860 | 860 | /** Analytics */ |
| 861 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 861 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 862 | 862 | |
| 863 | 863 | /** |
| 864 | 864 | * The class responsible for defining all actions that occur in the admin area. |
| 865 | 865 | */ |
| 866 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 866 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin.php'; |
|
| 867 | 867 | |
| 868 | 868 | /** |
| 869 | 869 | * The class to customize the entity list admin page. |
| 870 | 870 | */ |
| 871 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 871 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-list.php'; |
|
| 872 | 872 | |
| 873 | 873 | /** |
| 874 | 874 | * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
| 875 | 875 | */ |
| 876 | 876 | global $wp_version; |
| 877 | - if ( version_compare( $wp_version, '5.3', '<' ) ) { |
|
| 878 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 877 | + if (version_compare($wp_version, '5.3', '<')) { |
|
| 878 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 879 | 879 | } else { |
| 880 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
| 880 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
| 881 | 881 | } |
| 882 | 882 | |
| 883 | 883 | /** |
| 884 | 884 | * The Notice service. |
| 885 | 885 | */ |
| 886 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 886 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-notice-service.php'; |
|
| 887 | 887 | |
| 888 | 888 | /** |
| 889 | 889 | * The PrimaShop adapter. |
| 890 | 890 | */ |
| 891 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 891 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-primashop-adapter.php'; |
|
| 892 | 892 | |
| 893 | 893 | /** |
| 894 | 894 | * The WordLift Dashboard service. |
| 895 | 895 | */ |
| 896 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 896 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard.php'; |
|
| 897 | 897 | |
| 898 | 898 | /** |
| 899 | 899 | * The admin 'Install wizard' page. |
| 900 | 900 | */ |
| 901 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 901 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-setup.php'; |
|
| 902 | 902 | |
| 903 | 903 | /** |
| 904 | 904 | * The WordLift entity type list admin page controller. |
| 905 | 905 | */ |
| 906 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 906 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 907 | 907 | |
| 908 | 908 | /** |
| 909 | 909 | * The WordLift entity type settings admin page controller. |
| 910 | 910 | */ |
| 911 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 911 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-settings.php'; |
|
| 912 | 912 | |
| 913 | 913 | /** |
| 914 | 914 | * The admin 'Download Your Data' page. |
| 915 | 915 | */ |
| 916 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 916 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-download-your-data-page.php'; |
|
| 917 | 917 | |
| 918 | 918 | /** |
| 919 | 919 | * The admin 'WordLift Settings' page. |
| 920 | 920 | */ |
| 921 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php'; |
|
| 922 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 923 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 924 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 925 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 926 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 927 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 928 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 929 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 930 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 931 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 932 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 933 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
| 934 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 935 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
| 921 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/intf-wordlift-admin-element.php'; |
|
| 922 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 923 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 924 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 925 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 926 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 927 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 928 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 929 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 930 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 931 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-page.php'; |
|
| 932 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page.php'; |
|
| 933 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
| 934 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 935 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
| 936 | 936 | |
| 937 | 937 | /** Admin Pages */ |
| 938 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 939 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 938 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 939 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 940 | 940 | |
| 941 | 941 | /** |
| 942 | 942 | * The class responsible for defining all actions that occur in the public-facing |
| 943 | 943 | * side of the site. |
| 944 | 944 | */ |
| 945 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 945 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-public.php'; |
|
| 946 | 946 | |
| 947 | 947 | /** |
| 948 | 948 | * The shortcode abstract class. |
| 949 | 949 | */ |
| 950 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 950 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-shortcode.php'; |
|
| 951 | 951 | |
| 952 | 952 | /** |
| 953 | 953 | * The Timeline shortcode. |
| 954 | 954 | */ |
| 955 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 955 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-timeline-shortcode.php'; |
|
| 956 | 956 | |
| 957 | 957 | /** |
| 958 | 958 | * The Navigator shortcode. |
| 959 | 959 | */ |
| 960 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 960 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-navigator-shortcode.php'; |
|
| 961 | 961 | |
| 962 | 962 | /** |
| 963 | 963 | * The Products Navigator shortcode. |
| 964 | 964 | */ |
| 965 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php'; |
|
| 965 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-products-navigator-shortcode.php'; |
|
| 966 | 966 | |
| 967 | 967 | /** |
| 968 | 968 | * The chord shortcode. |
| 969 | 969 | */ |
| 970 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 970 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-chord-shortcode.php'; |
|
| 971 | 971 | |
| 972 | 972 | /** |
| 973 | 973 | * The geomap shortcode. |
| 974 | 974 | */ |
| 975 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 975 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-geomap-shortcode.php'; |
|
| 976 | 976 | |
| 977 | 977 | /** |
| 978 | 978 | * The entity cloud shortcode. |
| 979 | 979 | */ |
| 980 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 980 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 981 | 981 | |
| 982 | 982 | /** |
| 983 | 983 | * The entity glossary shortcode. |
| 984 | 984 | */ |
| 985 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
|
| 986 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 985 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-alphabet-service.php'; |
|
| 986 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 987 | 987 | |
| 988 | 988 | /** |
| 989 | 989 | * Faceted Search shortcode. |
| 990 | 990 | */ |
| 991 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 991 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 992 | 992 | |
| 993 | 993 | /** |
| 994 | 994 | * The ShareThis service. |
| 995 | 995 | */ |
| 996 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 996 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-sharethis-service.php'; |
|
| 997 | 997 | |
| 998 | 998 | /** |
| 999 | 999 | * The SEO service. |
| 1000 | 1000 | */ |
| 1001 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 1001 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-seo-service.php'; |
|
| 1002 | 1002 | |
| 1003 | 1003 | /** |
| 1004 | 1004 | * The AMP service. |
| 1005 | 1005 | */ |
| 1006 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1006 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-amp-service.php'; |
|
| 1007 | 1007 | |
| 1008 | 1008 | /** Widgets */ |
| 1009 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1010 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1011 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php'; |
|
| 1009 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-widget.php'; |
|
| 1010 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1011 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-context-cards.php'; |
|
| 1012 | 1012 | |
| 1013 | 1013 | /* |
| 1014 | 1014 | * Batch Operations. They're similar to Batch Actions but do not require working on post types. |
@@ -1017,18 +1017,18 @@ discard block |
||
| 1017 | 1017 | * |
| 1018 | 1018 | * @since 3.20.0 |
| 1019 | 1019 | */ |
| 1020 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1021 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1020 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1021 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1022 | 1022 | |
| 1023 | 1023 | /* |
| 1024 | 1024 | * Schema.org Services. |
| 1025 | 1025 | * |
| 1026 | 1026 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1027 | 1027 | */ |
| 1028 | - if ( WL_ALL_ENTITY_TYPES ) { |
|
| 1029 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1030 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1031 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1028 | + if (WL_ALL_ENTITY_TYPES) { |
|
| 1029 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1030 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1031 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1032 | 1032 | new Wordlift_Schemaorg_Sync_Service(); |
| 1033 | 1033 | $schemaorg_property_service = Wordlift_Schemaorg_Property_Service::get_instance(); |
| 1034 | 1034 | new Wordlift_Schemaorg_Class_Service(); |
@@ -1044,13 +1044,13 @@ discard block |
||
| 1044 | 1044 | |
| 1045 | 1045 | // Instantiate a global logger. |
| 1046 | 1046 | global $wl_logger; |
| 1047 | - $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1047 | + $wl_logger = Wordlift_Log_Service::get_logger('WordLift'); |
|
| 1048 | 1048 | |
| 1049 | 1049 | // Load the `wl-api` end-point. |
| 1050 | 1050 | new Wordlift_Http_Api(); |
| 1051 | 1051 | |
| 1052 | 1052 | // Load the Install Service. |
| 1053 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
|
| 1053 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-service.php'; |
|
| 1054 | 1054 | $this->install_service = new Wordlift_Install_Service(); |
| 1055 | 1055 | $this->notice_service = new Wordlift_Notice_Service(); |
| 1056 | 1056 | $this->user_service = Wordlift_User_Service::get_instance(); |
@@ -1068,21 +1068,21 @@ discard block |
||
| 1068 | 1068 | |
| 1069 | 1069 | |
| 1070 | 1070 | $that = $this; |
| 1071 | - add_action( 'plugins_loaded', function () use ( &$that, $schemaorg_property_service ) { |
|
| 1071 | + add_action('plugins_loaded', function() use (&$that, $schemaorg_property_service) { |
|
| 1072 | 1072 | |
| 1073 | 1073 | /** Services. */ |
| 1074 | 1074 | // Create the configuration service. |
| 1075 | 1075 | $api_service = new Wordlift_Api_Service(); |
| 1076 | 1076 | |
| 1077 | 1077 | // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
| 1078 | - $that->entity_link_service = new Wordlift_Entity_Link_Service( $that->entity_post_type_service, Wordlift_Configuration_Service::get_instance()->get_entity_base_path() ); |
|
| 1078 | + $that->entity_link_service = new Wordlift_Entity_Link_Service($that->entity_post_type_service, Wordlift_Configuration_Service::get_instance()->get_entity_base_path()); |
|
| 1079 | 1079 | |
| 1080 | 1080 | $schema_url_property_service = new Wordlift_Schema_Url_Property_Service(); |
| 1081 | 1081 | |
| 1082 | 1082 | $that->entity_uri_service = Wordlift_Entity_Uri_Service::get_instance(); |
| 1083 | 1083 | |
| 1084 | 1084 | // Create a new instance of the Redirect service. |
| 1085 | - $that->redirect_service = new Wordlift_Redirect_Service( $that->entity_uri_service ); |
|
| 1085 | + $that->redirect_service = new Wordlift_Redirect_Service($that->entity_uri_service); |
|
| 1086 | 1086 | |
| 1087 | 1087 | // Create a new instance of the Timeline service and Timeline shortcode. |
| 1088 | 1088 | $that->timeline_service = new Wordlift_Timeline_Service(); |
@@ -1095,30 +1095,30 @@ discard block |
||
| 1095 | 1095 | // Create an instance of the PrimaShop adapter. |
| 1096 | 1096 | $that->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
| 1097 | 1097 | |
| 1098 | - $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1098 | + $uri_service = new Wordlift_Uri_Service($GLOBALS['wpdb']); |
|
| 1099 | 1099 | |
| 1100 | 1100 | // Create the entity rating service. |
| 1101 | 1101 | $that->rating_service = Wordlift_Rating_Service::get_instance(); |
| 1102 | 1102 | |
| 1103 | 1103 | // Create entity list customization (wp-admin/edit.php). |
| 1104 | - $that->entity_list_service = new Wordlift_Entity_List_Service( $that->rating_service ); |
|
| 1104 | + $that->entity_list_service = new Wordlift_Entity_List_Service($that->rating_service); |
|
| 1105 | 1105 | |
| 1106 | 1106 | // Create an instance of the Publisher Service and the AJAX Adapter. |
| 1107 | 1107 | $that->publisher_service = Wordlift_Publisher_Service::get_instance(); |
| 1108 | - $that->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1109 | - $that->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1108 | + $that->property_factory = new Wordlift_Property_Factory($schema_url_property_service); |
|
| 1109 | + $that->property_factory->register(Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service); |
|
| 1110 | 1110 | |
| 1111 | 1111 | $attachment_service = Wordlift_Attachment_Service::get_instance(); |
| 1112 | 1112 | |
| 1113 | 1113 | // Instantiate the JSON-LD service. |
| 1114 | 1114 | $property_getter = Wordlift_Property_Getter_Factory::create(); |
| 1115 | - $that->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service ); |
|
| 1116 | - $that->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $that->post_to_jsonld_converter ); |
|
| 1117 | - $that->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter( $that->entity_post_to_jsonld_converter, $that->post_to_jsonld_converter ); |
|
| 1118 | - $that->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service ); |
|
| 1115 | + $that->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter(Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service); |
|
| 1116 | + $that->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter(Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $that->post_to_jsonld_converter); |
|
| 1117 | + $that->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter($that->entity_post_to_jsonld_converter, $that->post_to_jsonld_converter); |
|
| 1118 | + $that->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter(Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service); |
|
| 1119 | 1119 | |
| 1120 | - $jsonld_cache = new Ttl_Cache( 'jsonld', 86400 ); |
|
| 1121 | - $that->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $that->postid_to_jsonld_converter, $jsonld_cache ); |
|
| 1120 | + $jsonld_cache = new Ttl_Cache('jsonld', 86400); |
|
| 1121 | + $that->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter($that->postid_to_jsonld_converter, $jsonld_cache); |
|
| 1122 | 1122 | /* |
| 1123 | 1123 | * Load the `Wordlift_Term_JsonLd_Adapter`. |
| 1124 | 1124 | * |
@@ -1126,31 +1126,31 @@ discard block |
||
| 1126 | 1126 | * |
| 1127 | 1127 | * @since 3.20.0 |
| 1128 | 1128 | */ |
| 1129 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1129 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1130 | 1130 | |
| 1131 | - $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $that->entity_uri_service, $that->cached_postid_to_jsonld_converter ); |
|
| 1132 | - $that->jsonld_service = new Wordlift_Jsonld_Service( Wordlift_Entity_Service::get_instance(), $that->cached_postid_to_jsonld_converter, $that->jsonld_website_converter, $term_jsonld_adapter ); |
|
| 1131 | + $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter($that->entity_uri_service, $that->cached_postid_to_jsonld_converter); |
|
| 1132 | + $that->jsonld_service = new Wordlift_Jsonld_Service(Wordlift_Entity_Service::get_instance(), $that->cached_postid_to_jsonld_converter, $that->jsonld_website_converter, $term_jsonld_adapter); |
|
| 1133 | 1133 | |
| 1134 | 1134 | $jsonld_service = new Jsonld_Service( |
| 1135 | 1135 | $that->jsonld_service, |
| 1136 | 1136 | $term_jsonld_adapter, |
| 1137 | - new Jsonld_User_Service( $that->user_service ) ); |
|
| 1138 | - new Jsonld_Endpoint( $jsonld_service, $that->entity_uri_service ); |
|
| 1137 | + new Jsonld_User_Service($that->user_service) ); |
|
| 1138 | + new Jsonld_Endpoint($jsonld_service, $that->entity_uri_service); |
|
| 1139 | 1139 | |
| 1140 | 1140 | // Prints the JSON-LD in the head. |
| 1141 | - new Jsonld_Adapter( $that->jsonld_service ); |
|
| 1141 | + new Jsonld_Adapter($that->jsonld_service); |
|
| 1142 | 1142 | |
| 1143 | - new Jsonld_By_Id_Endpoint( $that->jsonld_service, $that->entity_uri_service ); |
|
| 1143 | + new Jsonld_By_Id_Endpoint($that->jsonld_service, $that->entity_uri_service); |
|
| 1144 | 1144 | |
| 1145 | 1145 | $that->key_validation_service = new Wordlift_Key_Validation_Service(); |
| 1146 | 1146 | $that->content_filter_service = Wordlift_Content_Filter_Service::get_instance(); |
| 1147 | 1147 | // Creating Faq Content filter service. |
| 1148 | 1148 | $that->faq_content_filter_service = new Faq_Content_Filter(); |
| 1149 | 1149 | $that->sample_data_service = Wordlift_Sample_Data_Service::get_instance(); |
| 1150 | - $that->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $that->sample_data_service ); |
|
| 1150 | + $that->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter($that->sample_data_service); |
|
| 1151 | 1151 | |
| 1152 | - $that->loader->add_action( 'enqueue_block_editor_assets', $that, 'add_wl_enabled_blocks' ); |
|
| 1153 | - $that->loader->add_action( 'admin_enqueue_scripts', $that, 'add_wl_enabled_blocks' ); |
|
| 1152 | + $that->loader->add_action('enqueue_block_editor_assets', $that, 'add_wl_enabled_blocks'); |
|
| 1153 | + $that->loader->add_action('admin_enqueue_scripts', $that, 'add_wl_enabled_blocks'); |
|
| 1154 | 1154 | |
| 1155 | 1155 | /** |
| 1156 | 1156 | * Filter: wl_feature__enable__blocks. |
@@ -1160,15 +1160,15 @@ discard block |
||
| 1160 | 1160 | * @return bool |
| 1161 | 1161 | * @since 3.27.6 |
| 1162 | 1162 | */ |
| 1163 | - if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 1163 | + if (apply_filters('wl_feature__enable__blocks', true)) { |
|
| 1164 | 1164 | // Initialize the short-codes. |
| 1165 | - new Async_Template_Decorator( new Wordlift_Navigator_Shortcode() ); |
|
| 1165 | + new Async_Template_Decorator(new Wordlift_Navigator_Shortcode()); |
|
| 1166 | 1166 | new Wordlift_Chord_Shortcode(); |
| 1167 | 1167 | new Wordlift_Geomap_Shortcode(); |
| 1168 | 1168 | new Wordlift_Timeline_Shortcode(); |
| 1169 | - new Wordlift_Related_Entities_Cloud_Shortcode( Wordlift_Relation_Service::get_instance(), Wordlift_Entity_Service::get_instance() ); |
|
| 1169 | + new Wordlift_Related_Entities_Cloud_Shortcode(Wordlift_Relation_Service::get_instance(), Wordlift_Entity_Service::get_instance()); |
|
| 1170 | 1170 | new Wordlift_Vocabulary_Shortcode(); |
| 1171 | - new Async_Template_Decorator( new Wordlift_Faceted_Search_Shortcode() ); |
|
| 1171 | + new Async_Template_Decorator(new Wordlift_Faceted_Search_Shortcode()); |
|
| 1172 | 1172 | } |
| 1173 | 1173 | |
| 1174 | 1174 | new Wordlift_Products_Navigator_Shortcode(); |
@@ -1181,16 +1181,16 @@ discard block |
||
| 1181 | 1181 | new Wordlift_Seo_Service(); |
| 1182 | 1182 | |
| 1183 | 1183 | // Initialize the AMP service. |
| 1184 | - new Wordlift_AMP_Service( $that->jsonld_service ); |
|
| 1184 | + new Wordlift_AMP_Service($that->jsonld_service); |
|
| 1185 | 1185 | |
| 1186 | 1186 | /** Services. */ |
| 1187 | 1187 | $that->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
| 1188 | 1188 | new Wordlift_Image_Service(); |
| 1189 | 1189 | |
| 1190 | 1190 | /** Adapters. */ |
| 1191 | - $that->entity_type_adapter = new Wordlift_Entity_Type_Adapter( Wordlift_Entity_Type_Service::get_instance() ); |
|
| 1192 | - $that->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $that->publisher_service ); |
|
| 1193 | - $that->tinymce_adapter = new Wordlift_Tinymce_Adapter( $that ); |
|
| 1191 | + $that->entity_type_adapter = new Wordlift_Entity_Type_Adapter(Wordlift_Entity_Type_Service::get_instance()); |
|
| 1192 | + $that->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter($that->publisher_service); |
|
| 1193 | + $that->tinymce_adapter = new Wordlift_Tinymce_Adapter($that); |
|
| 1194 | 1194 | |
| 1195 | 1195 | /* |
| 1196 | 1196 | * Exclude our public js from WP-Rocket. |
@@ -1210,14 +1210,14 @@ discard block |
||
| 1210 | 1210 | $that->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
| 1211 | 1211 | $that->country_select_element = new Wordlift_Admin_Country_Select_Element(); |
| 1212 | 1212 | $tabs_element = new Wordlift_Admin_Tabs_Element(); |
| 1213 | - $that->publisher_element = new Wordlift_Admin_Publisher_Element( $that->publisher_service, $tabs_element, $that->select2_element ); |
|
| 1214 | - $that->author_element = new Wordlift_Admin_Author_Element( $that->publisher_service, $that->select2_element ); |
|
| 1213 | + $that->publisher_element = new Wordlift_Admin_Publisher_Element($that->publisher_service, $tabs_element, $that->select2_element); |
|
| 1214 | + $that->author_element = new Wordlift_Admin_Author_Element($that->publisher_service, $that->select2_element); |
|
| 1215 | 1215 | |
| 1216 | 1216 | $that->settings_page = Wordlift_Admin_Settings_Page::get_instance(); |
| 1217 | - $that->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $that->settings_page ); |
|
| 1217 | + $that->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link($that->settings_page); |
|
| 1218 | 1218 | |
| 1219 | - $that->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page( $that->input_element, $that->radio_input_element ); |
|
| 1220 | - $that->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $that->analytics_settings_page ); |
|
| 1219 | + $that->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page($that->input_element, $that->radio_input_element); |
|
| 1220 | + $that->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link($that->analytics_settings_page); |
|
| 1221 | 1221 | $that->analytics_connect = new Wordlift_Analytics_Connect(); |
| 1222 | 1222 | |
| 1223 | 1223 | // Pages. |
@@ -1228,9 +1228,9 @@ discard block |
||
| 1228 | 1228 | * |
| 1229 | 1229 | * @see https://github.com/insideout10/wordlift-plugin/issues/914 |
| 1230 | 1230 | */ |
| 1231 | - if ( apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 1232 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1233 | - new Wordlift_Admin_Post_Edit_Page( $that ); |
|
| 1231 | + if (apply_filters('wl_can_see_classification_box', true)) { |
|
| 1232 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1233 | + new Wordlift_Admin_Post_Edit_Page($that); |
|
| 1234 | 1234 | } |
| 1235 | 1235 | new Wordlift_Entity_Type_Admin_Service(); |
| 1236 | 1236 | |
@@ -1238,19 +1238,19 @@ discard block |
||
| 1238 | 1238 | $that->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
| 1239 | 1239 | |
| 1240 | 1240 | // Create an instance of the install wizard. |
| 1241 | - $that->admin_setup = new Wordlift_Admin_Setup( $that->key_validation_service, Wordlift_Entity_Service::get_instance(), $that->language_select_element, $that->country_select_element ); |
|
| 1241 | + $that->admin_setup = new Wordlift_Admin_Setup($that->key_validation_service, Wordlift_Entity_Service::get_instance(), $that->language_select_element, $that->country_select_element); |
|
| 1242 | 1242 | |
| 1243 | - $that->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $that->entity_post_type_service ); |
|
| 1243 | + $that->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service($that->entity_post_type_service); |
|
| 1244 | 1244 | |
| 1245 | 1245 | // User Profile. |
| 1246 | - new Wordlift_Admin_User_Profile_Page( $that->author_element, $that->user_service ); |
|
| 1246 | + new Wordlift_Admin_User_Profile_Page($that->author_element, $that->user_service); |
|
| 1247 | 1247 | |
| 1248 | 1248 | $that->entity_page_service = new Wordlift_Entity_Page_Service(); |
| 1249 | 1249 | |
| 1250 | 1250 | // Load the debug service if WP is in debug mode. |
| 1251 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1252 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1253 | - new Wordlift_Debug_Service( Wordlift_Entity_Service::get_instance(), $uri_service ); |
|
| 1251 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
| 1252 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-debug-service.php'; |
|
| 1253 | + new Wordlift_Debug_Service(Wordlift_Entity_Service::get_instance(), $uri_service); |
|
| 1254 | 1254 | } |
| 1255 | 1255 | |
| 1256 | 1256 | // Remote Image Service. |
@@ -1263,12 +1263,12 @@ discard block |
||
| 1263 | 1263 | * |
| 1264 | 1264 | * @see https://github.com/insideout10/wordlift-plugin/issues/852. |
| 1265 | 1265 | */ |
| 1266 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php'; |
|
| 1267 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1268 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1266 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-batch-action.php'; |
|
| 1267 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1268 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1269 | 1269 | |
| 1270 | 1270 | // Create an instance of the Mapping Service and assign it to the Ajax Adapter. |
| 1271 | - new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) ); |
|
| 1271 | + new Wordlift_Mapping_Ajax_Adapter(new Wordlift_Mapping_Service(Wordlift_Entity_Type_Service::get_instance())); |
|
| 1272 | 1272 | |
| 1273 | 1273 | /* |
| 1274 | 1274 | * Load the Mappings JSON-LD post processing. |
@@ -1282,11 +1282,11 @@ discard block |
||
| 1282 | 1282 | // Taxonomy term rule validator for validating rules for term pages. |
| 1283 | 1283 | new Taxonomy_Term_Rule_Validator(); |
| 1284 | 1284 | new Post_Taxonomy_Term_Rule_Validator(); |
| 1285 | - $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator ); |
|
| 1286 | - $rule_groups_validator = new Rule_Groups_Validator( $rule_validators_registry ); |
|
| 1287 | - $mappings_validator = new Mappings_Validator( $mappings_dbo, $rule_groups_validator ); |
|
| 1285 | + $rule_validators_registry = new Rule_Validators_Registry($default_rule_validator); |
|
| 1286 | + $rule_groups_validator = new Rule_Groups_Validator($rule_validators_registry); |
|
| 1287 | + $mappings_validator = new Mappings_Validator($mappings_dbo, $rule_groups_validator); |
|
| 1288 | 1288 | |
| 1289 | - new Url_To_Entity_Transform_Function( $that->entity_uri_service ); |
|
| 1289 | + new Url_To_Entity_Transform_Function($that->entity_uri_service); |
|
| 1290 | 1290 | new Taxonomy_To_Terms_Transform_Function(); |
| 1291 | 1291 | new Post_Id_To_Entity_Transform_Function(); |
| 1292 | 1292 | $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry(); |
@@ -1296,7 +1296,7 @@ discard block |
||
| 1296 | 1296 | * Intiailize the acf group data formatter. |
| 1297 | 1297 | */ |
| 1298 | 1298 | new Acf_Group_Formatter(); |
| 1299 | - new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry ); |
|
| 1299 | + new Jsonld_Converter($mappings_validator, $mappings_transform_functions_registry); |
|
| 1300 | 1300 | |
| 1301 | 1301 | /** |
| 1302 | 1302 | * @since 3.26.0 |
@@ -1314,14 +1314,14 @@ discard block |
||
| 1314 | 1314 | // Call this static method to register FAQ routes to rest api - disabled |
| 1315 | 1315 | //Faq_Rest_Controller::register_routes(); |
| 1316 | 1316 | |
| 1317 | - $that->storage_factory = new Wordlift_Storage_Factory( Wordlift_Entity_Service::get_instance(), $that->user_service, $property_getter ); |
|
| 1317 | + $that->storage_factory = new Wordlift_Storage_Factory(Wordlift_Entity_Service::get_instance(), $that->user_service, $property_getter); |
|
| 1318 | 1318 | |
| 1319 | 1319 | /** WL Autocomplete. */ |
| 1320 | - $autocomplete_service = new All_Autocomplete_Service( array( |
|
| 1320 | + $autocomplete_service = new All_Autocomplete_Service(array( |
|
| 1321 | 1321 | new Local_Autocomplete_Service(), |
| 1322 | - new Linked_Data_Autocomplete_Service( Entity_Helper::get_instance(), $that->entity_uri_service, Wordlift_Entity_Service::get_instance() ), |
|
| 1323 | - ) ); |
|
| 1324 | - $that->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service ); |
|
| 1322 | + new Linked_Data_Autocomplete_Service(Entity_Helper::get_instance(), $that->entity_uri_service, Wordlift_Entity_Service::get_instance()), |
|
| 1323 | + )); |
|
| 1324 | + $that->autocomplete_adapter = new Wordlift_Autocomplete_Adapter($autocomplete_service); |
|
| 1325 | 1325 | |
| 1326 | 1326 | /** |
| 1327 | 1327 | * @since 3.27.2 |
@@ -1330,11 +1330,11 @@ discard block |
||
| 1330 | 1330 | */ |
| 1331 | 1331 | new Recipe_Maker_Post_Type_Hook(); |
| 1332 | 1332 | $recipe_maker_validation_service = Recipe_Maker_Validation_Service::get_instance(); |
| 1333 | - new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service ); |
|
| 1334 | - new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service ); |
|
| 1335 | - new Recipe_Maker_Jsonld_Swap( $recipe_maker_validation_service, $that->jsonld_service ); |
|
| 1336 | - new Recipe_Maker_Warning( $recipe_maker_validation_service ); |
|
| 1337 | - new Yoast_Jsonld( $recipe_maker_validation_service ); |
|
| 1333 | + new Recipe_Maker_Jsonld_Hook($attachment_service, $recipe_maker_validation_service); |
|
| 1334 | + new Recipe_Maker_After_Get_Jsonld_Hook($recipe_maker_validation_service); |
|
| 1335 | + new Recipe_Maker_Jsonld_Swap($recipe_maker_validation_service, $that->jsonld_service); |
|
| 1336 | + new Recipe_Maker_Warning($recipe_maker_validation_service); |
|
| 1337 | + new Yoast_Jsonld($recipe_maker_validation_service); |
|
| 1338 | 1338 | |
| 1339 | 1339 | /** |
| 1340 | 1340 | * @since 3.27.4 |
@@ -1351,7 +1351,7 @@ discard block |
||
| 1351 | 1351 | * @since 3.27.8 |
| 1352 | 1352 | * @see https://github.com/insideout10/wordlift-plugin/issues/1248 |
| 1353 | 1353 | */ |
| 1354 | - new Key_Validation_Notice( $that->key_validation_service, Wordlift_Configuration_Service::get_instance() ); |
|
| 1354 | + new Key_Validation_Notice($that->key_validation_service, Wordlift_Configuration_Service::get_instance()); |
|
| 1355 | 1355 | /** |
| 1356 | 1356 | * @since 3.28.0 |
| 1357 | 1357 | * @see https://github.com/insideout10/wordlift-plugin/issues?q=assignee%3Anaveen17797+is%3Aopen |
@@ -1362,7 +1362,7 @@ discard block |
||
| 1362 | 1362 | * @since 3.29.0 |
| 1363 | 1363 | * @see https://github.com/insideout10/wordlift-plugin/issues/1304 |
| 1364 | 1364 | */ |
| 1365 | - new Entity_Rest_Service( Wordlift_Entity_Type_Service::get_instance() ); |
|
| 1365 | + new Entity_Rest_Service(Wordlift_Entity_Type_Service::get_instance()); |
|
| 1366 | 1366 | |
| 1367 | 1367 | /** |
| 1368 | 1368 | * Expand author in to references. |
@@ -1371,12 +1371,12 @@ discard block |
||
| 1371 | 1371 | */ |
| 1372 | 1372 | |
| 1373 | 1373 | |
| 1374 | - if ( apply_filters( 'wl_feature__enable__article-wrapper', false ) ) { |
|
| 1375 | - new Jsonld_Article_Wrapper( Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter ); |
|
| 1374 | + if (apply_filters('wl_feature__enable__article-wrapper', false)) { |
|
| 1375 | + new Jsonld_Article_Wrapper(Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter); |
|
| 1376 | 1376 | } |
| 1377 | 1377 | |
| 1378 | 1378 | |
| 1379 | - if ( apply_filters( 'wl_feature__enable__match-terms', false ) ) { |
|
| 1379 | + if (apply_filters('wl_feature__enable__match-terms', false)) { |
|
| 1380 | 1380 | $vocabulary_loader = new Vocabulary_Loader(); |
| 1381 | 1381 | $vocabulary_loader->init_vocabulary(); |
| 1382 | 1382 | } |
@@ -1384,7 +1384,7 @@ discard block |
||
| 1384 | 1384 | /** |
| 1385 | 1385 | *Added for feature request 1496 (Webhooks) |
| 1386 | 1386 | */ |
| 1387 | - if ( apply_filters( 'wl_feature__enable__webhooks', false ) ) { |
|
| 1387 | + if (apply_filters('wl_feature__enable__webhooks', false)) { |
|
| 1388 | 1388 | $that->webhook_loader = new Webhooks_Loader(); |
| 1389 | 1389 | $that->webhook_loader->init(); |
| 1390 | 1390 | } |
@@ -1413,7 +1413,7 @@ discard block |
||
| 1413 | 1413 | * @since 3.31.5 |
| 1414 | 1414 | * Create configuration endpoint for webapp to configure. |
| 1415 | 1415 | */ |
| 1416 | - new Config( $that->admin_setup, $that->key_validation_service ); |
|
| 1416 | + new Config($that->admin_setup, $that->key_validation_service); |
|
| 1417 | 1417 | /** |
| 1418 | 1418 | * @since 3.31.7 |
| 1419 | 1419 | * Remove duplicate videoobject. |
@@ -1425,7 +1425,7 @@ discard block |
||
| 1425 | 1425 | * @since 3.32.0 |
| 1426 | 1426 | * Create loader for vocabulary terms. |
| 1427 | 1427 | */ |
| 1428 | - $vocabulary_terms_loader = new Vocabulary_Terms_Loader( Wordlift_Entity_Type_Service::get_instance(), $property_getter ); |
|
| 1428 | + $vocabulary_terms_loader = new Vocabulary_Terms_Loader(Wordlift_Entity_Type_Service::get_instance(), $property_getter); |
|
| 1429 | 1429 | $vocabulary_terms_loader->init_feature(); |
| 1430 | 1430 | |
| 1431 | 1431 | new Entity_Type_Change_Handler( |
@@ -1433,7 +1433,7 @@ discard block |
||
| 1433 | 1433 | Wordlift_Entity_Type_Service::get_instance() |
| 1434 | 1434 | ); |
| 1435 | 1435 | |
| 1436 | - }, 3 ); |
|
| 1436 | + }, 3); |
|
| 1437 | 1437 | |
| 1438 | 1438 | |
| 1439 | 1439 | new Entity_Type_Setter(); |
@@ -1453,9 +1453,9 @@ discard block |
||
| 1453 | 1453 | private function set_locale() { |
| 1454 | 1454 | |
| 1455 | 1455 | $plugin_i18n = new Wordlift_i18n(); |
| 1456 | - $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1456 | + $plugin_i18n->set_domain($this->get_plugin_name()); |
|
| 1457 | 1457 | |
| 1458 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1458 | + $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain'); |
|
| 1459 | 1459 | |
| 1460 | 1460 | } |
| 1461 | 1461 | |
@@ -1466,7 +1466,7 @@ discard block |
||
| 1466 | 1466 | * @since 1.0.0 |
| 1467 | 1467 | * @access private |
| 1468 | 1468 | */ |
| 1469 | - private function define_admin_hooks( $that ) { |
|
| 1469 | + private function define_admin_hooks($that) { |
|
| 1470 | 1470 | $plugin_admin = new |
| 1471 | 1471 | Wordlift_Admin( |
| 1472 | 1472 | $that->get_plugin_name(), |
@@ -1475,64 +1475,64 @@ discard block |
||
| 1475 | 1475 | $that->user_service |
| 1476 | 1476 | ); |
| 1477 | 1477 | |
| 1478 | - $that->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1479 | - $that->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 ); |
|
| 1478 | + $that->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles'); |
|
| 1479 | + $that->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11); |
|
| 1480 | 1480 | |
| 1481 | 1481 | // Hook the `admin_init` function to the Admin Setup. |
| 1482 | - Assertions::is_set( $that->admin_setup, '`admin_setup` must be set' ); |
|
| 1483 | - $that->loader->add_action( 'admin_init', $that->admin_setup, 'admin_init' ); |
|
| 1482 | + Assertions::is_set($that->admin_setup, '`admin_setup` must be set'); |
|
| 1483 | + $that->loader->add_action('admin_init', $that->admin_setup, 'admin_init'); |
|
| 1484 | 1484 | |
| 1485 | 1485 | // Hook the admin_init to the settings page. |
| 1486 | - Assertions::is_set( $that->settings_page, '`setting_page` must be set' ); |
|
| 1487 | - $that->loader->add_action( 'admin_init', $that->settings_page, 'admin_init' ); |
|
| 1486 | + Assertions::is_set($that->settings_page, '`setting_page` must be set'); |
|
| 1487 | + $that->loader->add_action('admin_init', $that->settings_page, 'admin_init'); |
|
| 1488 | 1488 | |
| 1489 | 1489 | // Hook the admin_init to the analytics settings page. |
| 1490 | - Assertions::is_set( $that->analytics_settings_page, '`analytics_setting_page` must be set' ); |
|
| 1491 | - $that->loader->add_action( 'admin_init', $that->analytics_settings_page, 'admin_init' ); |
|
| 1490 | + Assertions::is_set($that->analytics_settings_page, '`analytics_setting_page` must be set'); |
|
| 1491 | + $that->loader->add_action('admin_init', $that->analytics_settings_page, 'admin_init'); |
|
| 1492 | 1492 | |
| 1493 | 1493 | // Hook the init action to taxonomy services. |
| 1494 | - $that->loader->add_action( 'init', $that->topic_taxonomy_service, 'init', 0 ); |
|
| 1495 | - $that->loader->add_action( 'init', $that->entity_types_taxonomy_service, 'init', 0 ); |
|
| 1494 | + $that->loader->add_action('init', $that->topic_taxonomy_service, 'init', 0); |
|
| 1495 | + $that->loader->add_action('init', $that->entity_types_taxonomy_service, 'init', 0); |
|
| 1496 | 1496 | |
| 1497 | 1497 | // Hook the AJAX wl_timeline action to the Timeline service. |
| 1498 | - $that->loader->add_action( 'wp_ajax_wl_timeline', $that->timeline_service, 'ajax_timeline' ); |
|
| 1498 | + $that->loader->add_action('wp_ajax_wl_timeline', $that->timeline_service, 'ajax_timeline'); |
|
| 1499 | 1499 | |
| 1500 | 1500 | // Register custom allowed redirect hosts. |
| 1501 | - $that->loader->add_filter( 'allowed_redirect_hosts', $that->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1501 | + $that->loader->add_filter('allowed_redirect_hosts', $that->redirect_service, 'allowed_redirect_hosts'); |
|
| 1502 | 1502 | // Hook the AJAX wordlift_redirect action to the Redirect service. |
| 1503 | - $that->loader->add_action( 'wp_ajax_wordlift_redirect', $that->redirect_service, 'ajax_redirect' ); |
|
| 1503 | + $that->loader->add_action('wp_ajax_wordlift_redirect', $that->redirect_service, 'ajax_redirect'); |
|
| 1504 | 1504 | |
| 1505 | 1505 | // Hook save_post to the entity service to update custom fields (such as alternate labels). |
| 1506 | 1506 | // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
| 1507 | - $that->loader->add_action( 'save_post', Wordlift_Entity_Service::get_instance(), 'save_post', 9, 3 ); |
|
| 1508 | - $that->loader->add_action( 'save_post', $that->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1507 | + $that->loader->add_action('save_post', Wordlift_Entity_Service::get_instance(), 'save_post', 9, 3); |
|
| 1508 | + $that->loader->add_action('save_post', $that->rating_service, 'set_rating_for', 20, 1); |
|
| 1509 | 1509 | |
| 1510 | - $that->loader->add_action( 'edit_form_before_permalink', Wordlift_Entity_Service::get_instance(), 'edit_form_before_permalink', 10, 1 ); |
|
| 1511 | - $that->loader->add_action( 'in_admin_header', $that->rating_service, 'in_admin_header' ); |
|
| 1510 | + $that->loader->add_action('edit_form_before_permalink', Wordlift_Entity_Service::get_instance(), 'edit_form_before_permalink', 10, 1); |
|
| 1511 | + $that->loader->add_action('in_admin_header', $that->rating_service, 'in_admin_header'); |
|
| 1512 | 1512 | |
| 1513 | 1513 | // Entity listing customization (wp-admin/edit.php) |
| 1514 | 1514 | // Add custom columns. |
| 1515 | - $that->loader->add_filter( 'manage_entity_posts_columns', $that->entity_list_service, 'register_custom_columns' ); |
|
| 1515 | + $that->loader->add_filter('manage_entity_posts_columns', $that->entity_list_service, 'register_custom_columns'); |
|
| 1516 | 1516 | // no explicit entity as it prevents handling of other post types. |
| 1517 | - $that->loader->add_filter( 'manage_posts_custom_column', $that->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1517 | + $that->loader->add_filter('manage_posts_custom_column', $that->entity_list_service, 'render_custom_columns', 10, 2); |
|
| 1518 | 1518 | // Add 4W selection. |
| 1519 | - $that->loader->add_action( 'restrict_manage_posts', $that->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1520 | - $that->loader->add_filter( 'posts_clauses', $that->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1521 | - $that->loader->add_action( 'pre_get_posts', $that->entity_list_service, 'pre_get_posts' ); |
|
| 1522 | - $that->loader->add_action( 'load-edit.php', $that->entity_list_service, 'load_edit' ); |
|
| 1519 | + $that->loader->add_action('restrict_manage_posts', $that->entity_list_service, 'restrict_manage_posts_classification_scope'); |
|
| 1520 | + $that->loader->add_filter('posts_clauses', $that->entity_list_service, 'posts_clauses_classification_scope'); |
|
| 1521 | + $that->loader->add_action('pre_get_posts', $that->entity_list_service, 'pre_get_posts'); |
|
| 1522 | + $that->loader->add_action('load-edit.php', $that->entity_list_service, 'load_edit'); |
|
| 1523 | 1523 | |
| 1524 | 1524 | /* |
| 1525 | 1525 | * If `All Entity Types` is disable, use the radio button Walker. |
| 1526 | 1526 | * |
| 1527 | 1527 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1528 | 1528 | */ |
| 1529 | - if ( ! WL_ALL_ENTITY_TYPES ) { |
|
| 1530 | - $that->loader->add_filter( 'wp_terms_checklist_args', $that->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1529 | + if ( ! WL_ALL_ENTITY_TYPES) { |
|
| 1530 | + $that->loader->add_filter('wp_terms_checklist_args', $that->entity_types_taxonomy_walker, 'terms_checklist_args'); |
|
| 1531 | 1531 | } |
| 1532 | 1532 | |
| 1533 | 1533 | // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
| 1534 | 1534 | // entities. |
| 1535 | - $that->loader->add_filter( 'prima_metabox_entity_header_args', $that->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1535 | + $that->loader->add_filter('prima_metabox_entity_header_args', $that->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2); |
|
| 1536 | 1536 | |
| 1537 | 1537 | /** |
| 1538 | 1538 | * Filter: wl_feature__enable__settings-download. |
@@ -1542,27 +1542,27 @@ discard block |
||
| 1542 | 1542 | * @return bool |
| 1543 | 1543 | * @since 3.27.6 |
| 1544 | 1544 | */ |
| 1545 | - $that->features_registry->register_feature_from_slug( 'settings-download', true, array( |
|
| 1545 | + $that->features_registry->register_feature_from_slug('settings-download', true, array( |
|
| 1546 | 1546 | $that, |
| 1547 | 1547 | 'register_screens' |
| 1548 | - ) ); |
|
| 1548 | + )); |
|
| 1549 | 1549 | |
| 1550 | 1550 | |
| 1551 | 1551 | // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
| 1552 | - $that->loader->add_action( 'wp_ajax_wl_download_your_data', $that->download_your_data_page, 'download_your_data', 10 ); |
|
| 1552 | + $that->loader->add_action('wp_ajax_wl_download_your_data', $that->download_your_data_page, 'download_your_data', 10); |
|
| 1553 | 1553 | |
| 1554 | 1554 | // Hook the AJAX wl_jsonld action to the JSON-LD service. |
| 1555 | - $that->loader->add_action( 'wp_ajax_wl_jsonld', $that->jsonld_service, 'get' ); |
|
| 1556 | - $that->loader->add_action( 'admin_post_wl_jsonld', $that->jsonld_service, 'get' ); |
|
| 1557 | - $that->loader->add_action( 'admin_post_nopriv_wl_jsonld', $that->jsonld_service, 'get' ); |
|
| 1555 | + $that->loader->add_action('wp_ajax_wl_jsonld', $that->jsonld_service, 'get'); |
|
| 1556 | + $that->loader->add_action('admin_post_wl_jsonld', $that->jsonld_service, 'get'); |
|
| 1557 | + $that->loader->add_action('admin_post_nopriv_wl_jsonld', $that->jsonld_service, 'get'); |
|
| 1558 | 1558 | |
| 1559 | 1559 | // Hook the AJAX wl_validate_key action to the Key Validation service. |
| 1560 | - $that->loader->add_action( 'wp_ajax_wl_validate_key', $that->key_validation_service, 'validate_key' ); |
|
| 1560 | + $that->loader->add_action('wp_ajax_wl_validate_key', $that->key_validation_service, 'validate_key'); |
|
| 1561 | 1561 | |
| 1562 | 1562 | // Hook the AJAX wl_update_country_options action to the countries. |
| 1563 | - $that->loader->add_action( 'wp_ajax_wl_update_country_options', $that->country_select_element, 'get_options_html' ); |
|
| 1563 | + $that->loader->add_action('wp_ajax_wl_update_country_options', $that->country_select_element, 'get_options_html'); |
|
| 1564 | 1564 | |
| 1565 | - $that->loader->add_filter( 'admin_post_thumbnail_html', $that->publisher_service, 'add_featured_image_instruction' ); |
|
| 1565 | + $that->loader->add_filter('admin_post_thumbnail_html', $that->publisher_service, 'add_featured_image_instruction'); |
|
| 1566 | 1566 | |
| 1567 | 1567 | // Hook the menu creation on the general wordlift menu creation. |
| 1568 | 1568 | /** |
@@ -1575,16 +1575,16 @@ discard block |
||
| 1575 | 1575 | * |
| 1576 | 1576 | * Since 3.30.0 this feature is registered using registry. |
| 1577 | 1577 | */ |
| 1578 | - if ( apply_filters( 'wl_feature__enable__settings-screen', true ) || Admin_User_Option::is_wordlift_admin() ) { |
|
| 1579 | - add_action( 'wl_admin_menu', array( $that->settings_page, 'admin_menu' ), 10, 2 ); |
|
| 1578 | + if (apply_filters('wl_feature__enable__settings-screen', true) || Admin_User_Option::is_wordlift_admin()) { |
|
| 1579 | + add_action('wl_admin_menu', array($that->settings_page, 'admin_menu'), 10, 2); |
|
| 1580 | 1580 | } |
| 1581 | 1581 | |
| 1582 | 1582 | // Hook key update. |
| 1583 | - $that->loader->add_action( 'pre_update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1584 | - $that->loader->add_action( 'update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'update_key', 10, 2 ); |
|
| 1583 | + $that->loader->add_action('pre_update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'maybe_update_dataset_uri', 10, 2); |
|
| 1584 | + $that->loader->add_action('update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'update_key', 10, 2); |
|
| 1585 | 1585 | |
| 1586 | 1586 | // Add additional action links to the WordLift plugin in the plugins page. |
| 1587 | - $that->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $that->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1587 | + $that->loader->add_filter('plugin_action_links_wordlift/wordlift.php', $that->settings_page_action_link, 'action_links', 10, 1); |
|
| 1588 | 1588 | |
| 1589 | 1589 | /* |
| 1590 | 1590 | * Remove the Analytics Settings link from the plugin page. |
@@ -1595,23 +1595,23 @@ discard block |
||
| 1595 | 1595 | // $that->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $that->analytics_settings_page_action_link, 'action_links', 10, 1 ); |
| 1596 | 1596 | |
| 1597 | 1597 | // Hook the AJAX `wl_publisher` action name. |
| 1598 | - $that->loader->add_action( 'wp_ajax_wl_publisher', $that->publisher_ajax_adapter, 'publisher' ); |
|
| 1598 | + $that->loader->add_action('wp_ajax_wl_publisher', $that->publisher_ajax_adapter, 'publisher'); |
|
| 1599 | 1599 | |
| 1600 | 1600 | // Hook row actions for the entity type list admin. |
| 1601 | - $that->loader->add_filter( 'wl_entity_type_row_actions', $that->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1601 | + $that->loader->add_filter('wl_entity_type_row_actions', $that->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2); |
|
| 1602 | 1602 | |
| 1603 | 1603 | /** Ajax actions. */ |
| 1604 | - $that->loader->add_action( 'wp_ajax_wl_google_analytics_export', $that->google_analytics_export_service, 'export' ); |
|
| 1604 | + $that->loader->add_action('wp_ajax_wl_google_analytics_export', $that->google_analytics_export_service, 'export'); |
|
| 1605 | 1605 | |
| 1606 | 1606 | // Hook capabilities manipulation to allow access to entity type admin |
| 1607 | 1607 | // page on WordPress versions before 4.7. |
| 1608 | 1608 | global $wp_version; |
| 1609 | - if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1610 | - $that->loader->add_filter( 'map_meta_cap', $that->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1609 | + if (version_compare($wp_version, '4.7', '<')) { |
|
| 1610 | + $that->loader->add_filter('map_meta_cap', $that->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4); |
|
| 1611 | 1611 | } |
| 1612 | 1612 | |
| 1613 | 1613 | /** Adapters. */ |
| 1614 | - $that->loader->add_filter( 'mce_external_plugins', $that->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1614 | + $that->loader->add_filter('mce_external_plugins', $that->tinymce_adapter, 'mce_external_plugins', 10, 1); |
|
| 1615 | 1615 | /** |
| 1616 | 1616 | * Disabling Faq temporarily. |
| 1617 | 1617 | * Load the tinymce editor button on the tool bar. |
@@ -1622,54 +1622,54 @@ discard block |
||
| 1622 | 1622 | //$that->loader->add_filter( 'mce_external_plugins', $that->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 ); |
| 1623 | 1623 | |
| 1624 | 1624 | |
| 1625 | - $that->loader->add_action( 'wp_ajax_wl_sample_data_create', $that->sample_data_ajax_adapter, 'create' ); |
|
| 1626 | - $that->loader->add_action( 'wp_ajax_wl_sample_data_delete', $that->sample_data_ajax_adapter, 'delete' ); |
|
| 1625 | + $that->loader->add_action('wp_ajax_wl_sample_data_create', $that->sample_data_ajax_adapter, 'create'); |
|
| 1626 | + $that->loader->add_action('wp_ajax_wl_sample_data_delete', $that->sample_data_ajax_adapter, 'delete'); |
|
| 1627 | 1627 | |
| 1628 | 1628 | /** |
| 1629 | 1629 | * @since 3.26.0 |
| 1630 | 1630 | */ |
| 1631 | 1631 | $excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter(); |
| 1632 | - $that->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' ); |
|
| 1632 | + $that->loader->add_action('do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box'); |
|
| 1633 | 1633 | // Adding Rest route for the post excerpt |
| 1634 | 1634 | Post_Excerpt_Rest_Controller::register_routes(); |
| 1635 | 1635 | |
| 1636 | 1636 | // Handle the autocomplete request. |
| 1637 | - add_action( 'wp_ajax_wl_autocomplete', array( |
|
| 1637 | + add_action('wp_ajax_wl_autocomplete', array( |
|
| 1638 | 1638 | $that->autocomplete_adapter, |
| 1639 | 1639 | 'wl_autocomplete', |
| 1640 | - ) ); |
|
| 1641 | - add_action( 'wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1640 | + )); |
|
| 1641 | + add_action('wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1642 | 1642 | $that->autocomplete_adapter, |
| 1643 | 1643 | 'wl_autocomplete', |
| 1644 | - ) ); |
|
| 1644 | + )); |
|
| 1645 | 1645 | |
| 1646 | 1646 | // Hooks to restrict multisite super admin from manipulating entity types. |
| 1647 | - if ( is_multisite() ) { |
|
| 1648 | - $that->loader->add_filter( 'map_meta_cap', $that->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1647 | + if (is_multisite()) { |
|
| 1648 | + $that->loader->add_filter('map_meta_cap', $that->entity_type_admin_page, 'restrict_super_admin', 10, 4); |
|
| 1649 | 1649 | } |
| 1650 | 1650 | |
| 1651 | 1651 | $deactivator_feedback = new Wordlift_Deactivator_Feedback(); |
| 1652 | 1652 | |
| 1653 | - add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) ); |
|
| 1654 | - add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) ); |
|
| 1655 | - add_action( 'wp_ajax_wl_deactivation_feedback', array( |
|
| 1653 | + add_action('admin_footer', array($deactivator_feedback, 'render_feedback_popup')); |
|
| 1654 | + add_action('admin_enqueue_scripts', array($deactivator_feedback, 'enqueue_popup_scripts')); |
|
| 1655 | + add_action('wp_ajax_wl_deactivation_feedback', array( |
|
| 1656 | 1656 | $deactivator_feedback, |
| 1657 | 1657 | 'wl_deactivation_feedback' |
| 1658 | - ) ); |
|
| 1658 | + )); |
|
| 1659 | 1659 | |
| 1660 | 1660 | /** |
| 1661 | 1661 | * Always allow the `wordlift/classification` block. |
| 1662 | 1662 | * |
| 1663 | 1663 | * @since 3.23.0 |
| 1664 | 1664 | */ |
| 1665 | - add_filter( 'allowed_block_types', function ( $value ) { |
|
| 1665 | + add_filter('allowed_block_types', function($value) { |
|
| 1666 | 1666 | |
| 1667 | - if ( true === $value ) { |
|
| 1667 | + if (true === $value) { |
|
| 1668 | 1668 | return $value; |
| 1669 | 1669 | } |
| 1670 | 1670 | |
| 1671 | - return array_merge( (array) $value, array( 'wordlift/classification' ) ); |
|
| 1672 | - }, PHP_INT_MAX ); |
|
| 1671 | + return array_merge((array) $value, array('wordlift/classification')); |
|
| 1672 | + }, PHP_INT_MAX); |
|
| 1673 | 1673 | |
| 1674 | 1674 | /** |
| 1675 | 1675 | * @since 3.27.7 |
@@ -1686,58 +1686,58 @@ discard block |
||
| 1686 | 1686 | * @since 1.0.0 |
| 1687 | 1687 | * @access private |
| 1688 | 1688 | */ |
| 1689 | - private function define_public_hooks( $that ) { |
|
| 1689 | + private function define_public_hooks($that) { |
|
| 1690 | 1690 | |
| 1691 | - $plugin_public = new Wordlift_Public( $that->get_plugin_name(), $that->get_version() ); |
|
| 1691 | + $plugin_public = new Wordlift_Public($that->get_plugin_name(), $that->get_version()); |
|
| 1692 | 1692 | |
| 1693 | 1693 | // Register the entity post type. |
| 1694 | - $that->loader->add_action( 'init', $that->entity_post_type_service, 'register' ); |
|
| 1694 | + $that->loader->add_action('init', $that->entity_post_type_service, 'register'); |
|
| 1695 | 1695 | |
| 1696 | 1696 | // Bind the link generation and handling hooks to the entity link service. |
| 1697 | - $that->loader->add_filter( 'post_type_link', $that->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1698 | - $that->loader->add_action( 'pre_get_posts', $that->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1697 | + $that->loader->add_filter('post_type_link', $that->entity_link_service, 'post_type_link', 10, 4); |
|
| 1698 | + $that->loader->add_action('pre_get_posts', $that->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1); |
|
| 1699 | 1699 | // $that->loader->add_filter( 'wp_unique_post_slug_is_bad_flat_slug', $that->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3 ); |
| 1700 | 1700 | // $that->loader->add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', $that->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4 ); |
| 1701 | 1701 | |
| 1702 | - $that->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1703 | - $that->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1704 | - $that->loader->add_action( 'wp_enqueue_scripts', $that->context_cards_service, 'enqueue_scripts' ); |
|
| 1702 | + $that->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles'); |
|
| 1703 | + $that->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts'); |
|
| 1704 | + $that->loader->add_action('wp_enqueue_scripts', $that->context_cards_service, 'enqueue_scripts'); |
|
| 1705 | 1705 | |
| 1706 | 1706 | // Registering Faq_Content_Filter service used for removing faq question and answer tags from the html. |
| 1707 | - $that->loader->add_filter( 'the_content', $that->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' ); |
|
| 1707 | + $that->loader->add_filter('the_content', $that->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags'); |
|
| 1708 | 1708 | // Hook the content filter service to add entity links. |
| 1709 | - if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) { |
|
| 1710 | - $that->loader->add_filter( 'the_content', $that->content_filter_service, 'the_content' ); |
|
| 1709 | + if ( ! defined('WL_DISABLE_CONTENT_FILTER') || ! WL_DISABLE_CONTENT_FILTER) { |
|
| 1710 | + $that->loader->add_filter('the_content', $that->content_filter_service, 'the_content'); |
|
| 1711 | 1711 | } |
| 1712 | 1712 | |
| 1713 | 1713 | // Hook the AJAX wl_timeline action to the Timeline service. |
| 1714 | - $that->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $that->timeline_service, 'ajax_timeline' ); |
|
| 1714 | + $that->loader->add_action('wp_ajax_nopriv_wl_timeline', $that->timeline_service, 'ajax_timeline'); |
|
| 1715 | 1715 | |
| 1716 | 1716 | // Hook the ShareThis service. |
| 1717 | - $that->loader->add_filter( 'the_content', $that->sharethis_service, 'the_content', 99 ); |
|
| 1718 | - $that->loader->add_filter( 'the_excerpt', $that->sharethis_service, 'the_excerpt', 99 ); |
|
| 1717 | + $that->loader->add_filter('the_content', $that->sharethis_service, 'the_content', 99); |
|
| 1718 | + $that->loader->add_filter('the_excerpt', $that->sharethis_service, 'the_excerpt', 99); |
|
| 1719 | 1719 | |
| 1720 | 1720 | // Hook the AJAX wl_jsonld action to the JSON-LD service. |
| 1721 | - $that->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $that->jsonld_service, 'get' ); |
|
| 1721 | + $that->loader->add_action('wp_ajax_nopriv_wl_jsonld', $that->jsonld_service, 'get'); |
|
| 1722 | 1722 | |
| 1723 | 1723 | // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
| 1724 | 1724 | // in order to tweak WP's `WP_Query` to include entities in queries related |
| 1725 | 1725 | // to categories. |
| 1726 | - $that->loader->add_action( 'pre_get_posts', $that->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1726 | + $that->loader->add_action('pre_get_posts', $that->category_taxonomy_service, 'pre_get_posts', 10, 1); |
|
| 1727 | 1727 | |
| 1728 | 1728 | /* |
| 1729 | 1729 | * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service` |
| 1730 | 1730 | * in order to tweak WP's `WP_Query` to show event related entities in reverse |
| 1731 | 1731 | * order of start time. |
| 1732 | 1732 | */ |
| 1733 | - $that->loader->add_action( 'pre_get_posts', $that->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1733 | + $that->loader->add_action('pre_get_posts', $that->entity_page_service, 'pre_get_posts', 10, 1); |
|
| 1734 | 1734 | |
| 1735 | 1735 | // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
| 1736 | - $that->loader->add_action( 'save_post', $that->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1736 | + $that->loader->add_action('save_post', $that->entity_type_adapter, 'save_post', 9, 3); |
|
| 1737 | 1737 | |
| 1738 | 1738 | // Analytics Script Frontend. |
| 1739 | - if ( apply_filters( 'wl_feature__enable__analytics', true ) && Wordlift_Configuration_Service::get_instance()->is_analytics_enable() ) { |
|
| 1740 | - $that->loader->add_action( 'wp_enqueue_scripts', $that->analytics_connect, 'enqueue_scripts', 10 ); |
|
| 1739 | + if (apply_filters('wl_feature__enable__analytics', true) && Wordlift_Configuration_Service::get_instance()->is_analytics_enable()) { |
|
| 1740 | + $that->loader->add_action('wp_enqueue_scripts', $that->analytics_connect, 'enqueue_scripts', 10); |
|
| 1741 | 1741 | } |
| 1742 | 1742 | |
| 1743 | 1743 | } |
@@ -1802,7 +1802,7 @@ discard block |
||
| 1802 | 1802 | * @since 3.27.6 |
| 1803 | 1803 | */ |
| 1804 | 1804 | |
| 1805 | - wp_register_script( 'wl_enabled_blocks', false ); |
|
| 1805 | + wp_register_script('wl_enabled_blocks', false); |
|
| 1806 | 1806 | |
| 1807 | 1807 | $enabled_blocks = array(); |
| 1808 | 1808 | |
@@ -1810,13 +1810,13 @@ discard block |
||
| 1810 | 1810 | * Filter name: wl_feature__enable__product-navigator |
| 1811 | 1811 | * @since 3.32.3 |
| 1812 | 1812 | */ |
| 1813 | - if ( apply_filters( 'wl_feature__enable__product-navigator', true ) ) { |
|
| 1813 | + if (apply_filters('wl_feature__enable__product-navigator', true)) { |
|
| 1814 | 1814 | $enabled_blocks[] = 'wordlift/products-navigator'; |
| 1815 | 1815 | } |
| 1816 | 1816 | |
| 1817 | - if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 1817 | + if (apply_filters('wl_feature__enable__blocks', true)) { |
|
| 1818 | 1818 | // To intimate JS |
| 1819 | - $enabled_blocks = array_merge( $enabled_blocks, array( |
|
| 1819 | + $enabled_blocks = array_merge($enabled_blocks, array( |
|
| 1820 | 1820 | 'wordlift/navigator', |
| 1821 | 1821 | 'wordlift/chord', |
| 1822 | 1822 | 'wordlift/geomap', |
@@ -1824,11 +1824,11 @@ discard block |
||
| 1824 | 1824 | 'wordlift/cloud', |
| 1825 | 1825 | 'wordlift/vocabulary', |
| 1826 | 1826 | 'wordlift/faceted-search' |
| 1827 | - ) ); |
|
| 1827 | + )); |
|
| 1828 | 1828 | } |
| 1829 | 1829 | |
| 1830 | - wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks ); |
|
| 1831 | - wp_enqueue_script( 'wl_enabled_blocks' ); |
|
| 1830 | + wp_localize_script('wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks); |
|
| 1831 | + wp_enqueue_script('wl_enabled_blocks'); |
|
| 1832 | 1832 | } |
| 1833 | 1833 | |
| 1834 | 1834 | /** |
@@ -1836,13 +1836,13 @@ discard block |
||
| 1836 | 1836 | */ |
| 1837 | 1837 | public function register_screens() { |
| 1838 | 1838 | // Hook the menu to the Download Your Data page. |
| 1839 | - if ( apply_filters( 'wl_feature__enable__settings-download', true ) ) { |
|
| 1840 | - Assertions::is_set( $this->download_your_data_page, "`download_your_data_page` can't be null" ); |
|
| 1841 | - add_action( 'admin_menu', array( $this->download_your_data_page, 'admin_menu' ), 100, 0 ); |
|
| 1839 | + if (apply_filters('wl_feature__enable__settings-download', true)) { |
|
| 1840 | + Assertions::is_set($this->download_your_data_page, "`download_your_data_page` can't be null"); |
|
| 1841 | + add_action('admin_menu', array($this->download_your_data_page, 'admin_menu'), 100, 0); |
|
| 1842 | 1842 | } |
| 1843 | 1843 | |
| 1844 | - Assertions::is_set( $this->entity_type_settings_admin_page, "`entity_type_settings_admin_page` can't be null" ); |
|
| 1845 | - add_action( 'admin_menu', array( $this->entity_type_settings_admin_page, 'admin_menu' ), 100, 0 ); |
|
| 1844 | + Assertions::is_set($this->entity_type_settings_admin_page, "`entity_type_settings_admin_page` can't be null"); |
|
| 1845 | + add_action('admin_menu', array($this->entity_type_settings_admin_page, 'admin_menu'), 100, 0); |
|
| 1846 | 1846 | |
| 1847 | 1847 | } |
| 1848 | 1848 | |
@@ -7,75 +7,75 @@ |
||
| 7 | 7 | */ |
| 8 | 8 | class Recipe_Maker_Validation_Service { |
| 9 | 9 | |
| 10 | - private function __construct() { |
|
| 10 | + private function __construct() { |
|
| 11 | 11 | |
| 12 | - } |
|
| 12 | + } |
|
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * @var Recipe_Maker_Validation_Service |
|
| 16 | - */ |
|
| 17 | - private static $instance; |
|
| 14 | + /** |
|
| 15 | + * @var Recipe_Maker_Validation_Service |
|
| 16 | + */ |
|
| 17 | + private static $instance; |
|
| 18 | 18 | |
| 19 | - public static function get_instance() { |
|
| 19 | + public static function get_instance() { |
|
| 20 | 20 | |
| 21 | - if ( ! isset( self::$instance ) ) { |
|
| 22 | - self::$instance = new self(); |
|
| 23 | - } |
|
| 21 | + if ( ! isset( self::$instance ) ) { |
|
| 22 | + self::$instance = new self(); |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - return self::$instance; |
|
| 26 | - } |
|
| 25 | + return self::$instance; |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | - public function is_atleast_once_recipe_present_in_the_post( $post_id ) { |
|
| 28 | + public function is_atleast_once_recipe_present_in_the_post( $post_id ) { |
|
| 29 | 29 | |
| 30 | - if ( ! $this->is_wp_recipe_maker_available() ) { |
|
| 31 | - return false; |
|
| 32 | - } |
|
| 33 | - $recipe_ids = \WPRM_Recipe_Manager::get_recipe_ids_from_post( $post_id ); |
|
| 30 | + if ( ! $this->is_wp_recipe_maker_available() ) { |
|
| 31 | + return false; |
|
| 32 | + } |
|
| 33 | + $recipe_ids = \WPRM_Recipe_Manager::get_recipe_ids_from_post( $post_id ); |
|
| 34 | 34 | |
| 35 | - return is_array( $recipe_ids ) ? count( $recipe_ids ) > 0 : false; |
|
| 36 | - } |
|
| 35 | + return is_array( $recipe_ids ) ? count( $recipe_ids ) > 0 : false; |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - public function is_wp_recipe_maker_available() { |
|
| 39 | - /** |
|
| 40 | - * Dont alter the jsonld if the classes are not present. |
|
| 41 | - */ |
|
| 42 | - if ( ! class_exists( '\WPRM_Recipe_Manager' ) || ! class_exists( 'WPRM_Metadata' ) ) { |
|
| 43 | - return false; |
|
| 44 | - } |
|
| 45 | - if ( ! method_exists( '\WPRM_Recipe_Manager', 'get_recipe_ids_from_post' ) || |
|
| 46 | - ! method_exists( '\WPRM_Recipe_Manager', 'get_recipe' ) || |
|
| 47 | - ! method_exists( '\WPRM_Metadata', 'get_metadata_details' ) |
|
| 48 | - ) { |
|
| 49 | - return false; |
|
| 50 | - } |
|
| 38 | + public function is_wp_recipe_maker_available() { |
|
| 39 | + /** |
|
| 40 | + * Dont alter the jsonld if the classes are not present. |
|
| 41 | + */ |
|
| 42 | + if ( ! class_exists( '\WPRM_Recipe_Manager' ) || ! class_exists( 'WPRM_Metadata' ) ) { |
|
| 43 | + return false; |
|
| 44 | + } |
|
| 45 | + if ( ! method_exists( '\WPRM_Recipe_Manager', 'get_recipe_ids_from_post' ) || |
|
| 46 | + ! method_exists( '\WPRM_Recipe_Manager', 'get_recipe' ) || |
|
| 47 | + ! method_exists( '\WPRM_Metadata', 'get_metadata_details' ) |
|
| 48 | + ) { |
|
| 49 | + return false; |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - return true; |
|
| 53 | - } |
|
| 52 | + return true; |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | 55 | |
| 56 | - public function is_yoast_active() { |
|
| 57 | - return defined( 'WPSEO_VERSION' ); |
|
| 58 | - } |
|
| 56 | + public function is_yoast_active() { |
|
| 57 | + return defined( 'WPSEO_VERSION' ); |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | 60 | |
| 61 | - public function is_recipe_maker_yoast_integration_on() { |
|
| 61 | + public function is_recipe_maker_yoast_integration_on() { |
|
| 62 | 62 | |
| 63 | - if ( ! class_exists( '\WPRM_Settings' ) ) { |
|
| 64 | - return false; |
|
| 65 | - } |
|
| 63 | + if ( ! class_exists( '\WPRM_Settings' ) ) { |
|
| 64 | + return false; |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | - return \WPRM_Settings::get( 'yoast_seo_integration' ) && interface_exists( 'WPSEO_Graph_Piece' ); |
|
| 68 | - } |
|
| 67 | + return \WPRM_Settings::get( 'yoast_seo_integration' ) && interface_exists( 'WPSEO_Graph_Piece' ); |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | - public function can_integrate_with_yoast_jsonld( $post_id ) { |
|
| 71 | - return is_singular() |
|
| 72 | - // No Mentions on home page. |
|
| 73 | - && ! is_home() |
|
| 74 | - && $this->is_yoast_active() |
|
| 75 | - && $this->is_wp_recipe_maker_available() |
|
| 76 | - && $this->is_recipe_maker_yoast_integration_on() |
|
| 77 | - && $this->is_atleast_once_recipe_present_in_the_post( $post_id ); |
|
| 78 | - } |
|
| 70 | + public function can_integrate_with_yoast_jsonld( $post_id ) { |
|
| 71 | + return is_singular() |
|
| 72 | + // No Mentions on home page. |
|
| 73 | + && ! is_home() |
|
| 74 | + && $this->is_yoast_active() |
|
| 75 | + && $this->is_wp_recipe_maker_available() |
|
| 76 | + && $this->is_recipe_maker_yoast_integration_on() |
|
| 77 | + && $this->is_atleast_once_recipe_present_in_the_post( $post_id ); |
|
| 78 | + } |
|
| 79 | 79 | |
| 80 | 80 | |
| 81 | 81 | } |
@@ -18,33 +18,33 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | public static function get_instance() { |
| 20 | 20 | |
| 21 | - if ( ! isset( self::$instance ) ) { |
|
| 21 | + if ( ! isset(self::$instance)) { |
|
| 22 | 22 | self::$instance = new self(); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | return self::$instance; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - public function is_atleast_once_recipe_present_in_the_post( $post_id ) { |
|
| 28 | + public function is_atleast_once_recipe_present_in_the_post($post_id) { |
|
| 29 | 29 | |
| 30 | - if ( ! $this->is_wp_recipe_maker_available() ) { |
|
| 30 | + if ( ! $this->is_wp_recipe_maker_available()) { |
|
| 31 | 31 | return false; |
| 32 | 32 | } |
| 33 | - $recipe_ids = \WPRM_Recipe_Manager::get_recipe_ids_from_post( $post_id ); |
|
| 33 | + $recipe_ids = \WPRM_Recipe_Manager::get_recipe_ids_from_post($post_id); |
|
| 34 | 34 | |
| 35 | - return is_array( $recipe_ids ) ? count( $recipe_ids ) > 0 : false; |
|
| 35 | + return is_array($recipe_ids) ? count($recipe_ids) > 0 : false; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | public function is_wp_recipe_maker_available() { |
| 39 | 39 | /** |
| 40 | 40 | * Dont alter the jsonld if the classes are not present. |
| 41 | 41 | */ |
| 42 | - if ( ! class_exists( '\WPRM_Recipe_Manager' ) || ! class_exists( 'WPRM_Metadata' ) ) { |
|
| 42 | + if ( ! class_exists('\WPRM_Recipe_Manager') || ! class_exists('WPRM_Metadata')) { |
|
| 43 | 43 | return false; |
| 44 | 44 | } |
| 45 | - if ( ! method_exists( '\WPRM_Recipe_Manager', 'get_recipe_ids_from_post' ) || |
|
| 46 | - ! method_exists( '\WPRM_Recipe_Manager', 'get_recipe' ) || |
|
| 47 | - ! method_exists( '\WPRM_Metadata', 'get_metadata_details' ) |
|
| 45 | + if ( ! method_exists('\WPRM_Recipe_Manager', 'get_recipe_ids_from_post') || |
|
| 46 | + ! method_exists('\WPRM_Recipe_Manager', 'get_recipe') || |
|
| 47 | + ! method_exists('\WPRM_Metadata', 'get_metadata_details') |
|
| 48 | 48 | ) { |
| 49 | 49 | return false; |
| 50 | 50 | } |
@@ -54,27 +54,27 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | |
| 56 | 56 | public function is_yoast_active() { |
| 57 | - return defined( 'WPSEO_VERSION' ); |
|
| 57 | + return defined('WPSEO_VERSION'); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | public function is_recipe_maker_yoast_integration_on() { |
| 62 | 62 | |
| 63 | - if ( ! class_exists( '\WPRM_Settings' ) ) { |
|
| 63 | + if ( ! class_exists('\WPRM_Settings')) { |
|
| 64 | 64 | return false; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - return \WPRM_Settings::get( 'yoast_seo_integration' ) && interface_exists( 'WPSEO_Graph_Piece' ); |
|
| 67 | + return \WPRM_Settings::get('yoast_seo_integration') && interface_exists('WPSEO_Graph_Piece'); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - public function can_integrate_with_yoast_jsonld( $post_id ) { |
|
| 70 | + public function can_integrate_with_yoast_jsonld($post_id) { |
|
| 71 | 71 | return is_singular() |
| 72 | 72 | // No Mentions on home page. |
| 73 | 73 | && ! is_home() |
| 74 | 74 | && $this->is_yoast_active() |
| 75 | 75 | && $this->is_wp_recipe_maker_available() |
| 76 | 76 | && $this->is_recipe_maker_yoast_integration_on() |
| 77 | - && $this->is_atleast_once_recipe_present_in_the_post( $post_id ); |
|
| 77 | + && $this->is_atleast_once_recipe_present_in_the_post($post_id); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
@@ -14,111 +14,111 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class Recipe_Maker_Jsonld_Hook { |
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * @var \Wordlift_Attachment_Service |
|
| 19 | - */ |
|
| 20 | - private $attachment_service; |
|
| 21 | - /** |
|
| 22 | - * @var Recipe_Maker_Validation_Service |
|
| 23 | - */ |
|
| 24 | - private $recipe_maker_validation_service; |
|
| 25 | - |
|
| 26 | - /** |
|
| 27 | - * Recipe_Maker_Jsonld_Hook constructor. |
|
| 28 | - * |
|
| 29 | - * @param $attachment_service \Wordlift_Attachment_Service |
|
| 30 | - * @param $recipe_maker_validation_service Recipe_Maker_Validation_Service |
|
| 31 | - */ |
|
| 32 | - public function __construct( $attachment_service, $recipe_maker_validation_service ) { |
|
| 33 | - |
|
| 34 | - $this->attachment_service = $attachment_service; |
|
| 35 | - $this->recipe_maker_validation_service = $recipe_maker_validation_service; |
|
| 36 | - $this->merge_recipe_jsonld(); |
|
| 37 | - } |
|
| 38 | - |
|
| 39 | - |
|
| 40 | - private function merge_recipe_jsonld() { |
|
| 41 | - // First we push all the linked recipes to references. |
|
| 42 | - add_filter( 'wl_entity_jsonld_array', array( $this, 'wl_entity_jsonld_array' ), 10, 2 ); |
|
| 43 | - add_filter( 'wl_post_jsonld_array', array( $this, 'wl_entity_jsonld_array' ), 10, 2 ); |
|
| 44 | - |
|
| 45 | - // Then we merge the jsonld for every recipe. |
|
| 46 | - add_filter( 'wl_entity_jsonld', array( $this, 'wl_entity_jsonld' ), 10, 3 ); |
|
| 47 | - } |
|
| 48 | - |
|
| 49 | - private function is_recipe_maker_yoast_integration_on() { |
|
| 50 | - |
|
| 51 | - if ( ! class_exists( '\WPRM_Settings' ) ) { |
|
| 52 | - return false; |
|
| 53 | - } |
|
| 54 | - |
|
| 55 | - return \WPRM_Settings::get( 'yoast_seo_integration' ) && interface_exists( 'WPSEO_Graph_Piece' ); |
|
| 56 | - } |
|
| 57 | - |
|
| 58 | - |
|
| 59 | - |
|
| 60 | - public function wl_entity_jsonld_array( $arr, $post_id ) { |
|
| 61 | - |
|
| 62 | - $jsonld = $arr['jsonld']; |
|
| 63 | - $references = $arr['references']; |
|
| 64 | - |
|
| 65 | - // check if wp recipe maker installed, if not return early. |
|
| 66 | - if ( ! $this->recipe_maker_validation_service->is_wp_recipe_maker_available() ) { |
|
| 67 | - return $arr; |
|
| 68 | - } |
|
| 69 | - |
|
| 70 | - // 1. Get the jsonld from recipe maker for the post id. |
|
| 71 | - $recipe_ids = \WPRM_Recipe_Manager::get_recipe_ids_from_post( $post_id ); |
|
| 72 | - |
|
| 73 | - // If there are no associated recipes for a post id then return early |
|
| 74 | - if ( ! $recipe_ids ) { |
|
| 75 | - return $arr; |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - return array( |
|
| 79 | - 'jsonld' => $jsonld, |
|
| 80 | - 'references' => array_merge( $recipe_ids, $references ) |
|
| 81 | - ); |
|
| 82 | - |
|
| 83 | - } |
|
| 84 | - |
|
| 85 | - |
|
| 86 | - public function wl_entity_jsonld( $jsonld, $post_id, $references ) { |
|
| 87 | - $recipe_data = $this->process_single_recipe_item( $post_id ); |
|
| 88 | - if ( ! $recipe_data ) { |
|
| 89 | - return $jsonld; |
|
| 90 | - } |
|
| 91 | - |
|
| 92 | - // Set image via wordlift. |
|
| 93 | - \Wordlift_Abstract_Post_To_Jsonld_Converter::set_images( |
|
| 94 | - $this->attachment_service, |
|
| 95 | - get_post( $post_id ), |
|
| 96 | - $recipe_data |
|
| 97 | - ); |
|
| 98 | - |
|
| 99 | - if ( ! $jsonld ) { |
|
| 100 | - return $recipe_data; |
|
| 101 | - } |
|
| 102 | - |
|
| 103 | - return $recipe_data + $jsonld; |
|
| 104 | - } |
|
| 105 | - |
|
| 106 | - /** |
|
| 107 | - * @param $linked_recipe_id int post id of that recipe. |
|
| 108 | - * |
|
| 109 | - * @return array Recipe valid jsonld data. |
|
| 110 | - */ |
|
| 111 | - private function process_single_recipe_item( $linked_recipe_id ) { |
|
| 112 | - // check if recipe maker present. |
|
| 113 | - if ( ! $this->recipe_maker_validation_service->is_wp_recipe_maker_available() ) { |
|
| 114 | - return array(); |
|
| 115 | - } |
|
| 116 | - $linked_recipe = \WPRM_Recipe_Manager::get_recipe( $linked_recipe_id ); |
|
| 117 | - if ( $linked_recipe ) { |
|
| 118 | - return \WPRM_Metadata::get_metadata_details( $linked_recipe ) ?: array(); |
|
| 119 | - } |
|
| 120 | - |
|
| 121 | - return array(); |
|
| 122 | - } |
|
| 17 | + /** |
|
| 18 | + * @var \Wordlift_Attachment_Service |
|
| 19 | + */ |
|
| 20 | + private $attachment_service; |
|
| 21 | + /** |
|
| 22 | + * @var Recipe_Maker_Validation_Service |
|
| 23 | + */ |
|
| 24 | + private $recipe_maker_validation_service; |
|
| 25 | + |
|
| 26 | + /** |
|
| 27 | + * Recipe_Maker_Jsonld_Hook constructor. |
|
| 28 | + * |
|
| 29 | + * @param $attachment_service \Wordlift_Attachment_Service |
|
| 30 | + * @param $recipe_maker_validation_service Recipe_Maker_Validation_Service |
|
| 31 | + */ |
|
| 32 | + public function __construct( $attachment_service, $recipe_maker_validation_service ) { |
|
| 33 | + |
|
| 34 | + $this->attachment_service = $attachment_service; |
|
| 35 | + $this->recipe_maker_validation_service = $recipe_maker_validation_service; |
|
| 36 | + $this->merge_recipe_jsonld(); |
|
| 37 | + } |
|
| 38 | + |
|
| 39 | + |
|
| 40 | + private function merge_recipe_jsonld() { |
|
| 41 | + // First we push all the linked recipes to references. |
|
| 42 | + add_filter( 'wl_entity_jsonld_array', array( $this, 'wl_entity_jsonld_array' ), 10, 2 ); |
|
| 43 | + add_filter( 'wl_post_jsonld_array', array( $this, 'wl_entity_jsonld_array' ), 10, 2 ); |
|
| 44 | + |
|
| 45 | + // Then we merge the jsonld for every recipe. |
|
| 46 | + add_filter( 'wl_entity_jsonld', array( $this, 'wl_entity_jsonld' ), 10, 3 ); |
|
| 47 | + } |
|
| 48 | + |
|
| 49 | + private function is_recipe_maker_yoast_integration_on() { |
|
| 50 | + |
|
| 51 | + if ( ! class_exists( '\WPRM_Settings' ) ) { |
|
| 52 | + return false; |
|
| 53 | + } |
|
| 54 | + |
|
| 55 | + return \WPRM_Settings::get( 'yoast_seo_integration' ) && interface_exists( 'WPSEO_Graph_Piece' ); |
|
| 56 | + } |
|
| 57 | + |
|
| 58 | + |
|
| 59 | + |
|
| 60 | + public function wl_entity_jsonld_array( $arr, $post_id ) { |
|
| 61 | + |
|
| 62 | + $jsonld = $arr['jsonld']; |
|
| 63 | + $references = $arr['references']; |
|
| 64 | + |
|
| 65 | + // check if wp recipe maker installed, if not return early. |
|
| 66 | + if ( ! $this->recipe_maker_validation_service->is_wp_recipe_maker_available() ) { |
|
| 67 | + return $arr; |
|
| 68 | + } |
|
| 69 | + |
|
| 70 | + // 1. Get the jsonld from recipe maker for the post id. |
|
| 71 | + $recipe_ids = \WPRM_Recipe_Manager::get_recipe_ids_from_post( $post_id ); |
|
| 72 | + |
|
| 73 | + // If there are no associated recipes for a post id then return early |
|
| 74 | + if ( ! $recipe_ids ) { |
|
| 75 | + return $arr; |
|
| 76 | + } |
|
| 77 | + |
|
| 78 | + return array( |
|
| 79 | + 'jsonld' => $jsonld, |
|
| 80 | + 'references' => array_merge( $recipe_ids, $references ) |
|
| 81 | + ); |
|
| 82 | + |
|
| 83 | + } |
|
| 84 | + |
|
| 85 | + |
|
| 86 | + public function wl_entity_jsonld( $jsonld, $post_id, $references ) { |
|
| 87 | + $recipe_data = $this->process_single_recipe_item( $post_id ); |
|
| 88 | + if ( ! $recipe_data ) { |
|
| 89 | + return $jsonld; |
|
| 90 | + } |
|
| 91 | + |
|
| 92 | + // Set image via wordlift. |
|
| 93 | + \Wordlift_Abstract_Post_To_Jsonld_Converter::set_images( |
|
| 94 | + $this->attachment_service, |
|
| 95 | + get_post( $post_id ), |
|
| 96 | + $recipe_data |
|
| 97 | + ); |
|
| 98 | + |
|
| 99 | + if ( ! $jsonld ) { |
|
| 100 | + return $recipe_data; |
|
| 101 | + } |
|
| 102 | + |
|
| 103 | + return $recipe_data + $jsonld; |
|
| 104 | + } |
|
| 105 | + |
|
| 106 | + /** |
|
| 107 | + * @param $linked_recipe_id int post id of that recipe. |
|
| 108 | + * |
|
| 109 | + * @return array Recipe valid jsonld data. |
|
| 110 | + */ |
|
| 111 | + private function process_single_recipe_item( $linked_recipe_id ) { |
|
| 112 | + // check if recipe maker present. |
|
| 113 | + if ( ! $this->recipe_maker_validation_service->is_wp_recipe_maker_available() ) { |
|
| 114 | + return array(); |
|
| 115 | + } |
|
| 116 | + $linked_recipe = \WPRM_Recipe_Manager::get_recipe( $linked_recipe_id ); |
|
| 117 | + if ( $linked_recipe ) { |
|
| 118 | + return \WPRM_Metadata::get_metadata_details( $linked_recipe ) ?: array(); |
|
| 119 | + } |
|
| 120 | + |
|
| 121 | + return array(); |
|
| 122 | + } |
|
| 123 | 123 | |
| 124 | 124 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * @param $attachment_service \Wordlift_Attachment_Service |
| 30 | 30 | * @param $recipe_maker_validation_service Recipe_Maker_Validation_Service |
| 31 | 31 | */ |
| 32 | - public function __construct( $attachment_service, $recipe_maker_validation_service ) { |
|
| 32 | + public function __construct($attachment_service, $recipe_maker_validation_service) { |
|
| 33 | 33 | |
| 34 | 34 | $this->attachment_service = $attachment_service; |
| 35 | 35 | $this->recipe_maker_validation_service = $recipe_maker_validation_service; |
@@ -39,64 +39,64 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | private function merge_recipe_jsonld() { |
| 41 | 41 | // First we push all the linked recipes to references. |
| 42 | - add_filter( 'wl_entity_jsonld_array', array( $this, 'wl_entity_jsonld_array' ), 10, 2 ); |
|
| 43 | - add_filter( 'wl_post_jsonld_array', array( $this, 'wl_entity_jsonld_array' ), 10, 2 ); |
|
| 42 | + add_filter('wl_entity_jsonld_array', array($this, 'wl_entity_jsonld_array'), 10, 2); |
|
| 43 | + add_filter('wl_post_jsonld_array', array($this, 'wl_entity_jsonld_array'), 10, 2); |
|
| 44 | 44 | |
| 45 | 45 | // Then we merge the jsonld for every recipe. |
| 46 | - add_filter( 'wl_entity_jsonld', array( $this, 'wl_entity_jsonld' ), 10, 3 ); |
|
| 46 | + add_filter('wl_entity_jsonld', array($this, 'wl_entity_jsonld'), 10, 3); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | private function is_recipe_maker_yoast_integration_on() { |
| 50 | 50 | |
| 51 | - if ( ! class_exists( '\WPRM_Settings' ) ) { |
|
| 51 | + if ( ! class_exists('\WPRM_Settings')) { |
|
| 52 | 52 | return false; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - return \WPRM_Settings::get( 'yoast_seo_integration' ) && interface_exists( 'WPSEO_Graph_Piece' ); |
|
| 55 | + return \WPRM_Settings::get('yoast_seo_integration') && interface_exists('WPSEO_Graph_Piece'); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
| 59 | 59 | |
| 60 | - public function wl_entity_jsonld_array( $arr, $post_id ) { |
|
| 60 | + public function wl_entity_jsonld_array($arr, $post_id) { |
|
| 61 | 61 | |
| 62 | 62 | $jsonld = $arr['jsonld']; |
| 63 | 63 | $references = $arr['references']; |
| 64 | 64 | |
| 65 | 65 | // check if wp recipe maker installed, if not return early. |
| 66 | - if ( ! $this->recipe_maker_validation_service->is_wp_recipe_maker_available() ) { |
|
| 66 | + if ( ! $this->recipe_maker_validation_service->is_wp_recipe_maker_available()) { |
|
| 67 | 67 | return $arr; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | // 1. Get the jsonld from recipe maker for the post id. |
| 71 | - $recipe_ids = \WPRM_Recipe_Manager::get_recipe_ids_from_post( $post_id ); |
|
| 71 | + $recipe_ids = \WPRM_Recipe_Manager::get_recipe_ids_from_post($post_id); |
|
| 72 | 72 | |
| 73 | 73 | // If there are no associated recipes for a post id then return early |
| 74 | - if ( ! $recipe_ids ) { |
|
| 74 | + if ( ! $recipe_ids) { |
|
| 75 | 75 | return $arr; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | return array( |
| 79 | 79 | 'jsonld' => $jsonld, |
| 80 | - 'references' => array_merge( $recipe_ids, $references ) |
|
| 80 | + 'references' => array_merge($recipe_ids, $references) |
|
| 81 | 81 | ); |
| 82 | 82 | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | |
| 86 | - public function wl_entity_jsonld( $jsonld, $post_id, $references ) { |
|
| 87 | - $recipe_data = $this->process_single_recipe_item( $post_id ); |
|
| 88 | - if ( ! $recipe_data ) { |
|
| 86 | + public function wl_entity_jsonld($jsonld, $post_id, $references) { |
|
| 87 | + $recipe_data = $this->process_single_recipe_item($post_id); |
|
| 88 | + if ( ! $recipe_data) { |
|
| 89 | 89 | return $jsonld; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | // Set image via wordlift. |
| 93 | 93 | \Wordlift_Abstract_Post_To_Jsonld_Converter::set_images( |
| 94 | 94 | $this->attachment_service, |
| 95 | - get_post( $post_id ), |
|
| 95 | + get_post($post_id), |
|
| 96 | 96 | $recipe_data |
| 97 | 97 | ); |
| 98 | 98 | |
| 99 | - if ( ! $jsonld ) { |
|
| 99 | + if ( ! $jsonld) { |
|
| 100 | 100 | return $recipe_data; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -108,14 +108,14 @@ discard block |
||
| 108 | 108 | * |
| 109 | 109 | * @return array Recipe valid jsonld data. |
| 110 | 110 | */ |
| 111 | - private function process_single_recipe_item( $linked_recipe_id ) { |
|
| 111 | + private function process_single_recipe_item($linked_recipe_id) { |
|
| 112 | 112 | // check if recipe maker present. |
| 113 | - if ( ! $this->recipe_maker_validation_service->is_wp_recipe_maker_available() ) { |
|
| 113 | + if ( ! $this->recipe_maker_validation_service->is_wp_recipe_maker_available()) { |
|
| 114 | 114 | return array(); |
| 115 | 115 | } |
| 116 | - $linked_recipe = \WPRM_Recipe_Manager::get_recipe( $linked_recipe_id ); |
|
| 117 | - if ( $linked_recipe ) { |
|
| 118 | - return \WPRM_Metadata::get_metadata_details( $linked_recipe ) ?: array(); |
|
| 116 | + $linked_recipe = \WPRM_Recipe_Manager::get_recipe($linked_recipe_id); |
|
| 117 | + if ($linked_recipe) { |
|
| 118 | + return \WPRM_Metadata::get_metadata_details($linked_recipe) ?: array(); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | return array(); |
@@ -7,19 +7,19 @@ |
||
| 7 | 7 | class Generator_Factory { |
| 8 | 8 | |
| 9 | 9 | |
| 10 | - /** |
|
| 11 | - * @param $jsonld_service \Wordlift_Jsonld_Service |
|
| 12 | - * |
|
| 13 | - * @return Generator |
|
| 14 | - */ |
|
| 15 | - public static function get_instance( $jsonld_service, $post_id ) { |
|
| 16 | - $recipe_maker_validation_service = Recipe_Maker_Validation_Service::get_instance(); |
|
| 17 | - if ( $recipe_maker_validation_service->can_integrate_with_yoast_jsonld( $post_id ) ) { |
|
| 18 | - return new Recipe_Maker_Yoast_Generator( $jsonld_service ); |
|
| 19 | - } |
|
| 20 | - |
|
| 21 | - return new Default_Generator( $jsonld_service ); |
|
| 22 | - } |
|
| 10 | + /** |
|
| 11 | + * @param $jsonld_service \Wordlift_Jsonld_Service |
|
| 12 | + * |
|
| 13 | + * @return Generator |
|
| 14 | + */ |
|
| 15 | + public static function get_instance( $jsonld_service, $post_id ) { |
|
| 16 | + $recipe_maker_validation_service = Recipe_Maker_Validation_Service::get_instance(); |
|
| 17 | + if ( $recipe_maker_validation_service->can_integrate_with_yoast_jsonld( $post_id ) ) { |
|
| 18 | + return new Recipe_Maker_Yoast_Generator( $jsonld_service ); |
|
| 19 | + } |
|
| 20 | + |
|
| 21 | + return new Default_Generator( $jsonld_service ); |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | } |
| 26 | 26 | \ No newline at end of file |
@@ -12,13 +12,13 @@ |
||
| 12 | 12 | * |
| 13 | 13 | * @return Generator |
| 14 | 14 | */ |
| 15 | - public static function get_instance( $jsonld_service, $post_id ) { |
|
| 15 | + public static function get_instance($jsonld_service, $post_id) { |
|
| 16 | 16 | $recipe_maker_validation_service = Recipe_Maker_Validation_Service::get_instance(); |
| 17 | - if ( $recipe_maker_validation_service->can_integrate_with_yoast_jsonld( $post_id ) ) { |
|
| 18 | - return new Recipe_Maker_Yoast_Generator( $jsonld_service ); |
|
| 17 | + if ($recipe_maker_validation_service->can_integrate_with_yoast_jsonld($post_id)) { |
|
| 18 | + return new Recipe_Maker_Yoast_Generator($jsonld_service); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - return new Default_Generator( $jsonld_service ); |
|
| 21 | + return new Default_Generator($jsonld_service); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | |