@@ -14,34 +14,34 @@ |
||
| 14 | 14 | <!-- This file should primarily consist of HTML with a little bit of PHP. --> |
| 15 | 15 | |
| 16 | 16 | <div class="wrap"> |
| 17 | - <h2><?php echo esc_html_x( 'Download Your Data', 'Page title', 'wordlift' ); ?></h2> |
|
| 18 | - <p><?php esc_html_e( 'Choose the format to download your data:', 'wordlift' ); ?></p> |
|
| 17 | + <h2><?php echo esc_html_x('Download Your Data', 'Page title', 'wordlift'); ?></h2> |
|
| 18 | + <p><?php esc_html_e('Choose the format to download your data:', 'wordlift'); ?></p> |
|
| 19 | 19 | |
| 20 | - <a href="<?php echo esc_url( admin_url( 'admin-ajax.php?action=wl_download_your_data&out=json' ) ); ?>" |
|
| 20 | + <a href="<?php echo esc_url(admin_url('admin-ajax.php?action=wl_download_your_data&out=json')); ?>" |
|
| 21 | 21 | class="button wl-add-input wl-button"> |
| 22 | - <?php esc_html_e( 'JSON-LD', 'wordlift' ); ?> |
|
| 22 | + <?php esc_html_e('JSON-LD', 'wordlift'); ?> |
|
| 23 | 23 | </a> |
| 24 | 24 | |
| 25 | - <a href="<?php echo esc_url( admin_url( 'admin-ajax.php?action=wl_download_your_data&out=rdf' ) ); ?>" |
|
| 25 | + <a href="<?php echo esc_url(admin_url('admin-ajax.php?action=wl_download_your_data&out=rdf')); ?>" |
|
| 26 | 26 | class="button wl-add-input wl-button"> |
| 27 | - <?php esc_html_e( 'RDF/XML', 'wordlift' ); ?> |
|
| 27 | + <?php esc_html_e('RDF/XML', 'wordlift'); ?> |
|
| 28 | 28 | </a> |
| 29 | 29 | |
| 30 | - <a href="<?php echo esc_url( admin_url( 'admin-ajax.php?action=wl_download_your_data&out=ttl' ) ); ?>" |
|
| 30 | + <a href="<?php echo esc_url(admin_url('admin-ajax.php?action=wl_download_your_data&out=ttl')); ?>" |
|
| 31 | 31 | class="button wl-add-input wl-button"> |
| 32 | - <?php echo esc_html_x( 'Turtle', 'File format, not the animal', 'wordlift' ); ?> |
|
| 32 | + <?php echo esc_html_x('Turtle', 'File format, not the animal', 'wordlift'); ?> |
|
| 33 | 33 | </a> |
| 34 | 34 | |
| 35 | - <a href="<?php echo esc_url( admin_url( 'admin-ajax.php?action=wl_download_your_data&out=n3' ) ); ?>" |
|
| 35 | + <a href="<?php echo esc_url(admin_url('admin-ajax.php?action=wl_download_your_data&out=n3')); ?>" |
|
| 36 | 36 | class="button wl-add-input wl-button"> |
| 37 | - <?php esc_html_e( 'N3', 'wordlift' ); ?> |
|
| 37 | + <?php esc_html_e('N3', 'wordlift'); ?> |
|
| 38 | 38 | </a> |
| 39 | 39 | |
| 40 | 40 | <!-- Show the 'JSON-LD' button only if the constant is defined and set to true. --> |
| 41 | - <?php if ( defined( 'WL_CONFIG_DOWNLOAD_GA_CONTENT_DATA' ) && WL_CONFIG_DOWNLOAD_GA_CONTENT_DATA && wl_check_permalink_structure() ) : ?> |
|
| 42 | - <a href="<?php echo esc_url( admin_url( 'admin-ajax.php?action=wl_google_analytics_export' ) ); ?>" |
|
| 41 | + <?php if (defined('WL_CONFIG_DOWNLOAD_GA_CONTENT_DATA') && WL_CONFIG_DOWNLOAD_GA_CONTENT_DATA && wl_check_permalink_structure()) : ?> |
|
| 42 | + <a href="<?php echo esc_url(admin_url('admin-ajax.php?action=wl_google_analytics_export')); ?>" |
|
| 43 | 43 | class="button wl-add-input wl-button"> |
| 44 | - <?php esc_html_e( 'Google Analytics', 'wordlift' ); ?> |
|
| 44 | + <?php esc_html_e('Google Analytics', 'wordlift'); ?> |
|
| 45 | 45 | </a> |
| 46 | 46 | <?php endif ?> |
| 47 | 47 | </div> |
@@ -6,40 +6,40 @@ discard block |
||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | // Define the basic options for HTTP calls to REDLINK. |
| 9 | -define( 'WL_REDLINK_API_HTTP_OPTIONS', serialize( array( |
|
| 9 | +define('WL_REDLINK_API_HTTP_OPTIONS', serialize(array( |
|
| 10 | 10 | 'timeout' => 300, |
| 11 | 11 | 'redirection' => 5, |
| 12 | 12 | 'httpversion' => '1.1', |
| 13 | 13 | 'blocking' => true, |
| 14 | 14 | 'cookies' => array(), |
| 15 | - 'sslverify' => ( 'false' === getenv( 'WL_SSL_VERIFY_ENABLED' ) ) ? false : true, |
|
| 16 | - 'sslcertificates' => dirname( __FILE__ ) . '/ssl/ca-bundle.crt', |
|
| 15 | + 'sslverify' => ('false' === getenv('WL_SSL_VERIFY_ENABLED')) ? false : true, |
|
| 16 | + 'sslcertificates' => dirname(__FILE__).'/ssl/ca-bundle.crt', |
|
| 17 | 17 | 'decompress' => false, |
| 18 | -) ) ); |
|
| 18 | +))); |
|
| 19 | 19 | |
| 20 | 20 | // Create a unique ID for this request, useful to hook async HTTP requests. |
| 21 | -define( 'WL_REQUEST_ID', uniqid( true ) ); |
|
| 21 | +define('WL_REQUEST_ID', uniqid(true)); |
|
| 22 | 22 | |
| 23 | 23 | // Set the temporary files folder. |
| 24 | -defined( 'WL_TEMP_DIR' ) || define( 'WL_TEMP_DIR', get_temp_dir() ); |
|
| 24 | +defined('WL_TEMP_DIR') || define('WL_TEMP_DIR', get_temp_dir()); |
|
| 25 | 25 | |
| 26 | -define( 'WL_ENABLE_SPARQL_UPDATE_QUERIES_BUFFERING', 'true' !== getenv( 'WL_DISABLE_SPARQL_UPDATE_QUERIES_BUFFERING' ) ); |
|
| 26 | +define('WL_ENABLE_SPARQL_UPDATE_QUERIES_BUFFERING', 'true' !== getenv('WL_DISABLE_SPARQL_UPDATE_QUERIES_BUFFERING')); |
|
| 27 | 27 | |
| 28 | 28 | // Define the meta name used to store the entity URL. |
| 29 | -define( 'WL_ENTITY_URL_META_NAME', 'entity_url' ); |
|
| 29 | +define('WL_ENTITY_URL_META_NAME', 'entity_url'); |
|
| 30 | 30 | |
| 31 | 31 | // Max number of recursions when printing microdata. |
| 32 | -define( 'WL_RECURSION_DEPTH_ON_ENTITY_METADATA_PRINTING', 3 ); |
|
| 32 | +define('WL_RECURSION_DEPTH_ON_ENTITY_METADATA_PRINTING', 3); |
|
| 33 | 33 | |
| 34 | 34 | // 3.13.0, we use by default WLS 1.11 which provides us with the new, faster |
| 35 | 35 | // chunked analysis. |
| 36 | -define( 'WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE', defined( 'WORDLIFT_API_URL' ) ? WORDLIFT_API_URL . '/' : 'https://api.wordlift.it/' ); |
|
| 36 | +define('WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE', defined('WORDLIFT_API_URL') ? WORDLIFT_API_URL . '/' : 'https://api.wordlift.it/'); |
|
| 37 | 37 | |
| 38 | -define( 'WL_CONFIG_TEST_GOOGLE_RICH_SNIPPETS_URL', 'https://developers.google.com/structured-data/testing-tool/?url=' ); |
|
| 38 | +define('WL_CONFIG_TEST_GOOGLE_RICH_SNIPPETS_URL', 'https://developers.google.com/structured-data/testing-tool/?url='); |
|
| 39 | 39 | |
| 40 | 40 | // If is set to true, there will be additional button in 'Download Your Data' page |
| 41 | 41 | // that will allow users to download their data in JSON-LD format. |
| 42 | -defined( 'WL_CONFIG_DOWNLOAD_GA_CONTENT_DATA' ) || define( 'WL_CONFIG_DOWNLOAD_GA_CONTENT_DATA', false ); |
|
| 42 | +defined('WL_CONFIG_DOWNLOAD_GA_CONTENT_DATA') || define('WL_CONFIG_DOWNLOAD_GA_CONTENT_DATA', false); |
|
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | $items = wl_prefixes_list(); |
| 53 | 53 | $prefixes = array(); |
| 54 | 54 | |
| 55 | - foreach ( $items as $item ) { |
|
| 56 | - $prefixes[ $item['prefix'] ] = $item['namespace']; |
|
| 55 | + foreach ($items as $item) { |
|
| 56 | + $prefixes[$item['prefix']] = $item['namespace']; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | return $prefixes; |
@@ -18,31 +18,31 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | class Wordlift_Google_Analytics_Export_Service { |
| 20 | 20 | |
| 21 | - /** |
|
| 22 | - * Export the CSV. |
|
| 23 | - * |
|
| 24 | - * @since 3.15.0 |
|
| 25 | - */ |
|
| 26 | - public function export() { |
|
| 27 | - |
|
| 28 | - if ( ! wl_check_permalink_structure() ) { |
|
| 29 | - return; |
|
| 30 | - } |
|
| 31 | - |
|
| 32 | - // Get the global $wpdb. |
|
| 33 | - global $wpdb; |
|
| 34 | - |
|
| 35 | - // Site path (optional). |
|
| 36 | - $path = $this->get_site_path(); |
|
| 37 | - |
|
| 38 | - // First, let's see if we have the data in the cache already. |
|
| 39 | - $items = get_transient( 'google_content_data' ); |
|
| 40 | - |
|
| 41 | - if ( false === $items ) { |
|
| 42 | - // Build sql query. |
|
| 43 | - $items = $wpdb->get_results( |
|
| 44 | - $wpdb->prepare( |
|
| 45 | - "SELECT |
|
| 21 | + /** |
|
| 22 | + * Export the CSV. |
|
| 23 | + * |
|
| 24 | + * @since 3.15.0 |
|
| 25 | + */ |
|
| 26 | + public function export() { |
|
| 27 | + |
|
| 28 | + if ( ! wl_check_permalink_structure() ) { |
|
| 29 | + return; |
|
| 30 | + } |
|
| 31 | + |
|
| 32 | + // Get the global $wpdb. |
|
| 33 | + global $wpdb; |
|
| 34 | + |
|
| 35 | + // Site path (optional). |
|
| 36 | + $path = $this->get_site_path(); |
|
| 37 | + |
|
| 38 | + // First, let's see if we have the data in the cache already. |
|
| 39 | + $items = get_transient( 'google_content_data' ); |
|
| 40 | + |
|
| 41 | + if ( false === $items ) { |
|
| 42 | + // Build sql query. |
|
| 43 | + $items = $wpdb->get_results( |
|
| 44 | + $wpdb->prepare( |
|
| 45 | + "SELECT |
|
| 46 | 46 | CONCAT( '%s', p.post_name, '/' ) AS 'post_name', |
| 47 | 47 | p1.post_name AS 'entity_name', |
| 48 | 48 | t.slug AS 'entity_type' |
@@ -59,49 +59,49 @@ discard block |
||
| 59 | 59 | INNER JOIN {$wpdb->prefix}terms t |
| 60 | 60 | ON t.term_id = tt.term_id |
| 61 | 61 | WHERE p.post_type IN ( 'page', 'post' );", |
| 62 | - $path |
|
| 63 | - ) |
|
| 64 | - ); // db call ok; no-cache ok. |
|
| 65 | - |
|
| 66 | - // Set the transient, so nex time we will use it, instead creating new db request. |
|
| 67 | - set_transient( 'google_content_data', $items, 300 ); |
|
| 68 | - } |
|
| 69 | - |
|
| 70 | - // Output the file data. |
|
| 71 | - ob_end_clean(); |
|
| 72 | - |
|
| 73 | - // Add proper file headers. |
|
| 74 | - header( 'Content-Disposition: attachment; filename=wl-ga-export.csv' ); |
|
| 75 | - header( 'Content-Type: text/csv; charset=' . get_bloginfo( 'charset' ) ); |
|
| 76 | - |
|
| 77 | - // Echo the CSV header. |
|
| 78 | - echo( "ga:pagePath,ga:dimension1,ga:dimension2\n" ); |
|
| 79 | - |
|
| 80 | - // Cycle through items and add each item data to the file. |
|
| 81 | - foreach ( $items as $item ) { |
|
| 82 | - // Add new line in the file. |
|
| 83 | - echo esc_html( "$item->post_name,$item->entity_name,$item->entity_type\n" ); |
|
| 84 | - } |
|
| 85 | - |
|
| 86 | - // Finally exit. |
|
| 87 | - exit; |
|
| 88 | - } |
|
| 89 | - |
|
| 90 | - /** |
|
| 91 | - * Return site path. |
|
| 92 | - * |
|
| 93 | - * @since 3.15.0 |
|
| 94 | - * |
|
| 95 | - * @return string The site path. |
|
| 96 | - */ |
|
| 97 | - public function get_site_path() { |
|
| 98 | - // Get home url from database. |
|
| 99 | - $home_url = home_url( '/' ); |
|
| 100 | - |
|
| 101 | - // Parse the url. |
|
| 102 | - $parsed = wp_parse_url( $home_url ); |
|
| 103 | - |
|
| 104 | - // Return the path. |
|
| 105 | - return $parsed['path']; |
|
| 106 | - } |
|
| 62 | + $path |
|
| 63 | + ) |
|
| 64 | + ); // db call ok; no-cache ok. |
|
| 65 | + |
|
| 66 | + // Set the transient, so nex time we will use it, instead creating new db request. |
|
| 67 | + set_transient( 'google_content_data', $items, 300 ); |
|
| 68 | + } |
|
| 69 | + |
|
| 70 | + // Output the file data. |
|
| 71 | + ob_end_clean(); |
|
| 72 | + |
|
| 73 | + // Add proper file headers. |
|
| 74 | + header( 'Content-Disposition: attachment; filename=wl-ga-export.csv' ); |
|
| 75 | + header( 'Content-Type: text/csv; charset=' . get_bloginfo( 'charset' ) ); |
|
| 76 | + |
|
| 77 | + // Echo the CSV header. |
|
| 78 | + echo( "ga:pagePath,ga:dimension1,ga:dimension2\n" ); |
|
| 79 | + |
|
| 80 | + // Cycle through items and add each item data to the file. |
|
| 81 | + foreach ( $items as $item ) { |
|
| 82 | + // Add new line in the file. |
|
| 83 | + echo esc_html( "$item->post_name,$item->entity_name,$item->entity_type\n" ); |
|
| 84 | + } |
|
| 85 | + |
|
| 86 | + // Finally exit. |
|
| 87 | + exit; |
|
| 88 | + } |
|
| 89 | + |
|
| 90 | + /** |
|
| 91 | + * Return site path. |
|
| 92 | + * |
|
| 93 | + * @since 3.15.0 |
|
| 94 | + * |
|
| 95 | + * @return string The site path. |
|
| 96 | + */ |
|
| 97 | + public function get_site_path() { |
|
| 98 | + // Get home url from database. |
|
| 99 | + $home_url = home_url( '/' ); |
|
| 100 | + |
|
| 101 | + // Parse the url. |
|
| 102 | + $parsed = wp_parse_url( $home_url ); |
|
| 103 | + |
|
| 104 | + // Return the path. |
|
| 105 | + return $parsed['path']; |
|
| 106 | + } |
|
| 107 | 107 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function export() { |
| 27 | 27 | |
| 28 | - if ( ! wl_check_permalink_structure() ) { |
|
| 28 | + if ( ! wl_check_permalink_structure()) { |
|
| 29 | 29 | return; |
| 30 | 30 | } |
| 31 | 31 | |
@@ -36,9 +36,9 @@ discard block |
||
| 36 | 36 | $path = $this->get_site_path(); |
| 37 | 37 | |
| 38 | 38 | // First, let's see if we have the data in the cache already. |
| 39 | - $items = get_transient( 'google_content_data' ); |
|
| 39 | + $items = get_transient('google_content_data'); |
|
| 40 | 40 | |
| 41 | - if ( false === $items ) { |
|
| 41 | + if (false === $items) { |
|
| 42 | 42 | // Build sql query. |
| 43 | 43 | $items = $wpdb->get_results( |
| 44 | 44 | $wpdb->prepare( |
@@ -64,23 +64,23 @@ discard block |
||
| 64 | 64 | ); // db call ok; no-cache ok. |
| 65 | 65 | |
| 66 | 66 | // Set the transient, so nex time we will use it, instead creating new db request. |
| 67 | - set_transient( 'google_content_data', $items, 300 ); |
|
| 67 | + set_transient('google_content_data', $items, 300); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | // Output the file data. |
| 71 | 71 | ob_end_clean(); |
| 72 | 72 | |
| 73 | 73 | // Add proper file headers. |
| 74 | - header( 'Content-Disposition: attachment; filename=wl-ga-export.csv' ); |
|
| 75 | - header( 'Content-Type: text/csv; charset=' . get_bloginfo( 'charset' ) ); |
|
| 74 | + header('Content-Disposition: attachment; filename=wl-ga-export.csv'); |
|
| 75 | + header('Content-Type: text/csv; charset='.get_bloginfo('charset')); |
|
| 76 | 76 | |
| 77 | 77 | // Echo the CSV header. |
| 78 | - echo( "ga:pagePath,ga:dimension1,ga:dimension2\n" ); |
|
| 78 | + echo("ga:pagePath,ga:dimension1,ga:dimension2\n"); |
|
| 79 | 79 | |
| 80 | 80 | // Cycle through items and add each item data to the file. |
| 81 | - foreach ( $items as $item ) { |
|
| 81 | + foreach ($items as $item) { |
|
| 82 | 82 | // Add new line in the file. |
| 83 | - echo esc_html( "$item->post_name,$item->entity_name,$item->entity_type\n" ); |
|
| 83 | + echo esc_html("$item->post_name,$item->entity_name,$item->entity_type\n"); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | // Finally exit. |
@@ -96,10 +96,10 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function get_site_path() { |
| 98 | 98 | // Get home url from database. |
| 99 | - $home_url = home_url( '/' ); |
|
| 99 | + $home_url = home_url('/'); |
|
| 100 | 100 | |
| 101 | 101 | // Parse the url. |
| 102 | - $parsed = wp_parse_url( $home_url ); |
|
| 102 | + $parsed = wp_parse_url($home_url); |
|
| 103 | 103 | |
| 104 | 104 | // Return the path. |
| 105 | 105 | return $parsed['path']; |
@@ -17,21 +17,21 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | function wl_serialize_entity( $entity ) { |
| 19 | 19 | |
| 20 | - $entity = ( is_numeric( $entity ) ) ? get_post( $entity ) : $entity; |
|
| 20 | + $entity = ( is_numeric( $entity ) ) ? get_post( $entity ) : $entity; |
|
| 21 | 21 | |
| 22 | - $type = wl_entity_type_taxonomy_get_type( $entity->ID ); |
|
| 23 | - $images = wl_get_image_urls( $entity->ID ); |
|
| 22 | + $type = wl_entity_type_taxonomy_get_type( $entity->ID ); |
|
| 23 | + $images = wl_get_image_urls( $entity->ID ); |
|
| 24 | 24 | |
| 25 | - return array( |
|
| 26 | - 'id' => wl_get_entity_uri( $entity->ID ), |
|
| 27 | - 'label' => $entity->post_title, |
|
| 28 | - 'description' => $entity->post_content, |
|
| 29 | - 'sameAs' => wl_schema_get_value( $entity->ID, 'sameAs' ), |
|
| 30 | - 'mainType' => str_replace( 'wl-', '', $type['css_class'] ), |
|
| 31 | - 'types' => wl_get_entity_rdf_types( $entity->ID ), |
|
| 32 | - 'images' => $images, |
|
| 25 | + return array( |
|
| 26 | + 'id' => wl_get_entity_uri( $entity->ID ), |
|
| 27 | + 'label' => $entity->post_title, |
|
| 28 | + 'description' => $entity->post_content, |
|
| 29 | + 'sameAs' => wl_schema_get_value( $entity->ID, 'sameAs' ), |
|
| 30 | + 'mainType' => str_replace( 'wl-', '', $type['css_class'] ), |
|
| 31 | + 'types' => wl_get_entity_rdf_types( $entity->ID ), |
|
| 32 | + 'images' => $images, |
|
| 33 | 33 | |
| 34 | - ); |
|
| 34 | + ); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -45,22 +45,22 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | function wl_remove_text_annotations( $data ) { |
| 47 | 47 | |
| 48 | - // Remove blank elements that can interfere with annoataions removing |
|
| 49 | - // See https://github.com/insideout10/wordlift-plugin/issues/234 |
|
| 50 | - // Just blank attributes without any attribtues are cleaned up. |
|
| 51 | - $pattern = '/<(\w+)><\/\1>/im'; |
|
| 52 | - // Remove the pattern while it is found (match nested annotations). |
|
| 53 | - while ( 1 === preg_match( $pattern, $data['post_content'] ) ) { |
|
| 54 | - $data['post_content'] = preg_replace( $pattern, '$2', $data['post_content'], -1, $count ); |
|
| 55 | - } |
|
| 56 | - // Remove text annotations |
|
| 57 | - // <span class="textannotation" id="urn:enhancement-777cbed4-b131-00fb-54a4-ed9b26ae57ea">. |
|
| 58 | - $pattern = '/<(\w+)[^>]*\sclass=\\\"textannotation(?![^\\"]*\sdisambiguated)[^\\"]*\\\"[^>]*>([^<]+)<\/\1>/im'; |
|
| 59 | - // Remove the pattern while it is found (match nested annotations). |
|
| 60 | - while ( 1 === preg_match( $pattern, $data['post_content'] ) ) { |
|
| 61 | - $data['post_content'] = preg_replace( $pattern, '$2', $data['post_content'], -1, $count ); |
|
| 62 | - } |
|
| 63 | - return $data; |
|
| 48 | + // Remove blank elements that can interfere with annoataions removing |
|
| 49 | + // See https://github.com/insideout10/wordlift-plugin/issues/234 |
|
| 50 | + // Just blank attributes without any attribtues are cleaned up. |
|
| 51 | + $pattern = '/<(\w+)><\/\1>/im'; |
|
| 52 | + // Remove the pattern while it is found (match nested annotations). |
|
| 53 | + while ( 1 === preg_match( $pattern, $data['post_content'] ) ) { |
|
| 54 | + $data['post_content'] = preg_replace( $pattern, '$2', $data['post_content'], -1, $count ); |
|
| 55 | + } |
|
| 56 | + // Remove text annotations |
|
| 57 | + // <span class="textannotation" id="urn:enhancement-777cbed4-b131-00fb-54a4-ed9b26ae57ea">. |
|
| 58 | + $pattern = '/<(\w+)[^>]*\sclass=\\\"textannotation(?![^\\"]*\sdisambiguated)[^\\"]*\\\"[^>]*>([^<]+)<\/\1>/im'; |
|
| 59 | + // Remove the pattern while it is found (match nested annotations). |
|
| 60 | + while ( 1 === preg_match( $pattern, $data['post_content'] ) ) { |
|
| 61 | + $data['post_content'] = preg_replace( $pattern, '$2', $data['post_content'], -1, $count ); |
|
| 62 | + } |
|
| 63 | + return $data; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | add_filter( 'wp_insert_post_data', 'wl_remove_text_annotations', '98', 1 ); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | function wl_admin_metaboxes_add_css_class( $classes = array() ) { |
| 78 | 78 | |
| 79 | - return array_merge( $classes, array( 'wl-metabox' ) ); |
|
| 79 | + return array_merge( $classes, array( 'wl-metabox' ) ); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
@@ -88,19 +88,19 @@ discard block |
||
| 88 | 88 | * @return bool |
| 89 | 89 | */ |
| 90 | 90 | function wl_check_permalink_structure() { |
| 91 | - // Get current permalink structure. |
|
| 92 | - $structure = get_option( 'permalink_structure' ); |
|
| 91 | + // Get current permalink structure. |
|
| 92 | + $structure = get_option( 'permalink_structure' ); |
|
| 93 | 93 | |
| 94 | - // The regular expression. It will check if the site structure contains postname. |
|
| 95 | - $regex = '~^/\%postname\%/$~'; |
|
| 94 | + // The regular expression. It will check if the site structure contains postname. |
|
| 95 | + $regex = '~^/\%postname\%/$~'; |
|
| 96 | 96 | |
| 97 | - // Check if the site structure match the rquired one. |
|
| 98 | - preg_match( $regex, $structure, $matches ); |
|
| 97 | + // Check if the site structure match the rquired one. |
|
| 98 | + preg_match( $regex, $structure, $matches ); |
|
| 99 | 99 | |
| 100 | - // Bail if the site have different structure. |
|
| 101 | - if ( empty( $matches ) ) { |
|
| 102 | - return false; |
|
| 103 | - } |
|
| 100 | + // Bail if the site have different structure. |
|
| 101 | + if ( empty( $matches ) ) { |
|
| 102 | + return false; |
|
| 103 | + } |
|
| 104 | 104 | |
| 105 | - return true; |
|
| 105 | + return true; |
|
| 106 | 106 | } |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | // Add the Admin menu. |
| 9 | -require_once( 'wordlift_admin_menu.php' ); |
|
| 9 | +require_once('wordlift_admin_menu.php'); |
|
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | 12 | * Serialize an entity post. |
@@ -15,20 +15,20 @@ discard block |
||
| 15 | 15 | * |
| 16 | 16 | * @return array mixed The entity data array. |
| 17 | 17 | */ |
| 18 | -function wl_serialize_entity( $entity ) { |
|
| 18 | +function wl_serialize_entity($entity) { |
|
| 19 | 19 | |
| 20 | - $entity = ( is_numeric( $entity ) ) ? get_post( $entity ) : $entity; |
|
| 20 | + $entity = (is_numeric($entity)) ? get_post($entity) : $entity; |
|
| 21 | 21 | |
| 22 | - $type = wl_entity_type_taxonomy_get_type( $entity->ID ); |
|
| 23 | - $images = wl_get_image_urls( $entity->ID ); |
|
| 22 | + $type = wl_entity_type_taxonomy_get_type($entity->ID); |
|
| 23 | + $images = wl_get_image_urls($entity->ID); |
|
| 24 | 24 | |
| 25 | 25 | return array( |
| 26 | - 'id' => wl_get_entity_uri( $entity->ID ), |
|
| 26 | + 'id' => wl_get_entity_uri($entity->ID), |
|
| 27 | 27 | 'label' => $entity->post_title, |
| 28 | 28 | 'description' => $entity->post_content, |
| 29 | - 'sameAs' => wl_schema_get_value( $entity->ID, 'sameAs' ), |
|
| 30 | - 'mainType' => str_replace( 'wl-', '', $type['css_class'] ), |
|
| 31 | - 'types' => wl_get_entity_rdf_types( $entity->ID ), |
|
| 29 | + 'sameAs' => wl_schema_get_value($entity->ID, 'sameAs'), |
|
| 30 | + 'mainType' => str_replace('wl-', '', $type['css_class']), |
|
| 31 | + 'types' => wl_get_entity_rdf_types($entity->ID), |
|
| 32 | 32 | 'images' => $images, |
| 33 | 33 | |
| 34 | 34 | ); |
@@ -43,27 +43,27 @@ discard block |
||
| 43 | 43 | * |
| 44 | 44 | * @return array mixed The post data array. |
| 45 | 45 | */ |
| 46 | -function wl_remove_text_annotations( $data ) { |
|
| 46 | +function wl_remove_text_annotations($data) { |
|
| 47 | 47 | |
| 48 | 48 | // Remove blank elements that can interfere with annoataions removing |
| 49 | 49 | // See https://github.com/insideout10/wordlift-plugin/issues/234 |
| 50 | 50 | // Just blank attributes without any attribtues are cleaned up. |
| 51 | 51 | $pattern = '/<(\w+)><\/\1>/im'; |
| 52 | 52 | // Remove the pattern while it is found (match nested annotations). |
| 53 | - while ( 1 === preg_match( $pattern, $data['post_content'] ) ) { |
|
| 54 | - $data['post_content'] = preg_replace( $pattern, '$2', $data['post_content'], -1, $count ); |
|
| 53 | + while (1 === preg_match($pattern, $data['post_content'])) { |
|
| 54 | + $data['post_content'] = preg_replace($pattern, '$2', $data['post_content'], -1, $count); |
|
| 55 | 55 | } |
| 56 | 56 | // Remove text annotations |
| 57 | 57 | // <span class="textannotation" id="urn:enhancement-777cbed4-b131-00fb-54a4-ed9b26ae57ea">. |
| 58 | 58 | $pattern = '/<(\w+)[^>]*\sclass=\\\"textannotation(?![^\\"]*\sdisambiguated)[^\\"]*\\\"[^>]*>([^<]+)<\/\1>/im'; |
| 59 | 59 | // Remove the pattern while it is found (match nested annotations). |
| 60 | - while ( 1 === preg_match( $pattern, $data['post_content'] ) ) { |
|
| 61 | - $data['post_content'] = preg_replace( $pattern, '$2', $data['post_content'], -1, $count ); |
|
| 60 | + while (1 === preg_match($pattern, $data['post_content'])) { |
|
| 61 | + $data['post_content'] = preg_replace($pattern, '$2', $data['post_content'], -1, $count); |
|
| 62 | 62 | } |
| 63 | 63 | return $data; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | -add_filter( 'wp_insert_post_data', 'wl_remove_text_annotations', '98', 1 ); |
|
| 66 | +add_filter('wp_insert_post_data', 'wl_remove_text_annotations', '98', 1); |
|
| 67 | 67 | |
| 68 | 68 | /** |
| 69 | 69 | * Adds wl-metabox CSS class to a metabox. |
@@ -74,9 +74,9 @@ discard block |
||
| 74 | 74 | * |
| 75 | 75 | * @return array The updated list of CSS classes. |
| 76 | 76 | */ |
| 77 | -function wl_admin_metaboxes_add_css_class( $classes = array() ) { |
|
| 77 | +function wl_admin_metaboxes_add_css_class($classes = array()) { |
|
| 78 | 78 | |
| 79 | - return array_merge( $classes, array( 'wl-metabox' ) ); |
|
| 79 | + return array_merge($classes, array('wl-metabox')); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
@@ -89,16 +89,16 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | function wl_check_permalink_structure() { |
| 91 | 91 | // Get current permalink structure. |
| 92 | - $structure = get_option( 'permalink_structure' ); |
|
| 92 | + $structure = get_option('permalink_structure'); |
|
| 93 | 93 | |
| 94 | 94 | // The regular expression. It will check if the site structure contains postname. |
| 95 | 95 | $regex = '~^/\%postname\%/$~'; |
| 96 | 96 | |
| 97 | 97 | // Check if the site structure match the rquired one. |
| 98 | - preg_match( $regex, $structure, $matches ); |
|
| 98 | + preg_match($regex, $structure, $matches); |
|
| 99 | 99 | |
| 100 | 100 | // Bail if the site have different structure. |
| 101 | - if ( empty( $matches ) ) { |
|
| 101 | + if (empty($matches)) { |
|
| 102 | 102 | return false; |
| 103 | 103 | } |
| 104 | 104 | |
@@ -29,1429 +29,1429 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | class Wordlift { |
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * The loader that's responsible for maintaining and registering all hooks that power |
|
| 34 | - * the plugin. |
|
| 35 | - * |
|
| 36 | - * @since 1.0.0 |
|
| 37 | - * @access protected |
|
| 38 | - * @var Wordlift_Loader $loader Maintains and registers all hooks for the plugin. |
|
| 39 | - */ |
|
| 40 | - protected $loader; |
|
| 41 | - |
|
| 42 | - /** |
|
| 43 | - * The unique identifier of this plugin. |
|
| 44 | - * |
|
| 45 | - * @since 1.0.0 |
|
| 46 | - * @access protected |
|
| 47 | - * @var string $plugin_name The string used to uniquely identify this plugin. |
|
| 48 | - */ |
|
| 49 | - protected $plugin_name; |
|
| 50 | - |
|
| 51 | - /** |
|
| 52 | - * The current version of the plugin. |
|
| 53 | - * |
|
| 54 | - * @since 1.0.0 |
|
| 55 | - * @access protected |
|
| 56 | - * @var string $version The current version of the plugin. |
|
| 57 | - */ |
|
| 58 | - protected $version; |
|
| 59 | - |
|
| 60 | - /** |
|
| 61 | - * The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 62 | - * |
|
| 63 | - * @since 3.12.0 |
|
| 64 | - * @access protected |
|
| 65 | - * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 66 | - */ |
|
| 67 | - protected $tinymce_adapter; |
|
| 68 | - |
|
| 69 | - /** |
|
| 70 | - * The Thumbnail service. |
|
| 71 | - * |
|
| 72 | - * @since 3.1.5 |
|
| 73 | - * @access private |
|
| 74 | - * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service. |
|
| 75 | - */ |
|
| 76 | - private $thumbnail_service; |
|
| 77 | - |
|
| 78 | - /** |
|
| 79 | - * The UI service. |
|
| 80 | - * |
|
| 81 | - * @since 3.2.0 |
|
| 82 | - * @access private |
|
| 83 | - * @var \Wordlift_UI_Service $ui_service The UI service. |
|
| 84 | - */ |
|
| 85 | - private $ui_service; |
|
| 86 | - |
|
| 87 | - /** |
|
| 88 | - * The Schema service. |
|
| 89 | - * |
|
| 90 | - * @since 3.3.0 |
|
| 91 | - * @access protected |
|
| 92 | - * @var \Wordlift_Schema_Service $schema_service The Schema service. |
|
| 93 | - */ |
|
| 94 | - protected $schema_service; |
|
| 95 | - |
|
| 96 | - /** |
|
| 97 | - * The Entity service. |
|
| 98 | - * |
|
| 99 | - * @since 3.1.0 |
|
| 100 | - * @access protected |
|
| 101 | - * @var \Wordlift_Entity_Service $entity_service The Entity service. |
|
| 102 | - */ |
|
| 103 | - protected $entity_service; |
|
| 104 | - |
|
| 105 | - /** |
|
| 106 | - * The Topic Taxonomy service. |
|
| 107 | - * |
|
| 108 | - * @since 3.5.0 |
|
| 109 | - * @access private |
|
| 110 | - * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service. |
|
| 111 | - */ |
|
| 112 | - private $topic_taxonomy_service; |
|
| 113 | - |
|
| 114 | - /** |
|
| 115 | - * The User service. |
|
| 116 | - * |
|
| 117 | - * @since 3.1.7 |
|
| 118 | - * @access protected |
|
| 119 | - * @var \Wordlift_User_Service $user_service The User service. |
|
| 120 | - */ |
|
| 121 | - protected $user_service; |
|
| 122 | - |
|
| 123 | - /** |
|
| 124 | - * The Timeline service. |
|
| 125 | - * |
|
| 126 | - * @since 3.1.0 |
|
| 127 | - * @access private |
|
| 128 | - * @var \Wordlift_Timeline_Service $timeline_service The Timeline service. |
|
| 129 | - */ |
|
| 130 | - private $timeline_service; |
|
| 131 | - |
|
| 132 | - /** |
|
| 133 | - * The Redirect service. |
|
| 134 | - * |
|
| 135 | - * @since 3.2.0 |
|
| 136 | - * @access private |
|
| 137 | - * @var \Wordlift_Redirect_Service $redirect_service The Redirect service. |
|
| 138 | - */ |
|
| 139 | - private $redirect_service; |
|
| 140 | - |
|
| 141 | - /** |
|
| 142 | - * The Notice service. |
|
| 143 | - * |
|
| 144 | - * @since 3.3.0 |
|
| 145 | - * @access private |
|
| 146 | - * @var \Wordlift_Notice_Service $notice_service The Notice service. |
|
| 147 | - */ |
|
| 148 | - private $notice_service; |
|
| 149 | - |
|
| 150 | - /** |
|
| 151 | - * The Entity list customization. |
|
| 152 | - * |
|
| 153 | - * @since 3.3.0 |
|
| 154 | - * @access private |
|
| 155 | - * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service. |
|
| 156 | - */ |
|
| 157 | - private $entity_list_service; |
|
| 158 | - |
|
| 159 | - /** |
|
| 160 | - * The Entity Types Taxonomy Walker. |
|
| 161 | - * |
|
| 162 | - * @since 3.1.0 |
|
| 163 | - * @access private |
|
| 164 | - * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker |
|
| 165 | - */ |
|
| 166 | - private $entity_types_taxonomy_walker; |
|
| 167 | - |
|
| 168 | - /** |
|
| 169 | - * The ShareThis service. |
|
| 170 | - * |
|
| 171 | - * @since 3.2.0 |
|
| 172 | - * @access private |
|
| 173 | - * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service. |
|
| 174 | - */ |
|
| 175 | - private $sharethis_service; |
|
| 176 | - |
|
| 177 | - /** |
|
| 178 | - * The PrimaShop adapter. |
|
| 179 | - * |
|
| 180 | - * @since 3.2.3 |
|
| 181 | - * @access private |
|
| 182 | - * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter. |
|
| 183 | - */ |
|
| 184 | - private $primashop_adapter; |
|
| 185 | - |
|
| 186 | - /** |
|
| 187 | - * The WordLift Dashboard adapter. |
|
| 188 | - * |
|
| 189 | - * @since 3.4.0 |
|
| 190 | - * @access private |
|
| 191 | - * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service; |
|
| 192 | - */ |
|
| 193 | - private $dashboard_service; |
|
| 194 | - |
|
| 195 | - /** |
|
| 196 | - * The entity type service. |
|
| 197 | - * |
|
| 198 | - * @since 3.6.0 |
|
| 199 | - * @access private |
|
| 200 | - * @var \Wordlift_Entity_Post_Type_Service |
|
| 201 | - */ |
|
| 202 | - private $entity_post_type_service; |
|
| 203 | - |
|
| 204 | - /** |
|
| 205 | - * The entity link service used to mangle links to entities with a custom slug or even w/o a slug. |
|
| 206 | - * |
|
| 207 | - * @since 3.6.0 |
|
| 208 | - * @access private |
|
| 209 | - * @var \Wordlift_Entity_Link_Service |
|
| 210 | - */ |
|
| 211 | - private $entity_link_service; |
|
| 212 | - |
|
| 213 | - /** |
|
| 214 | - * A {@link Wordlift_Sparql_Service} instance. |
|
| 215 | - * |
|
| 216 | - * @var 3.6.0 |
|
| 217 | - * @access protected |
|
| 218 | - * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance. |
|
| 219 | - */ |
|
| 220 | - protected $sparql_service; |
|
| 221 | - |
|
| 222 | - /** |
|
| 223 | - * A {@link Wordlift_Import_Service} instance. |
|
| 224 | - * |
|
| 225 | - * @since 3.6.0 |
|
| 226 | - * @access private |
|
| 227 | - * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance. |
|
| 228 | - */ |
|
| 229 | - private $import_service; |
|
| 230 | - |
|
| 231 | - /** |
|
| 232 | - * A {@link Wordlift_Rebuild_Service} instance. |
|
| 233 | - * |
|
| 234 | - * @since 3.6.0 |
|
| 235 | - * @access private |
|
| 236 | - * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance. |
|
| 237 | - */ |
|
| 238 | - private $rebuild_service; |
|
| 239 | - |
|
| 240 | - /** |
|
| 241 | - * A {@link Wordlift_Jsonld_Service} instance. |
|
| 242 | - * |
|
| 243 | - * @since 3.7.0 |
|
| 244 | - * @access protected |
|
| 245 | - * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance. |
|
| 246 | - */ |
|
| 247 | - protected $jsonld_service; |
|
| 248 | - |
|
| 249 | - /** |
|
| 250 | - * A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 251 | - * |
|
| 252 | - * @since 3.14.0 |
|
| 253 | - * @access protected |
|
| 254 | - * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 255 | - */ |
|
| 256 | - protected $jsonld_website_converter; |
|
| 257 | - |
|
| 258 | - /** |
|
| 259 | - * |
|
| 260 | - * @since 3.7.0 |
|
| 261 | - * @access private |
|
| 262 | - * @var \Wordlift_Property_Factory $property_factory |
|
| 263 | - */ |
|
| 264 | - private $property_factory; |
|
| 265 | - |
|
| 266 | - /** |
|
| 267 | - * The 'Download Your Data' page. |
|
| 268 | - * |
|
| 269 | - * @since 3.6.0 |
|
| 270 | - * @access private |
|
| 271 | - * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page. |
|
| 272 | - */ |
|
| 273 | - private $download_your_data_page; |
|
| 274 | - |
|
| 275 | - /** |
|
| 276 | - * The 'WordLift Settings' page. |
|
| 277 | - * |
|
| 278 | - * @since 3.11.0 |
|
| 279 | - * @access protected |
|
| 280 | - * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page. |
|
| 281 | - */ |
|
| 282 | - protected $settings_page; |
|
| 283 | - |
|
| 284 | - /** |
|
| 285 | - * The 'WordLift Batch analysis' page. |
|
| 286 | - * |
|
| 287 | - * @since 3.14.0 |
|
| 288 | - * @access protected |
|
| 289 | - * @var \Wordlift_Batch_Analysis_Page $sbatch_analysis_page The 'WordLift batcch analysis' page. |
|
| 290 | - */ |
|
| 291 | - protected $batch_analysis_page; |
|
| 292 | - |
|
| 293 | - /** |
|
| 294 | - * The install wizard page. |
|
| 295 | - * |
|
| 296 | - * @since 3.9.0 |
|
| 297 | - * @access private |
|
| 298 | - * @var \Wordlift_Admin_Setup $admin_setup The Install wizard. |
|
| 299 | - */ |
|
| 300 | - private $admin_setup; |
|
| 301 | - |
|
| 302 | - /** |
|
| 303 | - * The Content Filter Service hooks up to the 'the_content' filter and provides |
|
| 304 | - * linking of entities to their pages. |
|
| 305 | - * |
|
| 306 | - * @since 3.8.0 |
|
| 307 | - * @access private |
|
| 308 | - * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance. |
|
| 309 | - */ |
|
| 310 | - private $content_filter_service; |
|
| 311 | - |
|
| 312 | - /** |
|
| 313 | - * A {@link Wordlift_Key_Validation_Service} instance. |
|
| 314 | - * |
|
| 315 | - * @since 3.9.0 |
|
| 316 | - * @access private |
|
| 317 | - * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance. |
|
| 318 | - */ |
|
| 319 | - private $key_validation_service; |
|
| 320 | - |
|
| 321 | - /** |
|
| 322 | - * A {@link Wordlift_Rating_Service} instance. |
|
| 323 | - * |
|
| 324 | - * @since 3.10.0 |
|
| 325 | - * @access private |
|
| 326 | - * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance. |
|
| 327 | - */ |
|
| 328 | - private $rating_service; |
|
| 329 | - |
|
| 330 | - /** |
|
| 331 | - * A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 332 | - * |
|
| 333 | - * @since 3.10.0 |
|
| 334 | - * @access protected |
|
| 335 | - * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 336 | - */ |
|
| 337 | - protected $post_to_jsonld_converter; |
|
| 338 | - |
|
| 339 | - /** |
|
| 340 | - * A {@link Wordlift_Configuration_Service} instance. |
|
| 341 | - * |
|
| 342 | - * @since 3.10.0 |
|
| 343 | - * @access protected |
|
| 344 | - * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance. |
|
| 345 | - */ |
|
| 346 | - protected $configuration_service; |
|
| 347 | - |
|
| 348 | - /** |
|
| 349 | - * A {@link Wordlift_Entity_Type_Service} instance. |
|
| 350 | - * |
|
| 351 | - * @since 3.10.0 |
|
| 352 | - * @access protected |
|
| 353 | - * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance. |
|
| 354 | - */ |
|
| 355 | - protected $entity_type_service; |
|
| 356 | - |
|
| 357 | - /** |
|
| 358 | - * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 359 | - * |
|
| 360 | - * @since 3.10.0 |
|
| 361 | - * @access protected |
|
| 362 | - * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 363 | - */ |
|
| 364 | - protected $entity_post_to_jsonld_converter; |
|
| 365 | - |
|
| 366 | - /** |
|
| 367 | - * A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 368 | - * |
|
| 369 | - * @since 3.10.0 |
|
| 370 | - * @access protected |
|
| 371 | - * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 372 | - */ |
|
| 373 | - protected $postid_to_jsonld_converter; |
|
| 374 | - |
|
| 375 | - /** |
|
| 376 | - * The {@link Wordlift_Admin_Status_Page} class. |
|
| 377 | - * |
|
| 378 | - * @since 3.9.8 |
|
| 379 | - * @access private |
|
| 380 | - * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class. |
|
| 381 | - */ |
|
| 382 | - private $status_page; |
|
| 383 | - |
|
| 384 | - /** |
|
| 385 | - * The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 386 | - * |
|
| 387 | - * @since 3.11.0 |
|
| 388 | - * @access protected |
|
| 389 | - * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 390 | - */ |
|
| 391 | - protected $category_taxonomy_service; |
|
| 392 | - |
|
| 393 | - /** |
|
| 394 | - * The {@link Wordlift_Entity_Page_Service} instance. |
|
| 395 | - * |
|
| 396 | - * @since 3.11.0 |
|
| 397 | - * @access protected |
|
| 398 | - * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance. |
|
| 399 | - */ |
|
| 400 | - protected $entity_page_service; |
|
| 401 | - |
|
| 402 | - /** |
|
| 403 | - * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 404 | - * |
|
| 405 | - * @since 3.11.0 |
|
| 406 | - * @access protected |
|
| 407 | - * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 408 | - */ |
|
| 409 | - protected $settings_page_action_link; |
|
| 410 | - |
|
| 411 | - /** |
|
| 412 | - * The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 413 | - * |
|
| 414 | - * @since 3.11.0 |
|
| 415 | - * @access protected |
|
| 416 | - * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 417 | - */ |
|
| 418 | - protected $publisher_ajax_adapter; |
|
| 419 | - |
|
| 420 | - /** |
|
| 421 | - * The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 422 | - * |
|
| 423 | - * @since 3.11.0 |
|
| 424 | - * @access protected |
|
| 425 | - * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 426 | - */ |
|
| 427 | - protected $input_element; |
|
| 428 | - |
|
| 429 | - /** |
|
| 430 | - * The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 431 | - * |
|
| 432 | - * @since 3.13.0 |
|
| 433 | - * @access protected |
|
| 434 | - * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 435 | - */ |
|
| 436 | - protected $radio_input_element; |
|
| 437 | - |
|
| 438 | - /** |
|
| 439 | - * The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 440 | - * |
|
| 441 | - * @since 3.11.0 |
|
| 442 | - * @access protected |
|
| 443 | - * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 444 | - */ |
|
| 445 | - protected $language_select_element; |
|
| 446 | - |
|
| 447 | - /** |
|
| 448 | - * The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 449 | - * |
|
| 450 | - * @since 3.11.0 |
|
| 451 | - * @access protected |
|
| 452 | - * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 453 | - */ |
|
| 454 | - protected $publisher_element; |
|
| 455 | - |
|
| 456 | - /** |
|
| 457 | - * The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 458 | - * |
|
| 459 | - * @since 3.11.0 |
|
| 460 | - * @access protected |
|
| 461 | - * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 462 | - */ |
|
| 463 | - protected $select2_element; |
|
| 464 | - |
|
| 465 | - /** |
|
| 466 | - * The controller for the entity type list admin page |
|
| 467 | - * |
|
| 468 | - * @since 3.11.0 |
|
| 469 | - * @access private |
|
| 470 | - * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class. |
|
| 471 | - */ |
|
| 472 | - private $entity_type_admin_page; |
|
| 473 | - |
|
| 474 | - /** |
|
| 475 | - * The controller for the entity type settings admin page |
|
| 476 | - * |
|
| 477 | - * @since 3.11.0 |
|
| 478 | - * @access private |
|
| 479 | - * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class. |
|
| 480 | - */ |
|
| 481 | - private $entity_type_settings_admin_page; |
|
| 482 | - |
|
| 483 | - /** |
|
| 484 | - * The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 485 | - * |
|
| 486 | - * @since 3.11.0 |
|
| 487 | - * @access protected |
|
| 488 | - * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 489 | - */ |
|
| 490 | - protected $related_entities_cloud_widget; |
|
| 491 | - |
|
| 492 | - /** |
|
| 493 | - * The {@link Wordlift_Admin_Author_Element} instance. |
|
| 494 | - * |
|
| 495 | - * @since 3.14.0 |
|
| 496 | - * @access protected |
|
| 497 | - * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance. |
|
| 498 | - */ |
|
| 499 | - protected $author_element; |
|
| 500 | - |
|
| 501 | - /** |
|
| 502 | - * The {@link Wordlift_Batch_Analysis_Service} instance. |
|
| 503 | - * |
|
| 504 | - * @since 3.14.0 |
|
| 505 | - * @access protected |
|
| 506 | - * @var \Wordlift_Batch_Analysis_Service $batch_analysis_service The {@link Wordlift_Batch_Analysis_Service} instance. |
|
| 507 | - */ |
|
| 508 | - protected $batch_analysis_service; |
|
| 509 | - |
|
| 510 | - /** |
|
| 511 | - * The {@link Wordlift_Sample_Data_Service} instance. |
|
| 512 | - * |
|
| 513 | - * @since 3.12.0 |
|
| 514 | - * @access protected |
|
| 515 | - * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance. |
|
| 516 | - */ |
|
| 517 | - protected $sample_data_service; |
|
| 518 | - |
|
| 519 | - /** |
|
| 520 | - * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 521 | - * |
|
| 522 | - * @since 3.12.0 |
|
| 523 | - * @access protected |
|
| 524 | - * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 525 | - */ |
|
| 526 | - protected $sample_data_ajax_adapter; |
|
| 527 | - |
|
| 528 | - /** |
|
| 529 | - * The {@link Wordlift_Batch_Analysis_Adapter} instance. |
|
| 530 | - * |
|
| 531 | - * @since 3.14.2 |
|
| 532 | - * @access protected |
|
| 533 | - * @var \Wordlift_Batch_Analysis_Adapter $batch_analysis_adapter The {@link Wordlift_Batch_Analysis_Adapter} instance. |
|
| 534 | - */ |
|
| 535 | - private $batch_analysis_adapter; |
|
| 536 | - |
|
| 537 | - /** |
|
| 538 | - * The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 539 | - * |
|
| 540 | - * @since 3.14.3 |
|
| 541 | - * @access private |
|
| 542 | - * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 543 | - */ |
|
| 544 | - private $relation_rebuild_service; |
|
| 545 | - |
|
| 546 | - /** |
|
| 547 | - * The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 548 | - * |
|
| 549 | - * @since 3.14.3 |
|
| 550 | - * @access private |
|
| 551 | - * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 552 | - */ |
|
| 553 | - private $relation_rebuild_adapter; |
|
| 554 | - |
|
| 555 | - /** |
|
| 556 | - * The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 557 | - * |
|
| 558 | - * @since 3.15.0 |
|
| 559 | - * @access protected |
|
| 560 | - * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 561 | - */ |
|
| 562 | - protected $google_analytics_export_service; |
|
| 563 | - |
|
| 564 | - /** |
|
| 565 | - * {@link Wordlift}'s singleton instance. |
|
| 566 | - * |
|
| 567 | - * @since 3.15.0 |
|
| 568 | - * @access protected |
|
| 569 | - * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance. |
|
| 570 | - */ |
|
| 571 | - protected $entity_type_adapter; |
|
| 572 | - |
|
| 573 | - /** |
|
| 574 | - * The {@link Wordlift_Linked_Data_Service} instance. |
|
| 575 | - * |
|
| 576 | - * @since 3.15.0 |
|
| 577 | - * @access protected |
|
| 578 | - * @var \Wordlift_Linked_Data_Service $linked_data_service The {@link Wordlift_Linked_Data_Service} instance. |
|
| 579 | - */ |
|
| 580 | - protected $linked_data_service; |
|
| 581 | - |
|
| 582 | - /** |
|
| 583 | - * The {@link Wordlift_Storage_Factory} instance. |
|
| 584 | - * |
|
| 585 | - * @since 3.15.0 |
|
| 586 | - * @access protected |
|
| 587 | - * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance. |
|
| 588 | - */ |
|
| 589 | - protected $storage_factory; |
|
| 590 | - |
|
| 591 | - /** |
|
| 592 | - * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 593 | - * |
|
| 594 | - * @since 3.15.0 |
|
| 595 | - * @access protected |
|
| 596 | - * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 597 | - */ |
|
| 598 | - protected $rendition_factory; |
|
| 599 | - |
|
| 600 | - /** |
|
| 601 | - * The {@link Wordlift_Autocomplete_Service} instance. |
|
| 602 | - * |
|
| 603 | - * @since 3.15.0 |
|
| 604 | - * @access private |
|
| 605 | - * @var \Wordlift_Autocomplete_Service $autocomplete_service The {@link Wordlift_Autocomplete_Service} instance. |
|
| 606 | - */ |
|
| 607 | - private $autocomplete_service; |
|
| 608 | - |
|
| 609 | - /** |
|
| 610 | - * The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 611 | - * |
|
| 612 | - * @since 3.15.0 |
|
| 613 | - * @access private |
|
| 614 | - * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 615 | - */ |
|
| 616 | - private $autocomplete_adapter; |
|
| 617 | - |
|
| 618 | - /** |
|
| 619 | - * The {@link Wordlift_Relation_Service} instance. |
|
| 620 | - * |
|
| 621 | - * @since 3.15.0 |
|
| 622 | - * @access private |
|
| 623 | - * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance. |
|
| 624 | - */ |
|
| 625 | - private $relation_service; |
|
| 626 | - |
|
| 627 | - /** |
|
| 628 | - * {@link Wordlift}'s singleton instance. |
|
| 629 | - * |
|
| 630 | - * @since 3.11.2 |
|
| 631 | - * @access private |
|
| 632 | - * @var Wordlift $instance {@link Wordlift}'s singleton instance. |
|
| 633 | - */ |
|
| 634 | - private static $instance; |
|
| 635 | - |
|
| 636 | - /** |
|
| 637 | - * Define the core functionality of the plugin. |
|
| 638 | - * |
|
| 639 | - * Set the plugin name and the plugin version that can be used throughout the plugin. |
|
| 640 | - * Load the dependencies, define the locale, and set the hooks for the admin area and |
|
| 641 | - * the public-facing side of the site. |
|
| 642 | - * |
|
| 643 | - * @since 1.0.0 |
|
| 644 | - */ |
|
| 645 | - public function __construct() { |
|
| 646 | - |
|
| 647 | - $this->plugin_name = 'wordlift'; |
|
| 648 | - $this->version = '3.15.0-dev'; |
|
| 649 | - $this->load_dependencies(); |
|
| 650 | - $this->set_locale(); |
|
| 651 | - $this->define_admin_hooks(); |
|
| 652 | - $this->define_public_hooks(); |
|
| 653 | - |
|
| 654 | - self::$instance = $this; |
|
| 655 | - |
|
| 656 | - } |
|
| 657 | - |
|
| 658 | - /** |
|
| 659 | - * Get the singleton instance. |
|
| 660 | - * |
|
| 661 | - * @since 3.11.2 |
|
| 662 | - * |
|
| 663 | - * @return Wordlift The {@link Wordlift} singleton instance. |
|
| 664 | - */ |
|
| 665 | - public static function get_instance() { |
|
| 666 | - |
|
| 667 | - return self::$instance; |
|
| 668 | - } |
|
| 669 | - |
|
| 670 | - /** |
|
| 671 | - * Load the required dependencies for this plugin. |
|
| 672 | - * |
|
| 673 | - * Include the following files that make up the plugin: |
|
| 674 | - * |
|
| 675 | - * - Wordlift_Loader. Orchestrates the hooks of the plugin. |
|
| 676 | - * - Wordlift_i18n. Defines internationalization functionality. |
|
| 677 | - * - Wordlift_Admin. Defines all hooks for the admin area. |
|
| 678 | - * - Wordlift_Public. Defines all hooks for the public side of the site. |
|
| 679 | - * |
|
| 680 | - * Create an instance of the loader which will be used to register the hooks |
|
| 681 | - * with WordPress. |
|
| 682 | - * |
|
| 683 | - * @since 1.0.0 |
|
| 684 | - * @access private |
|
| 685 | - */ |
|
| 686 | - private function load_dependencies() { |
|
| 687 | - |
|
| 688 | - /** |
|
| 689 | - * The class responsible for orchestrating the actions and filters of the |
|
| 690 | - * core plugin. |
|
| 691 | - */ |
|
| 692 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 693 | - |
|
| 694 | - /** |
|
| 695 | - * The class responsible for defining internationalization functionality |
|
| 696 | - * of the plugin. |
|
| 697 | - */ |
|
| 698 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 699 | - |
|
| 700 | - /** |
|
| 701 | - * WordLift's supported languages. |
|
| 702 | - */ |
|
| 703 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 704 | - |
|
| 705 | - /** |
|
| 706 | - * Provide support functions to sanitize data. |
|
| 707 | - */ |
|
| 708 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 709 | - |
|
| 710 | - /** Services. */ |
|
| 711 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 712 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 713 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 714 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 715 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 716 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 717 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
|
| 718 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 719 | - |
|
| 720 | - /** |
|
| 721 | - * The Query builder. |
|
| 722 | - */ |
|
| 723 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 724 | - |
|
| 725 | - /** |
|
| 726 | - * The Schema service. |
|
| 727 | - */ |
|
| 728 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 729 | - |
|
| 730 | - /** |
|
| 731 | - * The schema:url property service. |
|
| 732 | - */ |
|
| 733 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 734 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 735 | - |
|
| 736 | - /** |
|
| 737 | - * The UI service. |
|
| 738 | - */ |
|
| 739 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 740 | - |
|
| 741 | - /** |
|
| 742 | - * The Thumbnail service. |
|
| 743 | - */ |
|
| 744 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 745 | - |
|
| 746 | - /** |
|
| 747 | - * The Entity Types Taxonomy service. |
|
| 748 | - */ |
|
| 749 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-types-taxonomy-service.php'; |
|
| 750 | - |
|
| 751 | - /** |
|
| 752 | - * The Entity service. |
|
| 753 | - */ |
|
| 754 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 755 | - |
|
| 756 | - // Add the entity rating service. |
|
| 757 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 758 | - |
|
| 759 | - /** |
|
| 760 | - * The User service. |
|
| 761 | - */ |
|
| 762 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 763 | - |
|
| 764 | - /** |
|
| 765 | - * The Timeline service. |
|
| 766 | - */ |
|
| 767 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 768 | - |
|
| 769 | - /** |
|
| 770 | - * The Topic Taxonomy service. |
|
| 771 | - */ |
|
| 772 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 773 | - |
|
| 774 | - /** |
|
| 775 | - * The SPARQL service. |
|
| 776 | - */ |
|
| 777 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 778 | - |
|
| 779 | - /** |
|
| 780 | - * The WordLift import service. |
|
| 781 | - */ |
|
| 782 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 783 | - |
|
| 784 | - /** |
|
| 785 | - * The WordLift URI service. |
|
| 786 | - */ |
|
| 787 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 788 | - |
|
| 789 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-listable.php'; |
|
| 790 | - |
|
| 791 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 792 | - |
|
| 793 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 794 | - |
|
| 795 | - /** |
|
| 796 | - * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
|
| 797 | - */ |
|
| 798 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rebuild-service.php'; |
|
| 799 | - |
|
| 800 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 801 | - |
|
| 802 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 803 | - |
|
| 804 | - /** |
|
| 805 | - * Load the converters. |
|
| 806 | - */ |
|
| 807 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 808 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 809 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 810 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 811 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 812 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 813 | - |
|
| 814 | - /** |
|
| 815 | - * Load the content filter. |
|
| 816 | - */ |
|
| 817 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 818 | - |
|
| 819 | - /* |
|
| 32 | + /** |
|
| 33 | + * The loader that's responsible for maintaining and registering all hooks that power |
|
| 34 | + * the plugin. |
|
| 35 | + * |
|
| 36 | + * @since 1.0.0 |
|
| 37 | + * @access protected |
|
| 38 | + * @var Wordlift_Loader $loader Maintains and registers all hooks for the plugin. |
|
| 39 | + */ |
|
| 40 | + protected $loader; |
|
| 41 | + |
|
| 42 | + /** |
|
| 43 | + * The unique identifier of this plugin. |
|
| 44 | + * |
|
| 45 | + * @since 1.0.0 |
|
| 46 | + * @access protected |
|
| 47 | + * @var string $plugin_name The string used to uniquely identify this plugin. |
|
| 48 | + */ |
|
| 49 | + protected $plugin_name; |
|
| 50 | + |
|
| 51 | + /** |
|
| 52 | + * The current version of the plugin. |
|
| 53 | + * |
|
| 54 | + * @since 1.0.0 |
|
| 55 | + * @access protected |
|
| 56 | + * @var string $version The current version of the plugin. |
|
| 57 | + */ |
|
| 58 | + protected $version; |
|
| 59 | + |
|
| 60 | + /** |
|
| 61 | + * The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 62 | + * |
|
| 63 | + * @since 3.12.0 |
|
| 64 | + * @access protected |
|
| 65 | + * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 66 | + */ |
|
| 67 | + protected $tinymce_adapter; |
|
| 68 | + |
|
| 69 | + /** |
|
| 70 | + * The Thumbnail service. |
|
| 71 | + * |
|
| 72 | + * @since 3.1.5 |
|
| 73 | + * @access private |
|
| 74 | + * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service. |
|
| 75 | + */ |
|
| 76 | + private $thumbnail_service; |
|
| 77 | + |
|
| 78 | + /** |
|
| 79 | + * The UI service. |
|
| 80 | + * |
|
| 81 | + * @since 3.2.0 |
|
| 82 | + * @access private |
|
| 83 | + * @var \Wordlift_UI_Service $ui_service The UI service. |
|
| 84 | + */ |
|
| 85 | + private $ui_service; |
|
| 86 | + |
|
| 87 | + /** |
|
| 88 | + * The Schema service. |
|
| 89 | + * |
|
| 90 | + * @since 3.3.0 |
|
| 91 | + * @access protected |
|
| 92 | + * @var \Wordlift_Schema_Service $schema_service The Schema service. |
|
| 93 | + */ |
|
| 94 | + protected $schema_service; |
|
| 95 | + |
|
| 96 | + /** |
|
| 97 | + * The Entity service. |
|
| 98 | + * |
|
| 99 | + * @since 3.1.0 |
|
| 100 | + * @access protected |
|
| 101 | + * @var \Wordlift_Entity_Service $entity_service The Entity service. |
|
| 102 | + */ |
|
| 103 | + protected $entity_service; |
|
| 104 | + |
|
| 105 | + /** |
|
| 106 | + * The Topic Taxonomy service. |
|
| 107 | + * |
|
| 108 | + * @since 3.5.0 |
|
| 109 | + * @access private |
|
| 110 | + * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service. |
|
| 111 | + */ |
|
| 112 | + private $topic_taxonomy_service; |
|
| 113 | + |
|
| 114 | + /** |
|
| 115 | + * The User service. |
|
| 116 | + * |
|
| 117 | + * @since 3.1.7 |
|
| 118 | + * @access protected |
|
| 119 | + * @var \Wordlift_User_Service $user_service The User service. |
|
| 120 | + */ |
|
| 121 | + protected $user_service; |
|
| 122 | + |
|
| 123 | + /** |
|
| 124 | + * The Timeline service. |
|
| 125 | + * |
|
| 126 | + * @since 3.1.0 |
|
| 127 | + * @access private |
|
| 128 | + * @var \Wordlift_Timeline_Service $timeline_service The Timeline service. |
|
| 129 | + */ |
|
| 130 | + private $timeline_service; |
|
| 131 | + |
|
| 132 | + /** |
|
| 133 | + * The Redirect service. |
|
| 134 | + * |
|
| 135 | + * @since 3.2.0 |
|
| 136 | + * @access private |
|
| 137 | + * @var \Wordlift_Redirect_Service $redirect_service The Redirect service. |
|
| 138 | + */ |
|
| 139 | + private $redirect_service; |
|
| 140 | + |
|
| 141 | + /** |
|
| 142 | + * The Notice service. |
|
| 143 | + * |
|
| 144 | + * @since 3.3.0 |
|
| 145 | + * @access private |
|
| 146 | + * @var \Wordlift_Notice_Service $notice_service The Notice service. |
|
| 147 | + */ |
|
| 148 | + private $notice_service; |
|
| 149 | + |
|
| 150 | + /** |
|
| 151 | + * The Entity list customization. |
|
| 152 | + * |
|
| 153 | + * @since 3.3.0 |
|
| 154 | + * @access private |
|
| 155 | + * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service. |
|
| 156 | + */ |
|
| 157 | + private $entity_list_service; |
|
| 158 | + |
|
| 159 | + /** |
|
| 160 | + * The Entity Types Taxonomy Walker. |
|
| 161 | + * |
|
| 162 | + * @since 3.1.0 |
|
| 163 | + * @access private |
|
| 164 | + * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker |
|
| 165 | + */ |
|
| 166 | + private $entity_types_taxonomy_walker; |
|
| 167 | + |
|
| 168 | + /** |
|
| 169 | + * The ShareThis service. |
|
| 170 | + * |
|
| 171 | + * @since 3.2.0 |
|
| 172 | + * @access private |
|
| 173 | + * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service. |
|
| 174 | + */ |
|
| 175 | + private $sharethis_service; |
|
| 176 | + |
|
| 177 | + /** |
|
| 178 | + * The PrimaShop adapter. |
|
| 179 | + * |
|
| 180 | + * @since 3.2.3 |
|
| 181 | + * @access private |
|
| 182 | + * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter. |
|
| 183 | + */ |
|
| 184 | + private $primashop_adapter; |
|
| 185 | + |
|
| 186 | + /** |
|
| 187 | + * The WordLift Dashboard adapter. |
|
| 188 | + * |
|
| 189 | + * @since 3.4.0 |
|
| 190 | + * @access private |
|
| 191 | + * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service; |
|
| 192 | + */ |
|
| 193 | + private $dashboard_service; |
|
| 194 | + |
|
| 195 | + /** |
|
| 196 | + * The entity type service. |
|
| 197 | + * |
|
| 198 | + * @since 3.6.0 |
|
| 199 | + * @access private |
|
| 200 | + * @var \Wordlift_Entity_Post_Type_Service |
|
| 201 | + */ |
|
| 202 | + private $entity_post_type_service; |
|
| 203 | + |
|
| 204 | + /** |
|
| 205 | + * The entity link service used to mangle links to entities with a custom slug or even w/o a slug. |
|
| 206 | + * |
|
| 207 | + * @since 3.6.0 |
|
| 208 | + * @access private |
|
| 209 | + * @var \Wordlift_Entity_Link_Service |
|
| 210 | + */ |
|
| 211 | + private $entity_link_service; |
|
| 212 | + |
|
| 213 | + /** |
|
| 214 | + * A {@link Wordlift_Sparql_Service} instance. |
|
| 215 | + * |
|
| 216 | + * @var 3.6.0 |
|
| 217 | + * @access protected |
|
| 218 | + * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance. |
|
| 219 | + */ |
|
| 220 | + protected $sparql_service; |
|
| 221 | + |
|
| 222 | + /** |
|
| 223 | + * A {@link Wordlift_Import_Service} instance. |
|
| 224 | + * |
|
| 225 | + * @since 3.6.0 |
|
| 226 | + * @access private |
|
| 227 | + * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance. |
|
| 228 | + */ |
|
| 229 | + private $import_service; |
|
| 230 | + |
|
| 231 | + /** |
|
| 232 | + * A {@link Wordlift_Rebuild_Service} instance. |
|
| 233 | + * |
|
| 234 | + * @since 3.6.0 |
|
| 235 | + * @access private |
|
| 236 | + * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance. |
|
| 237 | + */ |
|
| 238 | + private $rebuild_service; |
|
| 239 | + |
|
| 240 | + /** |
|
| 241 | + * A {@link Wordlift_Jsonld_Service} instance. |
|
| 242 | + * |
|
| 243 | + * @since 3.7.0 |
|
| 244 | + * @access protected |
|
| 245 | + * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance. |
|
| 246 | + */ |
|
| 247 | + protected $jsonld_service; |
|
| 248 | + |
|
| 249 | + /** |
|
| 250 | + * A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 251 | + * |
|
| 252 | + * @since 3.14.0 |
|
| 253 | + * @access protected |
|
| 254 | + * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 255 | + */ |
|
| 256 | + protected $jsonld_website_converter; |
|
| 257 | + |
|
| 258 | + /** |
|
| 259 | + * |
|
| 260 | + * @since 3.7.0 |
|
| 261 | + * @access private |
|
| 262 | + * @var \Wordlift_Property_Factory $property_factory |
|
| 263 | + */ |
|
| 264 | + private $property_factory; |
|
| 265 | + |
|
| 266 | + /** |
|
| 267 | + * The 'Download Your Data' page. |
|
| 268 | + * |
|
| 269 | + * @since 3.6.0 |
|
| 270 | + * @access private |
|
| 271 | + * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page. |
|
| 272 | + */ |
|
| 273 | + private $download_your_data_page; |
|
| 274 | + |
|
| 275 | + /** |
|
| 276 | + * The 'WordLift Settings' page. |
|
| 277 | + * |
|
| 278 | + * @since 3.11.0 |
|
| 279 | + * @access protected |
|
| 280 | + * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page. |
|
| 281 | + */ |
|
| 282 | + protected $settings_page; |
|
| 283 | + |
|
| 284 | + /** |
|
| 285 | + * The 'WordLift Batch analysis' page. |
|
| 286 | + * |
|
| 287 | + * @since 3.14.0 |
|
| 288 | + * @access protected |
|
| 289 | + * @var \Wordlift_Batch_Analysis_Page $sbatch_analysis_page The 'WordLift batcch analysis' page. |
|
| 290 | + */ |
|
| 291 | + protected $batch_analysis_page; |
|
| 292 | + |
|
| 293 | + /** |
|
| 294 | + * The install wizard page. |
|
| 295 | + * |
|
| 296 | + * @since 3.9.0 |
|
| 297 | + * @access private |
|
| 298 | + * @var \Wordlift_Admin_Setup $admin_setup The Install wizard. |
|
| 299 | + */ |
|
| 300 | + private $admin_setup; |
|
| 301 | + |
|
| 302 | + /** |
|
| 303 | + * The Content Filter Service hooks up to the 'the_content' filter and provides |
|
| 304 | + * linking of entities to their pages. |
|
| 305 | + * |
|
| 306 | + * @since 3.8.0 |
|
| 307 | + * @access private |
|
| 308 | + * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance. |
|
| 309 | + */ |
|
| 310 | + private $content_filter_service; |
|
| 311 | + |
|
| 312 | + /** |
|
| 313 | + * A {@link Wordlift_Key_Validation_Service} instance. |
|
| 314 | + * |
|
| 315 | + * @since 3.9.0 |
|
| 316 | + * @access private |
|
| 317 | + * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance. |
|
| 318 | + */ |
|
| 319 | + private $key_validation_service; |
|
| 320 | + |
|
| 321 | + /** |
|
| 322 | + * A {@link Wordlift_Rating_Service} instance. |
|
| 323 | + * |
|
| 324 | + * @since 3.10.0 |
|
| 325 | + * @access private |
|
| 326 | + * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance. |
|
| 327 | + */ |
|
| 328 | + private $rating_service; |
|
| 329 | + |
|
| 330 | + /** |
|
| 331 | + * A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 332 | + * |
|
| 333 | + * @since 3.10.0 |
|
| 334 | + * @access protected |
|
| 335 | + * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 336 | + */ |
|
| 337 | + protected $post_to_jsonld_converter; |
|
| 338 | + |
|
| 339 | + /** |
|
| 340 | + * A {@link Wordlift_Configuration_Service} instance. |
|
| 341 | + * |
|
| 342 | + * @since 3.10.0 |
|
| 343 | + * @access protected |
|
| 344 | + * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance. |
|
| 345 | + */ |
|
| 346 | + protected $configuration_service; |
|
| 347 | + |
|
| 348 | + /** |
|
| 349 | + * A {@link Wordlift_Entity_Type_Service} instance. |
|
| 350 | + * |
|
| 351 | + * @since 3.10.0 |
|
| 352 | + * @access protected |
|
| 353 | + * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance. |
|
| 354 | + */ |
|
| 355 | + protected $entity_type_service; |
|
| 356 | + |
|
| 357 | + /** |
|
| 358 | + * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 359 | + * |
|
| 360 | + * @since 3.10.0 |
|
| 361 | + * @access protected |
|
| 362 | + * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 363 | + */ |
|
| 364 | + protected $entity_post_to_jsonld_converter; |
|
| 365 | + |
|
| 366 | + /** |
|
| 367 | + * A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 368 | + * |
|
| 369 | + * @since 3.10.0 |
|
| 370 | + * @access protected |
|
| 371 | + * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 372 | + */ |
|
| 373 | + protected $postid_to_jsonld_converter; |
|
| 374 | + |
|
| 375 | + /** |
|
| 376 | + * The {@link Wordlift_Admin_Status_Page} class. |
|
| 377 | + * |
|
| 378 | + * @since 3.9.8 |
|
| 379 | + * @access private |
|
| 380 | + * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class. |
|
| 381 | + */ |
|
| 382 | + private $status_page; |
|
| 383 | + |
|
| 384 | + /** |
|
| 385 | + * The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 386 | + * |
|
| 387 | + * @since 3.11.0 |
|
| 388 | + * @access protected |
|
| 389 | + * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 390 | + */ |
|
| 391 | + protected $category_taxonomy_service; |
|
| 392 | + |
|
| 393 | + /** |
|
| 394 | + * The {@link Wordlift_Entity_Page_Service} instance. |
|
| 395 | + * |
|
| 396 | + * @since 3.11.0 |
|
| 397 | + * @access protected |
|
| 398 | + * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance. |
|
| 399 | + */ |
|
| 400 | + protected $entity_page_service; |
|
| 401 | + |
|
| 402 | + /** |
|
| 403 | + * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 404 | + * |
|
| 405 | + * @since 3.11.0 |
|
| 406 | + * @access protected |
|
| 407 | + * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 408 | + */ |
|
| 409 | + protected $settings_page_action_link; |
|
| 410 | + |
|
| 411 | + /** |
|
| 412 | + * The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 413 | + * |
|
| 414 | + * @since 3.11.0 |
|
| 415 | + * @access protected |
|
| 416 | + * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 417 | + */ |
|
| 418 | + protected $publisher_ajax_adapter; |
|
| 419 | + |
|
| 420 | + /** |
|
| 421 | + * The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 422 | + * |
|
| 423 | + * @since 3.11.0 |
|
| 424 | + * @access protected |
|
| 425 | + * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 426 | + */ |
|
| 427 | + protected $input_element; |
|
| 428 | + |
|
| 429 | + /** |
|
| 430 | + * The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 431 | + * |
|
| 432 | + * @since 3.13.0 |
|
| 433 | + * @access protected |
|
| 434 | + * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 435 | + */ |
|
| 436 | + protected $radio_input_element; |
|
| 437 | + |
|
| 438 | + /** |
|
| 439 | + * The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 440 | + * |
|
| 441 | + * @since 3.11.0 |
|
| 442 | + * @access protected |
|
| 443 | + * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 444 | + */ |
|
| 445 | + protected $language_select_element; |
|
| 446 | + |
|
| 447 | + /** |
|
| 448 | + * The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 449 | + * |
|
| 450 | + * @since 3.11.0 |
|
| 451 | + * @access protected |
|
| 452 | + * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 453 | + */ |
|
| 454 | + protected $publisher_element; |
|
| 455 | + |
|
| 456 | + /** |
|
| 457 | + * The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 458 | + * |
|
| 459 | + * @since 3.11.0 |
|
| 460 | + * @access protected |
|
| 461 | + * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 462 | + */ |
|
| 463 | + protected $select2_element; |
|
| 464 | + |
|
| 465 | + /** |
|
| 466 | + * The controller for the entity type list admin page |
|
| 467 | + * |
|
| 468 | + * @since 3.11.0 |
|
| 469 | + * @access private |
|
| 470 | + * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class. |
|
| 471 | + */ |
|
| 472 | + private $entity_type_admin_page; |
|
| 473 | + |
|
| 474 | + /** |
|
| 475 | + * The controller for the entity type settings admin page |
|
| 476 | + * |
|
| 477 | + * @since 3.11.0 |
|
| 478 | + * @access private |
|
| 479 | + * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class. |
|
| 480 | + */ |
|
| 481 | + private $entity_type_settings_admin_page; |
|
| 482 | + |
|
| 483 | + /** |
|
| 484 | + * The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 485 | + * |
|
| 486 | + * @since 3.11.0 |
|
| 487 | + * @access protected |
|
| 488 | + * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 489 | + */ |
|
| 490 | + protected $related_entities_cloud_widget; |
|
| 491 | + |
|
| 492 | + /** |
|
| 493 | + * The {@link Wordlift_Admin_Author_Element} instance. |
|
| 494 | + * |
|
| 495 | + * @since 3.14.0 |
|
| 496 | + * @access protected |
|
| 497 | + * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance. |
|
| 498 | + */ |
|
| 499 | + protected $author_element; |
|
| 500 | + |
|
| 501 | + /** |
|
| 502 | + * The {@link Wordlift_Batch_Analysis_Service} instance. |
|
| 503 | + * |
|
| 504 | + * @since 3.14.0 |
|
| 505 | + * @access protected |
|
| 506 | + * @var \Wordlift_Batch_Analysis_Service $batch_analysis_service The {@link Wordlift_Batch_Analysis_Service} instance. |
|
| 507 | + */ |
|
| 508 | + protected $batch_analysis_service; |
|
| 509 | + |
|
| 510 | + /** |
|
| 511 | + * The {@link Wordlift_Sample_Data_Service} instance. |
|
| 512 | + * |
|
| 513 | + * @since 3.12.0 |
|
| 514 | + * @access protected |
|
| 515 | + * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance. |
|
| 516 | + */ |
|
| 517 | + protected $sample_data_service; |
|
| 518 | + |
|
| 519 | + /** |
|
| 520 | + * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 521 | + * |
|
| 522 | + * @since 3.12.0 |
|
| 523 | + * @access protected |
|
| 524 | + * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 525 | + */ |
|
| 526 | + protected $sample_data_ajax_adapter; |
|
| 527 | + |
|
| 528 | + /** |
|
| 529 | + * The {@link Wordlift_Batch_Analysis_Adapter} instance. |
|
| 530 | + * |
|
| 531 | + * @since 3.14.2 |
|
| 532 | + * @access protected |
|
| 533 | + * @var \Wordlift_Batch_Analysis_Adapter $batch_analysis_adapter The {@link Wordlift_Batch_Analysis_Adapter} instance. |
|
| 534 | + */ |
|
| 535 | + private $batch_analysis_adapter; |
|
| 536 | + |
|
| 537 | + /** |
|
| 538 | + * The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 539 | + * |
|
| 540 | + * @since 3.14.3 |
|
| 541 | + * @access private |
|
| 542 | + * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 543 | + */ |
|
| 544 | + private $relation_rebuild_service; |
|
| 545 | + |
|
| 546 | + /** |
|
| 547 | + * The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 548 | + * |
|
| 549 | + * @since 3.14.3 |
|
| 550 | + * @access private |
|
| 551 | + * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 552 | + */ |
|
| 553 | + private $relation_rebuild_adapter; |
|
| 554 | + |
|
| 555 | + /** |
|
| 556 | + * The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 557 | + * |
|
| 558 | + * @since 3.15.0 |
|
| 559 | + * @access protected |
|
| 560 | + * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 561 | + */ |
|
| 562 | + protected $google_analytics_export_service; |
|
| 563 | + |
|
| 564 | + /** |
|
| 565 | + * {@link Wordlift}'s singleton instance. |
|
| 566 | + * |
|
| 567 | + * @since 3.15.0 |
|
| 568 | + * @access protected |
|
| 569 | + * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance. |
|
| 570 | + */ |
|
| 571 | + protected $entity_type_adapter; |
|
| 572 | + |
|
| 573 | + /** |
|
| 574 | + * The {@link Wordlift_Linked_Data_Service} instance. |
|
| 575 | + * |
|
| 576 | + * @since 3.15.0 |
|
| 577 | + * @access protected |
|
| 578 | + * @var \Wordlift_Linked_Data_Service $linked_data_service The {@link Wordlift_Linked_Data_Service} instance. |
|
| 579 | + */ |
|
| 580 | + protected $linked_data_service; |
|
| 581 | + |
|
| 582 | + /** |
|
| 583 | + * The {@link Wordlift_Storage_Factory} instance. |
|
| 584 | + * |
|
| 585 | + * @since 3.15.0 |
|
| 586 | + * @access protected |
|
| 587 | + * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance. |
|
| 588 | + */ |
|
| 589 | + protected $storage_factory; |
|
| 590 | + |
|
| 591 | + /** |
|
| 592 | + * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 593 | + * |
|
| 594 | + * @since 3.15.0 |
|
| 595 | + * @access protected |
|
| 596 | + * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 597 | + */ |
|
| 598 | + protected $rendition_factory; |
|
| 599 | + |
|
| 600 | + /** |
|
| 601 | + * The {@link Wordlift_Autocomplete_Service} instance. |
|
| 602 | + * |
|
| 603 | + * @since 3.15.0 |
|
| 604 | + * @access private |
|
| 605 | + * @var \Wordlift_Autocomplete_Service $autocomplete_service The {@link Wordlift_Autocomplete_Service} instance. |
|
| 606 | + */ |
|
| 607 | + private $autocomplete_service; |
|
| 608 | + |
|
| 609 | + /** |
|
| 610 | + * The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 611 | + * |
|
| 612 | + * @since 3.15.0 |
|
| 613 | + * @access private |
|
| 614 | + * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 615 | + */ |
|
| 616 | + private $autocomplete_adapter; |
|
| 617 | + |
|
| 618 | + /** |
|
| 619 | + * The {@link Wordlift_Relation_Service} instance. |
|
| 620 | + * |
|
| 621 | + * @since 3.15.0 |
|
| 622 | + * @access private |
|
| 623 | + * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance. |
|
| 624 | + */ |
|
| 625 | + private $relation_service; |
|
| 626 | + |
|
| 627 | + /** |
|
| 628 | + * {@link Wordlift}'s singleton instance. |
|
| 629 | + * |
|
| 630 | + * @since 3.11.2 |
|
| 631 | + * @access private |
|
| 632 | + * @var Wordlift $instance {@link Wordlift}'s singleton instance. |
|
| 633 | + */ |
|
| 634 | + private static $instance; |
|
| 635 | + |
|
| 636 | + /** |
|
| 637 | + * Define the core functionality of the plugin. |
|
| 638 | + * |
|
| 639 | + * Set the plugin name and the plugin version that can be used throughout the plugin. |
|
| 640 | + * Load the dependencies, define the locale, and set the hooks for the admin area and |
|
| 641 | + * the public-facing side of the site. |
|
| 642 | + * |
|
| 643 | + * @since 1.0.0 |
|
| 644 | + */ |
|
| 645 | + public function __construct() { |
|
| 646 | + |
|
| 647 | + $this->plugin_name = 'wordlift'; |
|
| 648 | + $this->version = '3.15.0-dev'; |
|
| 649 | + $this->load_dependencies(); |
|
| 650 | + $this->set_locale(); |
|
| 651 | + $this->define_admin_hooks(); |
|
| 652 | + $this->define_public_hooks(); |
|
| 653 | + |
|
| 654 | + self::$instance = $this; |
|
| 655 | + |
|
| 656 | + } |
|
| 657 | + |
|
| 658 | + /** |
|
| 659 | + * Get the singleton instance. |
|
| 660 | + * |
|
| 661 | + * @since 3.11.2 |
|
| 662 | + * |
|
| 663 | + * @return Wordlift The {@link Wordlift} singleton instance. |
|
| 664 | + */ |
|
| 665 | + public static function get_instance() { |
|
| 666 | + |
|
| 667 | + return self::$instance; |
|
| 668 | + } |
|
| 669 | + |
|
| 670 | + /** |
|
| 671 | + * Load the required dependencies for this plugin. |
|
| 672 | + * |
|
| 673 | + * Include the following files that make up the plugin: |
|
| 674 | + * |
|
| 675 | + * - Wordlift_Loader. Orchestrates the hooks of the plugin. |
|
| 676 | + * - Wordlift_i18n. Defines internationalization functionality. |
|
| 677 | + * - Wordlift_Admin. Defines all hooks for the admin area. |
|
| 678 | + * - Wordlift_Public. Defines all hooks for the public side of the site. |
|
| 679 | + * |
|
| 680 | + * Create an instance of the loader which will be used to register the hooks |
|
| 681 | + * with WordPress. |
|
| 682 | + * |
|
| 683 | + * @since 1.0.0 |
|
| 684 | + * @access private |
|
| 685 | + */ |
|
| 686 | + private function load_dependencies() { |
|
| 687 | + |
|
| 688 | + /** |
|
| 689 | + * The class responsible for orchestrating the actions and filters of the |
|
| 690 | + * core plugin. |
|
| 691 | + */ |
|
| 692 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 693 | + |
|
| 694 | + /** |
|
| 695 | + * The class responsible for defining internationalization functionality |
|
| 696 | + * of the plugin. |
|
| 697 | + */ |
|
| 698 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 699 | + |
|
| 700 | + /** |
|
| 701 | + * WordLift's supported languages. |
|
| 702 | + */ |
|
| 703 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 704 | + |
|
| 705 | + /** |
|
| 706 | + * Provide support functions to sanitize data. |
|
| 707 | + */ |
|
| 708 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 709 | + |
|
| 710 | + /** Services. */ |
|
| 711 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 712 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 713 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 714 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 715 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 716 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 717 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
|
| 718 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 719 | + |
|
| 720 | + /** |
|
| 721 | + * The Query builder. |
|
| 722 | + */ |
|
| 723 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 724 | + |
|
| 725 | + /** |
|
| 726 | + * The Schema service. |
|
| 727 | + */ |
|
| 728 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 729 | + |
|
| 730 | + /** |
|
| 731 | + * The schema:url property service. |
|
| 732 | + */ |
|
| 733 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 734 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 735 | + |
|
| 736 | + /** |
|
| 737 | + * The UI service. |
|
| 738 | + */ |
|
| 739 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 740 | + |
|
| 741 | + /** |
|
| 742 | + * The Thumbnail service. |
|
| 743 | + */ |
|
| 744 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 745 | + |
|
| 746 | + /** |
|
| 747 | + * The Entity Types Taxonomy service. |
|
| 748 | + */ |
|
| 749 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-types-taxonomy-service.php'; |
|
| 750 | + |
|
| 751 | + /** |
|
| 752 | + * The Entity service. |
|
| 753 | + */ |
|
| 754 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 755 | + |
|
| 756 | + // Add the entity rating service. |
|
| 757 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 758 | + |
|
| 759 | + /** |
|
| 760 | + * The User service. |
|
| 761 | + */ |
|
| 762 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 763 | + |
|
| 764 | + /** |
|
| 765 | + * The Timeline service. |
|
| 766 | + */ |
|
| 767 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 768 | + |
|
| 769 | + /** |
|
| 770 | + * The Topic Taxonomy service. |
|
| 771 | + */ |
|
| 772 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 773 | + |
|
| 774 | + /** |
|
| 775 | + * The SPARQL service. |
|
| 776 | + */ |
|
| 777 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 778 | + |
|
| 779 | + /** |
|
| 780 | + * The WordLift import service. |
|
| 781 | + */ |
|
| 782 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 783 | + |
|
| 784 | + /** |
|
| 785 | + * The WordLift URI service. |
|
| 786 | + */ |
|
| 787 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 788 | + |
|
| 789 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-listable.php'; |
|
| 790 | + |
|
| 791 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 792 | + |
|
| 793 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 794 | + |
|
| 795 | + /** |
|
| 796 | + * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
|
| 797 | + */ |
|
| 798 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rebuild-service.php'; |
|
| 799 | + |
|
| 800 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 801 | + |
|
| 802 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 803 | + |
|
| 804 | + /** |
|
| 805 | + * Load the converters. |
|
| 806 | + */ |
|
| 807 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 808 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 809 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 810 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 811 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 812 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 813 | + |
|
| 814 | + /** |
|
| 815 | + * Load the content filter. |
|
| 816 | + */ |
|
| 817 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 818 | + |
|
| 819 | + /* |
|
| 820 | 820 | * Load the excerpt helper. |
| 821 | 821 | */ |
| 822 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 823 | - |
|
| 824 | - /** |
|
| 825 | - * Load the JSON-LD service to publish entities using JSON-LD.s |
|
| 826 | - * |
|
| 827 | - * @since 3.8.0 |
|
| 828 | - */ |
|
| 829 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 830 | - |
|
| 831 | - // The Publisher Service and the AJAX adapter. |
|
| 832 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 833 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 834 | - |
|
| 835 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 836 | - |
|
| 837 | - /** |
|
| 838 | - * Load the WordLift key validation service. |
|
| 839 | - */ |
|
| 840 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 841 | - |
|
| 842 | - // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
|
| 843 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 844 | - |
|
| 845 | - // Load the `Wordlift_Entity_Page_Service` class definition. |
|
| 846 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
| 847 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-analysis-service.php'; |
|
| 848 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-rebuild-service.php'; |
|
| 849 | - |
|
| 850 | - /** Linked Data. */ |
|
| 851 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 852 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 853 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 854 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 855 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 856 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 857 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 858 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 859 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 860 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 861 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 862 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition.php'; |
|
| 863 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 864 | - |
|
| 865 | - /** Services. */ |
|
| 866 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 867 | - |
|
| 868 | - /** Adapters. */ |
|
| 869 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 870 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 871 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 872 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 873 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-analysis-adapter.php'; |
|
| 874 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-rebuild-adapter.php'; |
|
| 875 | - |
|
| 876 | - /** Async Tasks. */ |
|
| 877 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/wp-async-task.php'; |
|
| 878 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 879 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php'; |
|
| 880 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php'; |
|
| 881 | - |
|
| 882 | - /** Async Tasks. */ |
|
| 883 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-service.php'; |
|
| 884 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 885 | - |
|
| 886 | - /** |
|
| 887 | - * The class responsible for defining all actions that occur in the admin area. |
|
| 888 | - */ |
|
| 889 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 890 | - |
|
| 891 | - /** |
|
| 892 | - * The class to customize the entity list admin page. |
|
| 893 | - */ |
|
| 894 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 895 | - |
|
| 896 | - /** |
|
| 897 | - * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
|
| 898 | - */ |
|
| 899 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 900 | - |
|
| 901 | - /** |
|
| 902 | - * The Notice service. |
|
| 903 | - */ |
|
| 904 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 905 | - |
|
| 906 | - /** |
|
| 907 | - * The PrimaShop adapter. |
|
| 908 | - */ |
|
| 909 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 910 | - |
|
| 911 | - /** |
|
| 912 | - * The WordLift Dashboard service. |
|
| 913 | - */ |
|
| 914 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 915 | - |
|
| 916 | - /** |
|
| 917 | - * The admin 'Install wizard' page. |
|
| 918 | - */ |
|
| 919 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 920 | - |
|
| 921 | - /** |
|
| 922 | - * The WordLift entity type list admin page controller. |
|
| 923 | - */ |
|
| 924 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 925 | - |
|
| 926 | - /** |
|
| 927 | - * The WordLift entity type settings admin page controller. |
|
| 928 | - */ |
|
| 929 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 930 | - |
|
| 931 | - /** |
|
| 932 | - * The admin 'Download Your Data' page. |
|
| 933 | - */ |
|
| 934 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 935 | - |
|
| 936 | - /** |
|
| 937 | - * The admin 'WordLift Settings' page. |
|
| 938 | - */ |
|
| 939 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/intf-wordlift-admin-element.php'; |
|
| 940 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-element.php'; |
|
| 941 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-radio-element.php'; |
|
| 942 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-select2-element.php'; |
|
| 943 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-language-select-element.php'; |
|
| 944 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-tabs-element.php'; |
|
| 945 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-author-element.php'; |
|
| 946 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-publisher-element.php'; |
|
| 947 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 948 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 949 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-batch-analysis-page.php'; |
|
| 950 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 951 | - |
|
| 952 | - /** Admin Pages */ |
|
| 953 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 954 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 955 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 956 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 957 | - |
|
| 958 | - /** |
|
| 959 | - * The class responsible for defining all actions that occur in the public-facing |
|
| 960 | - * side of the site. |
|
| 961 | - */ |
|
| 962 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 963 | - |
|
| 964 | - /** |
|
| 965 | - * The shortcode abstract class. |
|
| 966 | - */ |
|
| 967 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 968 | - |
|
| 969 | - /** |
|
| 970 | - * The Timeline shortcode. |
|
| 971 | - */ |
|
| 972 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 973 | - |
|
| 974 | - /** |
|
| 975 | - * The Navigator shortcode. |
|
| 976 | - */ |
|
| 977 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 978 | - |
|
| 979 | - /** |
|
| 980 | - * The chord shortcode. |
|
| 981 | - */ |
|
| 982 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 983 | - |
|
| 984 | - /** |
|
| 985 | - * The geomap shortcode. |
|
| 986 | - */ |
|
| 987 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 988 | - |
|
| 989 | - /** |
|
| 990 | - * The entity cloud shortcode. |
|
| 991 | - */ |
|
| 992 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 993 | - |
|
| 994 | - /** |
|
| 995 | - * The ShareThis service. |
|
| 996 | - */ |
|
| 997 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 998 | - |
|
| 999 | - /** |
|
| 1000 | - * The SEO service. |
|
| 1001 | - */ |
|
| 1002 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 1003 | - |
|
| 1004 | - /** |
|
| 1005 | - * The AMP service. |
|
| 1006 | - */ |
|
| 1007 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1008 | - |
|
| 1009 | - /** Widgets */ |
|
| 1010 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1011 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1012 | - |
|
| 1013 | - $this->loader = new Wordlift_Loader(); |
|
| 1014 | - |
|
| 1015 | - // Instantiate a global logger. |
|
| 1016 | - global $wl_logger; |
|
| 1017 | - $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1018 | - |
|
| 1019 | - /** Services. */ |
|
| 1020 | - // Create the configuration service. |
|
| 1021 | - $this->configuration_service = new Wordlift_Configuration_Service(); |
|
| 1022 | - |
|
| 1023 | - // Create an entity type service instance. It'll be later bound to the init action. |
|
| 1024 | - $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 1025 | - |
|
| 1026 | - // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
|
| 1027 | - $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 1028 | - |
|
| 1029 | - // Create an instance of the UI service. |
|
| 1030 | - $this->ui_service = new Wordlift_UI_Service(); |
|
| 1031 | - |
|
| 1032 | - // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events. |
|
| 1033 | - $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
|
| 1034 | - |
|
| 1035 | - $this->sparql_service = new Wordlift_Sparql_Service(); |
|
| 1036 | - $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 1037 | - $this->notice_service = new Wordlift_Notice_Service(); |
|
| 1038 | - $this->relation_service = new Wordlift_Relation_Service(); |
|
| 1039 | - $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service ); |
|
| 1040 | - $this->user_service = new Wordlift_User_Service(); |
|
| 1041 | - |
|
| 1042 | - // Instantiate the JSON-LD service. |
|
| 1043 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1044 | - |
|
| 1045 | - /** Linked Data. */ |
|
| 1046 | - $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
|
| 1047 | - $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
|
| 1048 | - |
|
| 1049 | - $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
|
| 1050 | - |
|
| 1051 | - // Create a new instance of the Redirect service. |
|
| 1052 | - $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_service ); |
|
| 1053 | - $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 1054 | - $this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service ); |
|
| 1055 | - |
|
| 1056 | - // Create a new instance of the Timeline service and Timeline shortcode. |
|
| 1057 | - $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
|
| 822 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 823 | + |
|
| 824 | + /** |
|
| 825 | + * Load the JSON-LD service to publish entities using JSON-LD.s |
|
| 826 | + * |
|
| 827 | + * @since 3.8.0 |
|
| 828 | + */ |
|
| 829 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 830 | + |
|
| 831 | + // The Publisher Service and the AJAX adapter. |
|
| 832 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 833 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 834 | + |
|
| 835 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 836 | + |
|
| 837 | + /** |
|
| 838 | + * Load the WordLift key validation service. |
|
| 839 | + */ |
|
| 840 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 841 | + |
|
| 842 | + // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
|
| 843 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 844 | + |
|
| 845 | + // Load the `Wordlift_Entity_Page_Service` class definition. |
|
| 846 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
| 847 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-analysis-service.php'; |
|
| 848 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-rebuild-service.php'; |
|
| 849 | + |
|
| 850 | + /** Linked Data. */ |
|
| 851 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 852 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 853 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 854 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 855 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 856 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 857 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 858 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 859 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 860 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 861 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 862 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition.php'; |
|
| 863 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 864 | + |
|
| 865 | + /** Services. */ |
|
| 866 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 867 | + |
|
| 868 | + /** Adapters. */ |
|
| 869 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 870 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 871 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 872 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 873 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-analysis-adapter.php'; |
|
| 874 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-rebuild-adapter.php'; |
|
| 875 | + |
|
| 876 | + /** Async Tasks. */ |
|
| 877 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/wp-async-task.php'; |
|
| 878 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 879 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php'; |
|
| 880 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php'; |
|
| 881 | + |
|
| 882 | + /** Async Tasks. */ |
|
| 883 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-service.php'; |
|
| 884 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 885 | + |
|
| 886 | + /** |
|
| 887 | + * The class responsible for defining all actions that occur in the admin area. |
|
| 888 | + */ |
|
| 889 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 890 | + |
|
| 891 | + /** |
|
| 892 | + * The class to customize the entity list admin page. |
|
| 893 | + */ |
|
| 894 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 895 | + |
|
| 896 | + /** |
|
| 897 | + * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
|
| 898 | + */ |
|
| 899 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 900 | + |
|
| 901 | + /** |
|
| 902 | + * The Notice service. |
|
| 903 | + */ |
|
| 904 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 905 | + |
|
| 906 | + /** |
|
| 907 | + * The PrimaShop adapter. |
|
| 908 | + */ |
|
| 909 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 910 | + |
|
| 911 | + /** |
|
| 912 | + * The WordLift Dashboard service. |
|
| 913 | + */ |
|
| 914 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 915 | + |
|
| 916 | + /** |
|
| 917 | + * The admin 'Install wizard' page. |
|
| 918 | + */ |
|
| 919 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 920 | + |
|
| 921 | + /** |
|
| 922 | + * The WordLift entity type list admin page controller. |
|
| 923 | + */ |
|
| 924 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 925 | + |
|
| 926 | + /** |
|
| 927 | + * The WordLift entity type settings admin page controller. |
|
| 928 | + */ |
|
| 929 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 930 | + |
|
| 931 | + /** |
|
| 932 | + * The admin 'Download Your Data' page. |
|
| 933 | + */ |
|
| 934 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 935 | + |
|
| 936 | + /** |
|
| 937 | + * The admin 'WordLift Settings' page. |
|
| 938 | + */ |
|
| 939 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/intf-wordlift-admin-element.php'; |
|
| 940 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-element.php'; |
|
| 941 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-radio-element.php'; |
|
| 942 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-select2-element.php'; |
|
| 943 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-language-select-element.php'; |
|
| 944 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-tabs-element.php'; |
|
| 945 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-author-element.php'; |
|
| 946 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-publisher-element.php'; |
|
| 947 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 948 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 949 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-batch-analysis-page.php'; |
|
| 950 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 951 | + |
|
| 952 | + /** Admin Pages */ |
|
| 953 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 954 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 955 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 956 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 957 | + |
|
| 958 | + /** |
|
| 959 | + * The class responsible for defining all actions that occur in the public-facing |
|
| 960 | + * side of the site. |
|
| 961 | + */ |
|
| 962 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 963 | + |
|
| 964 | + /** |
|
| 965 | + * The shortcode abstract class. |
|
| 966 | + */ |
|
| 967 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 968 | + |
|
| 969 | + /** |
|
| 970 | + * The Timeline shortcode. |
|
| 971 | + */ |
|
| 972 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 973 | + |
|
| 974 | + /** |
|
| 975 | + * The Navigator shortcode. |
|
| 976 | + */ |
|
| 977 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 978 | + |
|
| 979 | + /** |
|
| 980 | + * The chord shortcode. |
|
| 981 | + */ |
|
| 982 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 983 | + |
|
| 984 | + /** |
|
| 985 | + * The geomap shortcode. |
|
| 986 | + */ |
|
| 987 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 988 | + |
|
| 989 | + /** |
|
| 990 | + * The entity cloud shortcode. |
|
| 991 | + */ |
|
| 992 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 993 | + |
|
| 994 | + /** |
|
| 995 | + * The ShareThis service. |
|
| 996 | + */ |
|
| 997 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 998 | + |
|
| 999 | + /** |
|
| 1000 | + * The SEO service. |
|
| 1001 | + */ |
|
| 1002 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 1003 | + |
|
| 1004 | + /** |
|
| 1005 | + * The AMP service. |
|
| 1006 | + */ |
|
| 1007 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1008 | + |
|
| 1009 | + /** Widgets */ |
|
| 1010 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1011 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1012 | + |
|
| 1013 | + $this->loader = new Wordlift_Loader(); |
|
| 1014 | + |
|
| 1015 | + // Instantiate a global logger. |
|
| 1016 | + global $wl_logger; |
|
| 1017 | + $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1018 | + |
|
| 1019 | + /** Services. */ |
|
| 1020 | + // Create the configuration service. |
|
| 1021 | + $this->configuration_service = new Wordlift_Configuration_Service(); |
|
| 1022 | + |
|
| 1023 | + // Create an entity type service instance. It'll be later bound to the init action. |
|
| 1024 | + $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 1025 | + |
|
| 1026 | + // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
|
| 1027 | + $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 1028 | + |
|
| 1029 | + // Create an instance of the UI service. |
|
| 1030 | + $this->ui_service = new Wordlift_UI_Service(); |
|
| 1031 | + |
|
| 1032 | + // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events. |
|
| 1033 | + $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
|
| 1034 | + |
|
| 1035 | + $this->sparql_service = new Wordlift_Sparql_Service(); |
|
| 1036 | + $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 1037 | + $this->notice_service = new Wordlift_Notice_Service(); |
|
| 1038 | + $this->relation_service = new Wordlift_Relation_Service(); |
|
| 1039 | + $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service ); |
|
| 1040 | + $this->user_service = new Wordlift_User_Service(); |
|
| 1041 | + |
|
| 1042 | + // Instantiate the JSON-LD service. |
|
| 1043 | + $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1044 | + |
|
| 1045 | + /** Linked Data. */ |
|
| 1046 | + $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
|
| 1047 | + $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
|
| 1048 | + |
|
| 1049 | + $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
|
| 1050 | + |
|
| 1051 | + // Create a new instance of the Redirect service. |
|
| 1052 | + $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_service ); |
|
| 1053 | + $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 1054 | + $this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service ); |
|
| 1058 | 1055 | |
| 1059 | - $this->batch_analysis_service = new Wordlift_Batch_Analysis_Service( $this, $this->configuration_service ); |
|
| 1056 | + // Create a new instance of the Timeline service and Timeline shortcode. |
|
| 1057 | + $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
|
| 1058 | + |
|
| 1059 | + $this->batch_analysis_service = new Wordlift_Batch_Analysis_Service( $this, $this->configuration_service ); |
|
| 1060 | 1060 | |
| 1061 | - $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
|
| 1061 | + $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
|
| 1062 | 1062 | |
| 1063 | - $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
|
| 1063 | + $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
|
| 1064 | 1064 | |
| 1065 | - // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
|
| 1066 | - $this->sharethis_service = new Wordlift_ShareThis_Service(); |
|
| 1065 | + // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
|
| 1066 | + $this->sharethis_service = new Wordlift_ShareThis_Service(); |
|
| 1067 | 1067 | |
| 1068 | - // Create an instance of the PrimaShop adapter. |
|
| 1069 | - $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
|
| 1068 | + // Create an instance of the PrimaShop adapter. |
|
| 1069 | + $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
|
| 1070 | 1070 | |
| 1071 | - // Create an import service instance to hook later to WP's import function. |
|
| 1072 | - $this->import_service = new Wordlift_Import_Service( $this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri() ); |
|
| 1071 | + // Create an import service instance to hook later to WP's import function. |
|
| 1072 | + $this->import_service = new Wordlift_Import_Service( $this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri() ); |
|
| 1073 | 1073 | |
| 1074 | - $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1074 | + $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1075 | 1075 | |
| 1076 | - // Create a Rebuild Service instance, which we'll later bound to an ajax call. |
|
| 1077 | - $this->rebuild_service = new Wordlift_Rebuild_Service( $this->sparql_service, $uri_service ); |
|
| 1076 | + // Create a Rebuild Service instance, which we'll later bound to an ajax call. |
|
| 1077 | + $this->rebuild_service = new Wordlift_Rebuild_Service( $this->sparql_service, $uri_service ); |
|
| 1078 | 1078 | |
| 1079 | - // Create the entity rating service. |
|
| 1080 | - $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 1079 | + // Create the entity rating service. |
|
| 1080 | + $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 1081 | 1081 | |
| 1082 | - // Create entity list customization (wp-admin/edit.php) |
|
| 1083 | - $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 1082 | + // Create entity list customization (wp-admin/edit.php) |
|
| 1083 | + $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 1084 | 1084 | |
| 1085 | - // Create a new instance of the Redirect service. |
|
| 1086 | - $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
|
| 1085 | + // Create a new instance of the Redirect service. |
|
| 1086 | + $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
|
| 1087 | 1087 | |
| 1088 | - // Create an instance of the Publisher Service and the AJAX Adapter. |
|
| 1089 | - $publisher_service = new Wordlift_Publisher_Service(); |
|
| 1090 | - $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1091 | - $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1088 | + // Create an instance of the Publisher Service and the AJAX Adapter. |
|
| 1089 | + $publisher_service = new Wordlift_Publisher_Service(); |
|
| 1090 | + $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1091 | + $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1092 | 1092 | |
| 1093 | - $attachment_service = new Wordlift_Attachment_Service(); |
|
| 1093 | + $attachment_service = new Wordlift_Attachment_Service(); |
|
| 1094 | 1094 | |
| 1095 | - // Instantiate the JSON-LD service. |
|
| 1096 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1097 | - $this->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter ); |
|
| 1098 | - $this->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service, $this->entity_post_to_jsonld_converter ); |
|
| 1099 | - $this->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter( $this->entity_service, $this->entity_post_to_jsonld_converter, $this->post_to_jsonld_converter ); |
|
| 1100 | - $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service, $this->entity_post_to_jsonld_converter ); |
|
| 1101 | - $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->postid_to_jsonld_converter, $this->jsonld_website_converter ); |
|
| 1095 | + // Instantiate the JSON-LD service. |
|
| 1096 | + $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1097 | + $this->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter ); |
|
| 1098 | + $this->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service, $this->entity_post_to_jsonld_converter ); |
|
| 1099 | + $this->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter( $this->entity_service, $this->entity_post_to_jsonld_converter, $this->post_to_jsonld_converter ); |
|
| 1100 | + $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service, $this->entity_post_to_jsonld_converter ); |
|
| 1101 | + $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->postid_to_jsonld_converter, $this->jsonld_website_converter ); |
|
| 1102 | 1102 | |
| 1103 | - $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
|
| 1104 | - $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service ); |
|
| 1105 | - $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
|
| 1106 | - $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service ); |
|
| 1107 | - $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
|
| 1103 | + $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
|
| 1104 | + $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service ); |
|
| 1105 | + $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
|
| 1106 | + $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service ); |
|
| 1107 | + $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
|
| 1108 | 1108 | |
| 1109 | - // Initialize the shortcodes. |
|
| 1110 | - new Wordlift_Navigator_Shortcode(); |
|
| 1111 | - new Wordlift_Chord_Shortcode(); |
|
| 1112 | - new Wordlift_Geomap_Shortcode(); |
|
| 1113 | - new Wordlift_Timeline_Shortcode(); |
|
| 1114 | - new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
|
| 1109 | + // Initialize the shortcodes. |
|
| 1110 | + new Wordlift_Navigator_Shortcode(); |
|
| 1111 | + new Wordlift_Chord_Shortcode(); |
|
| 1112 | + new Wordlift_Geomap_Shortcode(); |
|
| 1113 | + new Wordlift_Timeline_Shortcode(); |
|
| 1114 | + new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
|
| 1115 | 1115 | |
| 1116 | - // Initialize the SEO service. |
|
| 1117 | - new Wordlift_Seo_Service(); |
|
| 1116 | + // Initialize the SEO service. |
|
| 1117 | + new Wordlift_Seo_Service(); |
|
| 1118 | 1118 | |
| 1119 | - // Initialize the AMP service. |
|
| 1120 | - new Wordlift_AMP_Service(); |
|
| 1119 | + // Initialize the AMP service. |
|
| 1120 | + new Wordlift_AMP_Service(); |
|
| 1121 | 1121 | |
| 1122 | - /** Services. */ |
|
| 1123 | - $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
|
| 1122 | + /** Services. */ |
|
| 1123 | + $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
|
| 1124 | 1124 | |
| 1125 | - /** Adapters. */ |
|
| 1126 | - $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
|
| 1127 | - $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $publisher_service ); |
|
| 1128 | - $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 1129 | - $this->batch_analysis_adapter = new Wordlift_Batch_Analysis_Adapter( $this->batch_analysis_service ); |
|
| 1130 | - $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
|
| 1125 | + /** Adapters. */ |
|
| 1126 | + $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
|
| 1127 | + $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $publisher_service ); |
|
| 1128 | + $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 1129 | + $this->batch_analysis_adapter = new Wordlift_Batch_Analysis_Adapter( $this->batch_analysis_service ); |
|
| 1130 | + $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
|
| 1131 | 1131 | |
| 1132 | - /** Async Tasks. */ |
|
| 1133 | - new Wordlift_Sparql_Query_Async_Task(); |
|
| 1134 | - new Wordlift_Batch_Analysis_Request_Async_Task(); |
|
| 1135 | - new Wordlift_Batch_Analysis_Complete_Async_Task(); |
|
| 1132 | + /** Async Tasks. */ |
|
| 1133 | + new Wordlift_Sparql_Query_Async_Task(); |
|
| 1134 | + new Wordlift_Batch_Analysis_Request_Async_Task(); |
|
| 1135 | + new Wordlift_Batch_Analysis_Complete_Async_Task(); |
|
| 1136 | 1136 | |
| 1137 | - /** WL Autocomplete. */ |
|
| 1138 | - $this->autocomplete_service = new Wordlift_Autocomplete_Service( $this->configuration_service ); |
|
| 1139 | - $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $this->autocomplete_service ); |
|
| 1137 | + /** WL Autocomplete. */ |
|
| 1138 | + $this->autocomplete_service = new Wordlift_Autocomplete_Service( $this->configuration_service ); |
|
| 1139 | + $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $this->autocomplete_service ); |
|
| 1140 | 1140 | |
| 1141 | - /** WordPress Admin UI. */ |
|
| 1141 | + /** WordPress Admin UI. */ |
|
| 1142 | 1142 | |
| 1143 | - // UI elements. |
|
| 1144 | - $this->input_element = new Wordlift_Admin_Input_Element(); |
|
| 1145 | - $this->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
|
| 1146 | - $this->select2_element = new Wordlift_Admin_Select2_Element(); |
|
| 1147 | - $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
|
| 1148 | - $tabs_element = new Wordlift_Admin_Tabs_Element(); |
|
| 1149 | - $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $publisher_service, $tabs_element, $this->select2_element ); |
|
| 1150 | - $this->author_element = new Wordlift_Admin_Author_Element( $publisher_service, $this->select2_element ); |
|
| 1143 | + // UI elements. |
|
| 1144 | + $this->input_element = new Wordlift_Admin_Input_Element(); |
|
| 1145 | + $this->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
|
| 1146 | + $this->select2_element = new Wordlift_Admin_Select2_Element(); |
|
| 1147 | + $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
|
| 1148 | + $tabs_element = new Wordlift_Admin_Tabs_Element(); |
|
| 1149 | + $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $publisher_service, $tabs_element, $this->select2_element ); |
|
| 1150 | + $this->author_element = new Wordlift_Admin_Author_Element( $publisher_service, $this->select2_element ); |
|
| 1151 | 1151 | |
| 1152 | - $this->settings_page = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->publisher_element, $this->radio_input_element ); |
|
| 1153 | - $this->batch_analysis_page = new Wordlift_Batch_Analysis_Page( $this->batch_analysis_service ); |
|
| 1154 | - $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 1152 | + $this->settings_page = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->publisher_element, $this->radio_input_element ); |
|
| 1153 | + $this->batch_analysis_page = new Wordlift_Batch_Analysis_Page( $this->batch_analysis_service ); |
|
| 1154 | + $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 1155 | 1155 | |
| 1156 | - // Pages. |
|
| 1157 | - new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 1158 | - new Wordlift_Entity_Type_Admin_Service(); |
|
| 1156 | + // Pages. |
|
| 1157 | + new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 1158 | + new Wordlift_Entity_Type_Admin_Service(); |
|
| 1159 | 1159 | |
| 1160 | - // create an instance of the entity type list admin page controller. |
|
| 1161 | - $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
|
| 1160 | + // create an instance of the entity type list admin page controller. |
|
| 1161 | + $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
|
| 1162 | 1162 | |
| 1163 | - // create an instance of the entity type etting admin page controller. |
|
| 1164 | - $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
|
| 1165 | - |
|
| 1166 | - /** Widgets */ |
|
| 1167 | - $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
|
| 1168 | - |
|
| 1169 | - //** WordPress Admin */ |
|
| 1170 | - $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 1171 | - $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 1172 | - |
|
| 1173 | - // Create an instance of the install wizard. |
|
| 1174 | - $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service ); |
|
| 1175 | - |
|
| 1176 | - $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1177 | - |
|
| 1178 | - // User Profile. |
|
| 1179 | - new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1180 | - |
|
| 1181 | - $this->entity_page_service = new Wordlift_Entity_Page_Service(); |
|
| 1182 | - |
|
| 1183 | - // Load the debug service if WP is in debug mode. |
|
| 1184 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1185 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1186 | - new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1187 | - } |
|
| 1188 | - |
|
| 1189 | - } |
|
| 1190 | - |
|
| 1191 | - /** |
|
| 1192 | - * Define the locale for this plugin for internationalization. |
|
| 1193 | - * |
|
| 1194 | - * Uses the Wordlift_i18n class in order to set the domain and to register the hook |
|
| 1195 | - * with WordPress. |
|
| 1196 | - * |
|
| 1197 | - * @since 1.0.0 |
|
| 1198 | - * @access private |
|
| 1199 | - */ |
|
| 1200 | - private function set_locale() { |
|
| 1201 | - |
|
| 1202 | - $plugin_i18n = new Wordlift_i18n(); |
|
| 1203 | - $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1204 | - |
|
| 1205 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1206 | - |
|
| 1207 | - } |
|
| 1208 | - |
|
| 1209 | - /** |
|
| 1210 | - * Register all of the hooks related to the admin area functionality |
|
| 1211 | - * of the plugin. |
|
| 1212 | - * |
|
| 1213 | - * @since 1.0.0 |
|
| 1214 | - * @access private |
|
| 1215 | - */ |
|
| 1216 | - private function define_admin_hooks() { |
|
| 1217 | - |
|
| 1218 | - $plugin_admin = new Wordlift_Admin( |
|
| 1219 | - $this->get_plugin_name(), |
|
| 1220 | - $this->get_version(), |
|
| 1221 | - $this->configuration_service, |
|
| 1222 | - $this->notice_service, |
|
| 1223 | - $this->user_service |
|
| 1224 | - ); |
|
| 1225 | - |
|
| 1226 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1227 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); |
|
| 1228 | - |
|
| 1229 | - // Hook the init action to the Topic Taxonomy service. |
|
| 1230 | - $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1231 | - |
|
| 1232 | - // Hook the deleted_post_meta action to the Thumbnail service. |
|
| 1233 | - $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1234 | - |
|
| 1235 | - // Hook the added_post_meta action to the Thumbnail service. |
|
| 1236 | - $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1237 | - |
|
| 1238 | - // Hook the updated_post_meta action to the Thumbnail service. |
|
| 1239 | - $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1240 | - |
|
| 1241 | - // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1242 | - $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1243 | - |
|
| 1244 | - // Register custom allowed redirect hosts. |
|
| 1245 | - $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1246 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1247 | - $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1248 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1249 | - $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' ); |
|
| 1250 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1251 | - $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' ); |
|
| 1252 | - |
|
| 1253 | - // Hook save_post to the entity service to update custom fields (such as alternate labels). |
|
| 1254 | - // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
|
| 1255 | - $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1256 | - $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1257 | - |
|
| 1258 | - $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1259 | - $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1260 | - |
|
| 1261 | - // Entity listing customization (wp-admin/edit.php) |
|
| 1262 | - // Add custom columns |
|
| 1263 | - $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1264 | - // no explicit entity as it prevents handling of other post types. |
|
| 1265 | - $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1266 | - // Add 4W selection |
|
| 1267 | - $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1268 | - $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1269 | - $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' ); |
|
| 1270 | - $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' ); |
|
| 1271 | - $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1272 | - |
|
| 1273 | - // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
|
| 1274 | - // entities. |
|
| 1275 | - $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1276 | - |
|
| 1277 | - // Filter imported post meta. |
|
| 1278 | - $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1279 | - |
|
| 1280 | - // Notify the import service when an import starts and ends. |
|
| 1281 | - $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1282 | - $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1283 | - |
|
| 1284 | - // Hook the AJAX wl_rebuild action to the Rebuild Service. |
|
| 1285 | - $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1286 | - |
|
| 1287 | - // Hook the menu to the Download Your Data page. |
|
| 1288 | - $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 ); |
|
| 1289 | - $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 ); |
|
| 1290 | - $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 ); |
|
| 1291 | - |
|
| 1292 | - // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
|
| 1293 | - $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1294 | - |
|
| 1295 | - // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1296 | - $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1297 | - |
|
| 1298 | - // Hook the AJAX wl_validate_key action to the Key Validation service. |
|
| 1299 | - $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1300 | - |
|
| 1301 | - // Hook the `admin_init` function to the Admin Setup. |
|
| 1302 | - $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1303 | - |
|
| 1304 | - // Hook the admin_init to the settings page. |
|
| 1305 | - $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1306 | - |
|
| 1307 | - // Hook the menu creation on the general wordlift menu creation |
|
| 1308 | - $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 ); |
|
| 1309 | - if ( defined( 'WORDLIFT_BATCH' ) && WORDLIFT_BATCH ) { |
|
| 1310 | - // Add the functionality only if a flag is set in wp-config.php . |
|
| 1311 | - $this->loader->add_action( 'wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2 ); |
|
| 1312 | - } |
|
| 1313 | - |
|
| 1314 | - // Hook key update. |
|
| 1315 | - $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1316 | - $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1317 | - |
|
| 1318 | - // Add additional action links to the WordLift plugin in the plugins page. |
|
| 1319 | - $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1320 | - |
|
| 1321 | - // Hook the AJAX `wl_publisher` action name. |
|
| 1322 | - $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1323 | - |
|
| 1324 | - // Hook row actions for the entity type list admin. |
|
| 1325 | - $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1326 | - |
|
| 1327 | - /** Ajax actions. */ |
|
| 1328 | - $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' ); |
|
| 1329 | - |
|
| 1330 | - // Hook capabilities manipulation to allow access to entity type admin |
|
| 1331 | - // page on wordpress versions before 4.7. |
|
| 1332 | - global $wp_version; |
|
| 1333 | - if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1334 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1335 | - } |
|
| 1336 | - |
|
| 1337 | - $this->loader->add_action( 'wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1338 | - |
|
| 1339 | - /** Adapters. */ |
|
| 1340 | - $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1341 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_auto_selected_posts', $this->batch_analysis_adapter, 'submit_auto_selected_posts', 10 ); |
|
| 1342 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_all_posts', $this->batch_analysis_adapter, 'submit_all_posts', 10 ); |
|
| 1343 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit', 10 ); |
|
| 1344 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel', 10 ); |
|
| 1345 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning', 10 ); |
|
| 1346 | - $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all', 10 ); |
|
| 1347 | - |
|
| 1348 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' ); |
|
| 1349 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' ); |
|
| 1350 | - |
|
| 1351 | - // Handle the autocomplete request. |
|
| 1352 | - add_action( 'wp_ajax_wl_autocomplete', array( $this->autocomplete_adapter, 'wl_autocomplete' ) ); |
|
| 1353 | - add_action( 'wp_ajax_nopriv_wl_autocomplete', array( $this->autocomplete_adapter, 'wl_autocomplete' ) ); |
|
| 1354 | - |
|
| 1355 | - // Hooks to restrict multisite super admin from manipulating entity types. |
|
| 1356 | - if ( is_multisite() ) { |
|
| 1357 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1358 | - } |
|
| 1359 | - |
|
| 1360 | - } |
|
| 1361 | - |
|
| 1362 | - /** |
|
| 1363 | - * Register all of the hooks related to the public-facing functionality |
|
| 1364 | - * of the plugin. |
|
| 1365 | - * |
|
| 1366 | - * @since 1.0.0 |
|
| 1367 | - * @access private |
|
| 1368 | - */ |
|
| 1369 | - private function define_public_hooks() { |
|
| 1163 | + // create an instance of the entity type etting admin page controller. |
|
| 1164 | + $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
|
| 1165 | + |
|
| 1166 | + /** Widgets */ |
|
| 1167 | + $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
|
| 1168 | + |
|
| 1169 | + //** WordPress Admin */ |
|
| 1170 | + $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 1171 | + $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 1172 | + |
|
| 1173 | + // Create an instance of the install wizard. |
|
| 1174 | + $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service ); |
|
| 1175 | + |
|
| 1176 | + $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1177 | + |
|
| 1178 | + // User Profile. |
|
| 1179 | + new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1180 | + |
|
| 1181 | + $this->entity_page_service = new Wordlift_Entity_Page_Service(); |
|
| 1182 | + |
|
| 1183 | + // Load the debug service if WP is in debug mode. |
|
| 1184 | + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1185 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1186 | + new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1187 | + } |
|
| 1188 | + |
|
| 1189 | + } |
|
| 1190 | + |
|
| 1191 | + /** |
|
| 1192 | + * Define the locale for this plugin for internationalization. |
|
| 1193 | + * |
|
| 1194 | + * Uses the Wordlift_i18n class in order to set the domain and to register the hook |
|
| 1195 | + * with WordPress. |
|
| 1196 | + * |
|
| 1197 | + * @since 1.0.0 |
|
| 1198 | + * @access private |
|
| 1199 | + */ |
|
| 1200 | + private function set_locale() { |
|
| 1201 | + |
|
| 1202 | + $plugin_i18n = new Wordlift_i18n(); |
|
| 1203 | + $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1204 | + |
|
| 1205 | + $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1206 | + |
|
| 1207 | + } |
|
| 1208 | + |
|
| 1209 | + /** |
|
| 1210 | + * Register all of the hooks related to the admin area functionality |
|
| 1211 | + * of the plugin. |
|
| 1212 | + * |
|
| 1213 | + * @since 1.0.0 |
|
| 1214 | + * @access private |
|
| 1215 | + */ |
|
| 1216 | + private function define_admin_hooks() { |
|
| 1217 | + |
|
| 1218 | + $plugin_admin = new Wordlift_Admin( |
|
| 1219 | + $this->get_plugin_name(), |
|
| 1220 | + $this->get_version(), |
|
| 1221 | + $this->configuration_service, |
|
| 1222 | + $this->notice_service, |
|
| 1223 | + $this->user_service |
|
| 1224 | + ); |
|
| 1225 | + |
|
| 1226 | + $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1227 | + $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); |
|
| 1228 | + |
|
| 1229 | + // Hook the init action to the Topic Taxonomy service. |
|
| 1230 | + $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1231 | + |
|
| 1232 | + // Hook the deleted_post_meta action to the Thumbnail service. |
|
| 1233 | + $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1234 | + |
|
| 1235 | + // Hook the added_post_meta action to the Thumbnail service. |
|
| 1236 | + $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1237 | + |
|
| 1238 | + // Hook the updated_post_meta action to the Thumbnail service. |
|
| 1239 | + $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1240 | + |
|
| 1241 | + // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1242 | + $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1243 | + |
|
| 1244 | + // Register custom allowed redirect hosts. |
|
| 1245 | + $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1246 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1247 | + $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1248 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1249 | + $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' ); |
|
| 1250 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1251 | + $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' ); |
|
| 1252 | + |
|
| 1253 | + // Hook save_post to the entity service to update custom fields (such as alternate labels). |
|
| 1254 | + // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
|
| 1255 | + $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1256 | + $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1257 | + |
|
| 1258 | + $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1259 | + $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1260 | + |
|
| 1261 | + // Entity listing customization (wp-admin/edit.php) |
|
| 1262 | + // Add custom columns |
|
| 1263 | + $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1264 | + // no explicit entity as it prevents handling of other post types. |
|
| 1265 | + $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1266 | + // Add 4W selection |
|
| 1267 | + $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1268 | + $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1269 | + $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' ); |
|
| 1270 | + $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' ); |
|
| 1271 | + $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1272 | + |
|
| 1273 | + // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
|
| 1274 | + // entities. |
|
| 1275 | + $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1276 | + |
|
| 1277 | + // Filter imported post meta. |
|
| 1278 | + $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1279 | + |
|
| 1280 | + // Notify the import service when an import starts and ends. |
|
| 1281 | + $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1282 | + $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1283 | + |
|
| 1284 | + // Hook the AJAX wl_rebuild action to the Rebuild Service. |
|
| 1285 | + $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1286 | + |
|
| 1287 | + // Hook the menu to the Download Your Data page. |
|
| 1288 | + $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 ); |
|
| 1289 | + $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 ); |
|
| 1290 | + $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 ); |
|
| 1291 | + |
|
| 1292 | + // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
|
| 1293 | + $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1294 | + |
|
| 1295 | + // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1296 | + $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1297 | + |
|
| 1298 | + // Hook the AJAX wl_validate_key action to the Key Validation service. |
|
| 1299 | + $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1300 | + |
|
| 1301 | + // Hook the `admin_init` function to the Admin Setup. |
|
| 1302 | + $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1303 | + |
|
| 1304 | + // Hook the admin_init to the settings page. |
|
| 1305 | + $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1306 | + |
|
| 1307 | + // Hook the menu creation on the general wordlift menu creation |
|
| 1308 | + $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 ); |
|
| 1309 | + if ( defined( 'WORDLIFT_BATCH' ) && WORDLIFT_BATCH ) { |
|
| 1310 | + // Add the functionality only if a flag is set in wp-config.php . |
|
| 1311 | + $this->loader->add_action( 'wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2 ); |
|
| 1312 | + } |
|
| 1313 | + |
|
| 1314 | + // Hook key update. |
|
| 1315 | + $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1316 | + $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1317 | + |
|
| 1318 | + // Add additional action links to the WordLift plugin in the plugins page. |
|
| 1319 | + $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1320 | + |
|
| 1321 | + // Hook the AJAX `wl_publisher` action name. |
|
| 1322 | + $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1323 | + |
|
| 1324 | + // Hook row actions for the entity type list admin. |
|
| 1325 | + $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1326 | + |
|
| 1327 | + /** Ajax actions. */ |
|
| 1328 | + $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' ); |
|
| 1329 | + |
|
| 1330 | + // Hook capabilities manipulation to allow access to entity type admin |
|
| 1331 | + // page on wordpress versions before 4.7. |
|
| 1332 | + global $wp_version; |
|
| 1333 | + if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1334 | + $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1335 | + } |
|
| 1336 | + |
|
| 1337 | + $this->loader->add_action( 'wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1338 | + |
|
| 1339 | + /** Adapters. */ |
|
| 1340 | + $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1341 | + $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_auto_selected_posts', $this->batch_analysis_adapter, 'submit_auto_selected_posts', 10 ); |
|
| 1342 | + $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_all_posts', $this->batch_analysis_adapter, 'submit_all_posts', 10 ); |
|
| 1343 | + $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit', 10 ); |
|
| 1344 | + $this->loader->add_action( 'wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel', 10 ); |
|
| 1345 | + $this->loader->add_action( 'wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning', 10 ); |
|
| 1346 | + $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all', 10 ); |
|
| 1347 | + |
|
| 1348 | + $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' ); |
|
| 1349 | + $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' ); |
|
| 1350 | + |
|
| 1351 | + // Handle the autocomplete request. |
|
| 1352 | + add_action( 'wp_ajax_wl_autocomplete', array( $this->autocomplete_adapter, 'wl_autocomplete' ) ); |
|
| 1353 | + add_action( 'wp_ajax_nopriv_wl_autocomplete', array( $this->autocomplete_adapter, 'wl_autocomplete' ) ); |
|
| 1354 | + |
|
| 1355 | + // Hooks to restrict multisite super admin from manipulating entity types. |
|
| 1356 | + if ( is_multisite() ) { |
|
| 1357 | + $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1358 | + } |
|
| 1359 | + |
|
| 1360 | + } |
|
| 1361 | + |
|
| 1362 | + /** |
|
| 1363 | + * Register all of the hooks related to the public-facing functionality |
|
| 1364 | + * of the plugin. |
|
| 1365 | + * |
|
| 1366 | + * @since 1.0.0 |
|
| 1367 | + * @access private |
|
| 1368 | + */ |
|
| 1369 | + private function define_public_hooks() { |
|
| 1370 | 1370 | |
| 1371 | - $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1371 | + $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1372 | 1372 | |
| 1373 | - // Register the entity post type. |
|
| 1374 | - $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1373 | + // Register the entity post type. |
|
| 1374 | + $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1375 | 1375 | |
| 1376 | - // Bind the link generation and handling hooks to the entity link service. |
|
| 1377 | - $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1378 | - $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1379 | - $this->loader->add_filter( 'wp_unique_post_slug_is_bad_flat_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3 ); |
|
| 1380 | - $this->loader->add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4 ); |
|
| 1376 | + // Bind the link generation and handling hooks to the entity link service. |
|
| 1377 | + $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1378 | + $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1379 | + $this->loader->add_filter( 'wp_unique_post_slug_is_bad_flat_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3 ); |
|
| 1380 | + $this->loader->add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4 ); |
|
| 1381 | 1381 | |
| 1382 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1383 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1382 | + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1383 | + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1384 | 1384 | |
| 1385 | - // Hook the content filter service to add entity links. |
|
| 1386 | - $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1385 | + // Hook the content filter service to add entity links. |
|
| 1386 | + $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1387 | 1387 | |
| 1388 | - // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1389 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1388 | + // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1389 | + $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1390 | 1390 | |
| 1391 | - // Hook the ShareThis service. |
|
| 1392 | - $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1393 | - $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1391 | + // Hook the ShareThis service. |
|
| 1392 | + $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1393 | + $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1394 | 1394 | |
| 1395 | - // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1396 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1395 | + // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1396 | + $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1397 | 1397 | |
| 1398 | - // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
|
| 1399 | - // in order to tweak WP's `WP_Query` to include entities in queries related |
|
| 1400 | - // to categories. |
|
| 1401 | - $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1398 | + // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
|
| 1399 | + // in order to tweak WP's `WP_Query` to include entities in queries related |
|
| 1400 | + // to categories. |
|
| 1401 | + $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1402 | 1402 | |
| 1403 | - /* |
|
| 1403 | + /* |
|
| 1404 | 1404 | * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service` |
| 1405 | 1405 | * in order to tweak WP's `WP_Query` to show event related entities in reverse |
| 1406 | 1406 | * order of start time. |
| 1407 | 1407 | */ |
| 1408 | - $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1409 | - |
|
| 1410 | - $this->loader->add_action( 'wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1411 | - |
|
| 1412 | - // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
|
| 1413 | - $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1414 | - |
|
| 1415 | - } |
|
| 1416 | - |
|
| 1417 | - /** |
|
| 1418 | - * Run the loader to execute all of the hooks with WordPress. |
|
| 1419 | - * |
|
| 1420 | - * @since 1.0.0 |
|
| 1421 | - */ |
|
| 1422 | - public function run() { |
|
| 1423 | - $this->loader->run(); |
|
| 1424 | - } |
|
| 1425 | - |
|
| 1426 | - /** |
|
| 1427 | - * The name of the plugin used to uniquely identify it within the context of |
|
| 1428 | - * WordPress and to define internationalization functionality. |
|
| 1429 | - * |
|
| 1430 | - * @since 1.0.0 |
|
| 1431 | - * @return string The name of the plugin. |
|
| 1432 | - */ |
|
| 1433 | - public function get_plugin_name() { |
|
| 1434 | - return $this->plugin_name; |
|
| 1435 | - } |
|
| 1436 | - |
|
| 1437 | - /** |
|
| 1438 | - * The reference to the class that orchestrates the hooks with the plugin. |
|
| 1439 | - * |
|
| 1440 | - * @since 1.0.0 |
|
| 1441 | - * @return Wordlift_Loader Orchestrates the hooks of the plugin. |
|
| 1442 | - */ |
|
| 1443 | - public function get_loader() { |
|
| 1444 | - return $this->loader; |
|
| 1445 | - } |
|
| 1446 | - |
|
| 1447 | - /** |
|
| 1448 | - * Retrieve the version number of the plugin. |
|
| 1449 | - * |
|
| 1450 | - * @since 1.0.0 |
|
| 1451 | - * @return string The version number of the plugin. |
|
| 1452 | - */ |
|
| 1453 | - public function get_version() { |
|
| 1454 | - return $this->version; |
|
| 1455 | - } |
|
| 1408 | + $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1409 | + |
|
| 1410 | + $this->loader->add_action( 'wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1411 | + |
|
| 1412 | + // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
|
| 1413 | + $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1414 | + |
|
| 1415 | + } |
|
| 1416 | + |
|
| 1417 | + /** |
|
| 1418 | + * Run the loader to execute all of the hooks with WordPress. |
|
| 1419 | + * |
|
| 1420 | + * @since 1.0.0 |
|
| 1421 | + */ |
|
| 1422 | + public function run() { |
|
| 1423 | + $this->loader->run(); |
|
| 1424 | + } |
|
| 1425 | + |
|
| 1426 | + /** |
|
| 1427 | + * The name of the plugin used to uniquely identify it within the context of |
|
| 1428 | + * WordPress and to define internationalization functionality. |
|
| 1429 | + * |
|
| 1430 | + * @since 1.0.0 |
|
| 1431 | + * @return string The name of the plugin. |
|
| 1432 | + */ |
|
| 1433 | + public function get_plugin_name() { |
|
| 1434 | + return $this->plugin_name; |
|
| 1435 | + } |
|
| 1436 | + |
|
| 1437 | + /** |
|
| 1438 | + * The reference to the class that orchestrates the hooks with the plugin. |
|
| 1439 | + * |
|
| 1440 | + * @since 1.0.0 |
|
| 1441 | + * @return Wordlift_Loader Orchestrates the hooks of the plugin. |
|
| 1442 | + */ |
|
| 1443 | + public function get_loader() { |
|
| 1444 | + return $this->loader; |
|
| 1445 | + } |
|
| 1446 | + |
|
| 1447 | + /** |
|
| 1448 | + * Retrieve the version number of the plugin. |
|
| 1449 | + * |
|
| 1450 | + * @since 1.0.0 |
|
| 1451 | + * @return string The version number of the plugin. |
|
| 1452 | + */ |
|
| 1453 | + public function get_version() { |
|
| 1454 | + return $this->version; |
|
| 1455 | + } |
|
| 1456 | 1456 | |
| 1457 | 1457 | } |
@@ -689,342 +689,342 @@ discard block |
||
| 689 | 689 | * The class responsible for orchestrating the actions and filters of the |
| 690 | 690 | * core plugin. |
| 691 | 691 | */ |
| 692 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 692 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-loader.php'; |
|
| 693 | 693 | |
| 694 | 694 | /** |
| 695 | 695 | * The class responsible for defining internationalization functionality |
| 696 | 696 | * of the plugin. |
| 697 | 697 | */ |
| 698 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 698 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-i18n.php'; |
|
| 699 | 699 | |
| 700 | 700 | /** |
| 701 | 701 | * WordLift's supported languages. |
| 702 | 702 | */ |
| 703 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 703 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-languages.php'; |
|
| 704 | 704 | |
| 705 | 705 | /** |
| 706 | 706 | * Provide support functions to sanitize data. |
| 707 | 707 | */ |
| 708 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 708 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sanitizer.php'; |
|
| 709 | 709 | |
| 710 | 710 | /** Services. */ |
| 711 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 712 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 713 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 714 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 715 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 716 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 717 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
|
| 718 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 711 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-log-service.php'; |
|
| 712 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-redirect-service.php'; |
|
| 713 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-configuration-service.php'; |
|
| 714 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-type-service.php'; |
|
| 715 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-service.php'; |
|
| 716 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-link-service.php'; |
|
| 717 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-linked-data-service.php'; |
|
| 718 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-relation-service.php'; |
|
| 719 | 719 | |
| 720 | 720 | /** |
| 721 | 721 | * The Query builder. |
| 722 | 722 | */ |
| 723 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 723 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-query-builder.php'; |
|
| 724 | 724 | |
| 725 | 725 | /** |
| 726 | 726 | * The Schema service. |
| 727 | 727 | */ |
| 728 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 728 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-service.php'; |
|
| 729 | 729 | |
| 730 | 730 | /** |
| 731 | 731 | * The schema:url property service. |
| 732 | 732 | */ |
| 733 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 734 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 733 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-service.php'; |
|
| 734 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-url-property-service.php'; |
|
| 735 | 735 | |
| 736 | 736 | /** |
| 737 | 737 | * The UI service. |
| 738 | 738 | */ |
| 739 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 739 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-ui-service.php'; |
|
| 740 | 740 | |
| 741 | 741 | /** |
| 742 | 742 | * The Thumbnail service. |
| 743 | 743 | */ |
| 744 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 744 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-thumbnail-service.php'; |
|
| 745 | 745 | |
| 746 | 746 | /** |
| 747 | 747 | * The Entity Types Taxonomy service. |
| 748 | 748 | */ |
| 749 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-types-taxonomy-service.php'; |
|
| 749 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-types-taxonomy-service.php'; |
|
| 750 | 750 | |
| 751 | 751 | /** |
| 752 | 752 | * The Entity service. |
| 753 | 753 | */ |
| 754 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 754 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-service.php'; |
|
| 755 | 755 | |
| 756 | 756 | // Add the entity rating service. |
| 757 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 757 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rating-service.php'; |
|
| 758 | 758 | |
| 759 | 759 | /** |
| 760 | 760 | * The User service. |
| 761 | 761 | */ |
| 762 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 762 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-user-service.php'; |
|
| 763 | 763 | |
| 764 | 764 | /** |
| 765 | 765 | * The Timeline service. |
| 766 | 766 | */ |
| 767 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 767 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-timeline-service.php'; |
|
| 768 | 768 | |
| 769 | 769 | /** |
| 770 | 770 | * The Topic Taxonomy service. |
| 771 | 771 | */ |
| 772 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 772 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 773 | 773 | |
| 774 | 774 | /** |
| 775 | 775 | * The SPARQL service. |
| 776 | 776 | */ |
| 777 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 777 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sparql-service.php'; |
|
| 778 | 778 | |
| 779 | 779 | /** |
| 780 | 780 | * The WordLift import service. |
| 781 | 781 | */ |
| 782 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 782 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-import-service.php'; |
|
| 783 | 783 | |
| 784 | 784 | /** |
| 785 | 785 | * The WordLift URI service. |
| 786 | 786 | */ |
| 787 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 787 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-uri-service.php'; |
|
| 788 | 788 | |
| 789 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-listable.php'; |
|
| 789 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-listable.php'; |
|
| 790 | 790 | |
| 791 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 791 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-factory.php'; |
|
| 792 | 792 | |
| 793 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 793 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-service.php'; |
|
| 794 | 794 | |
| 795 | 795 | /** |
| 796 | 796 | * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
| 797 | 797 | */ |
| 798 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rebuild-service.php'; |
|
| 798 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rebuild-service.php'; |
|
| 799 | 799 | |
| 800 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 800 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 801 | 801 | |
| 802 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 802 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-attachment-service.php'; |
|
| 803 | 803 | |
| 804 | 804 | /** |
| 805 | 805 | * Load the converters. |
| 806 | 806 | */ |
| 807 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 808 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 809 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 810 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 811 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 812 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 807 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/intf-wordlift-post-converter.php'; |
|
| 808 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 809 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 810 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 811 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 812 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 813 | 813 | |
| 814 | 814 | /** |
| 815 | 815 | * Load the content filter. |
| 816 | 816 | */ |
| 817 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 817 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-content-filter-service.php'; |
|
| 818 | 818 | |
| 819 | 819 | /* |
| 820 | 820 | * Load the excerpt helper. |
| 821 | 821 | */ |
| 822 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 822 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 823 | 823 | |
| 824 | 824 | /** |
| 825 | 825 | * Load the JSON-LD service to publish entities using JSON-LD.s |
| 826 | 826 | * |
| 827 | 827 | * @since 3.8.0 |
| 828 | 828 | */ |
| 829 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 829 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-service.php'; |
|
| 830 | 830 | |
| 831 | 831 | // The Publisher Service and the AJAX adapter. |
| 832 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 833 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 832 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-service.php'; |
|
| 833 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 834 | 834 | |
| 835 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 835 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-adapter.php'; |
|
| 836 | 836 | |
| 837 | 837 | /** |
| 838 | 838 | * Load the WordLift key validation service. |
| 839 | 839 | */ |
| 840 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 840 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-key-validation-service.php'; |
|
| 841 | 841 | |
| 842 | 842 | // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
| 843 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 843 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 844 | 844 | |
| 845 | 845 | // Load the `Wordlift_Entity_Page_Service` class definition. |
| 846 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
| 847 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-analysis-service.php'; |
|
| 848 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-rebuild-service.php'; |
|
| 846 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-page-service.php'; |
|
| 847 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-batch-analysis-service.php'; |
|
| 848 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-relation-rebuild-service.php'; |
|
| 849 | 849 | |
| 850 | 850 | /** Linked Data. */ |
| 851 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 852 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 853 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 854 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 855 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 856 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 857 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 858 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 859 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 860 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 861 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 862 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition.php'; |
|
| 863 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 851 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 852 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 853 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 854 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 855 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 856 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 857 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 858 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 859 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 860 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 861 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 862 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition.php'; |
|
| 863 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 864 | 864 | |
| 865 | 865 | /** Services. */ |
| 866 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 866 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 867 | 867 | |
| 868 | 868 | /** Adapters. */ |
| 869 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 870 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 871 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 872 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 873 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-analysis-adapter.php'; |
|
| 874 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-rebuild-adapter.php'; |
|
| 869 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-tinymce-adapter.php'; |
|
| 870 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-newrelic-adapter.php'; |
|
| 871 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 872 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-adapter.php'; |
|
| 873 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-batch-analysis-adapter.php'; |
|
| 874 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-relation-rebuild-adapter.php'; |
|
| 875 | 875 | |
| 876 | 876 | /** Async Tasks. */ |
| 877 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/wp-async-task.php'; |
|
| 878 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 879 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php'; |
|
| 880 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php'; |
|
| 877 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/wp-async-task.php'; |
|
| 878 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 879 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php'; |
|
| 880 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php'; |
|
| 881 | 881 | |
| 882 | 882 | /** Async Tasks. */ |
| 883 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-service.php'; |
|
| 884 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 883 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-service.php'; |
|
| 884 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 885 | 885 | |
| 886 | 886 | /** |
| 887 | 887 | * The class responsible for defining all actions that occur in the admin area. |
| 888 | 888 | */ |
| 889 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 889 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin.php'; |
|
| 890 | 890 | |
| 891 | 891 | /** |
| 892 | 892 | * The class to customize the entity list admin page. |
| 893 | 893 | */ |
| 894 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 894 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-list.php'; |
|
| 895 | 895 | |
| 896 | 896 | /** |
| 897 | 897 | * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
| 898 | 898 | */ |
| 899 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 899 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 900 | 900 | |
| 901 | 901 | /** |
| 902 | 902 | * The Notice service. |
| 903 | 903 | */ |
| 904 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 904 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-notice-service.php'; |
|
| 905 | 905 | |
| 906 | 906 | /** |
| 907 | 907 | * The PrimaShop adapter. |
| 908 | 908 | */ |
| 909 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 909 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-primashop-adapter.php'; |
|
| 910 | 910 | |
| 911 | 911 | /** |
| 912 | 912 | * The WordLift Dashboard service. |
| 913 | 913 | */ |
| 914 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 914 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard.php'; |
|
| 915 | 915 | |
| 916 | 916 | /** |
| 917 | 917 | * The admin 'Install wizard' page. |
| 918 | 918 | */ |
| 919 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 919 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-setup.php'; |
|
| 920 | 920 | |
| 921 | 921 | /** |
| 922 | 922 | * The WordLift entity type list admin page controller. |
| 923 | 923 | */ |
| 924 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 924 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 925 | 925 | |
| 926 | 926 | /** |
| 927 | 927 | * The WordLift entity type settings admin page controller. |
| 928 | 928 | */ |
| 929 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 929 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-settings.php'; |
|
| 930 | 930 | |
| 931 | 931 | /** |
| 932 | 932 | * The admin 'Download Your Data' page. |
| 933 | 933 | */ |
| 934 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 934 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-download-your-data-page.php'; |
|
| 935 | 935 | |
| 936 | 936 | /** |
| 937 | 937 | * The admin 'WordLift Settings' page. |
| 938 | 938 | */ |
| 939 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/intf-wordlift-admin-element.php'; |
|
| 940 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-element.php'; |
|
| 941 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-radio-element.php'; |
|
| 942 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-select2-element.php'; |
|
| 943 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-language-select-element.php'; |
|
| 944 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-tabs-element.php'; |
|
| 945 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-author-element.php'; |
|
| 946 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-publisher-element.php'; |
|
| 947 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 948 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 949 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-batch-analysis-page.php'; |
|
| 950 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 939 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/intf-wordlift-admin-element.php'; |
|
| 940 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-input-element.php'; |
|
| 941 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-input-radio-element.php'; |
|
| 942 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-select2-element.php'; |
|
| 943 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-language-select-element.php'; |
|
| 944 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-tabs-element.php'; |
|
| 945 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-author-element.php'; |
|
| 946 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-publisher-element.php'; |
|
| 947 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-page.php'; |
|
| 948 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page.php'; |
|
| 949 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-batch-analysis-page.php'; |
|
| 950 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 951 | 951 | |
| 952 | 952 | /** Admin Pages */ |
| 953 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 954 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 955 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 956 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 953 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 954 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 955 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-status-page.php'; |
|
| 956 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 957 | 957 | |
| 958 | 958 | /** |
| 959 | 959 | * The class responsible for defining all actions that occur in the public-facing |
| 960 | 960 | * side of the site. |
| 961 | 961 | */ |
| 962 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 962 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-public.php'; |
|
| 963 | 963 | |
| 964 | 964 | /** |
| 965 | 965 | * The shortcode abstract class. |
| 966 | 966 | */ |
| 967 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 967 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-shortcode.php'; |
|
| 968 | 968 | |
| 969 | 969 | /** |
| 970 | 970 | * The Timeline shortcode. |
| 971 | 971 | */ |
| 972 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 972 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-timeline-shortcode.php'; |
|
| 973 | 973 | |
| 974 | 974 | /** |
| 975 | 975 | * The Navigator shortcode. |
| 976 | 976 | */ |
| 977 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 977 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-navigator-shortcode.php'; |
|
| 978 | 978 | |
| 979 | 979 | /** |
| 980 | 980 | * The chord shortcode. |
| 981 | 981 | */ |
| 982 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 982 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-chord-shortcode.php'; |
|
| 983 | 983 | |
| 984 | 984 | /** |
| 985 | 985 | * The geomap shortcode. |
| 986 | 986 | */ |
| 987 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 987 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-geomap-shortcode.php'; |
|
| 988 | 988 | |
| 989 | 989 | /** |
| 990 | 990 | * The entity cloud shortcode. |
| 991 | 991 | */ |
| 992 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 992 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 993 | 993 | |
| 994 | 994 | /** |
| 995 | 995 | * The ShareThis service. |
| 996 | 996 | */ |
| 997 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 997 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-sharethis-service.php'; |
|
| 998 | 998 | |
| 999 | 999 | /** |
| 1000 | 1000 | * The SEO service. |
| 1001 | 1001 | */ |
| 1002 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 1002 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-seo-service.php'; |
|
| 1003 | 1003 | |
| 1004 | 1004 | /** |
| 1005 | 1005 | * The AMP service. |
| 1006 | 1006 | */ |
| 1007 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1007 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-amp-service.php'; |
|
| 1008 | 1008 | |
| 1009 | 1009 | /** Widgets */ |
| 1010 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1011 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1010 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-widget.php'; |
|
| 1011 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1012 | 1012 | |
| 1013 | 1013 | $this->loader = new Wordlift_Loader(); |
| 1014 | 1014 | |
| 1015 | 1015 | // Instantiate a global logger. |
| 1016 | 1016 | global $wl_logger; |
| 1017 | - $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1017 | + $wl_logger = Wordlift_Log_Service::get_logger('WordLift'); |
|
| 1018 | 1018 | |
| 1019 | 1019 | /** Services. */ |
| 1020 | 1020 | // Create the configuration service. |
| 1021 | 1021 | $this->configuration_service = new Wordlift_Configuration_Service(); |
| 1022 | 1022 | |
| 1023 | 1023 | // Create an entity type service instance. It'll be later bound to the init action. |
| 1024 | - $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 1024 | + $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service(Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path()); |
|
| 1025 | 1025 | |
| 1026 | 1026 | // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
| 1027 | - $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 1027 | + $this->entity_link_service = new Wordlift_Entity_Link_Service($this->entity_post_type_service, $this->configuration_service->get_entity_base_path()); |
|
| 1028 | 1028 | |
| 1029 | 1029 | // Create an instance of the UI service. |
| 1030 | 1030 | $this->ui_service = new Wordlift_UI_Service(); |
@@ -1033,30 +1033,30 @@ discard block |
||
| 1033 | 1033 | $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
| 1034 | 1034 | |
| 1035 | 1035 | $this->sparql_service = new Wordlift_Sparql_Service(); |
| 1036 | - $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 1036 | + $schema_url_property_service = new Wordlift_Schema_Url_Property_Service($this->sparql_service); |
|
| 1037 | 1037 | $this->notice_service = new Wordlift_Notice_Service(); |
| 1038 | 1038 | $this->relation_service = new Wordlift_Relation_Service(); |
| 1039 | - $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service ); |
|
| 1039 | + $this->entity_service = new Wordlift_Entity_Service($this->ui_service, $this->relation_service); |
|
| 1040 | 1040 | $this->user_service = new Wordlift_User_Service(); |
| 1041 | 1041 | |
| 1042 | 1042 | // Instantiate the JSON-LD service. |
| 1043 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1043 | + $property_getter = Wordlift_Property_Getter_Factory::create($this->entity_service); |
|
| 1044 | 1044 | |
| 1045 | 1045 | /** Linked Data. */ |
| 1046 | - $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
|
| 1047 | - $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
|
| 1046 | + $this->storage_factory = new Wordlift_Storage_Factory($this->entity_service, $this->user_service, $property_getter); |
|
| 1047 | + $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory($this->entity_service); |
|
| 1048 | 1048 | |
| 1049 | - $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
|
| 1049 | + $this->schema_service = new Wordlift_Schema_Service($this->storage_factory, $this->rendition_factory, $this->configuration_service); |
|
| 1050 | 1050 | |
| 1051 | 1051 | // Create a new instance of the Redirect service. |
| 1052 | - $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_service ); |
|
| 1053 | - $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 1054 | - $this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service ); |
|
| 1052 | + $this->redirect_service = new Wordlift_Redirect_Service($this->entity_service); |
|
| 1053 | + $this->entity_type_service = new Wordlift_Entity_Type_Service($this->schema_service); |
|
| 1054 | + $this->linked_data_service = new Wordlift_Linked_Data_Service($this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service); |
|
| 1055 | 1055 | |
| 1056 | 1056 | // Create a new instance of the Timeline service and Timeline shortcode. |
| 1057 | - $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
|
| 1057 | + $this->timeline_service = new Wordlift_Timeline_Service($this->entity_service, $this->entity_type_service); |
|
| 1058 | 1058 | |
| 1059 | - $this->batch_analysis_service = new Wordlift_Batch_Analysis_Service( $this, $this->configuration_service ); |
|
| 1059 | + $this->batch_analysis_service = new Wordlift_Batch_Analysis_Service($this, $this->configuration_service); |
|
| 1060 | 1060 | |
| 1061 | 1061 | $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
| 1062 | 1062 | |
@@ -1069,49 +1069,49 @@ discard block |
||
| 1069 | 1069 | $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
| 1070 | 1070 | |
| 1071 | 1071 | // Create an import service instance to hook later to WP's import function. |
| 1072 | - $this->import_service = new Wordlift_Import_Service( $this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri() ); |
|
| 1072 | + $this->import_service = new Wordlift_Import_Service($this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri()); |
|
| 1073 | 1073 | |
| 1074 | - $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1074 | + $uri_service = new Wordlift_Uri_Service($GLOBALS['wpdb']); |
|
| 1075 | 1075 | |
| 1076 | 1076 | // Create a Rebuild Service instance, which we'll later bound to an ajax call. |
| 1077 | - $this->rebuild_service = new Wordlift_Rebuild_Service( $this->sparql_service, $uri_service ); |
|
| 1077 | + $this->rebuild_service = new Wordlift_Rebuild_Service($this->sparql_service, $uri_service); |
|
| 1078 | 1078 | |
| 1079 | 1079 | // Create the entity rating service. |
| 1080 | - $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 1080 | + $this->rating_service = new Wordlift_Rating_Service($this->entity_service, $this->entity_type_service, $this->notice_service); |
|
| 1081 | 1081 | |
| 1082 | 1082 | // Create entity list customization (wp-admin/edit.php) |
| 1083 | - $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 1083 | + $this->entity_list_service = new Wordlift_Entity_List_Service($this->rating_service); |
|
| 1084 | 1084 | |
| 1085 | 1085 | // Create a new instance of the Redirect service. |
| 1086 | - $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
|
| 1086 | + $this->dashboard_service = new Wordlift_Dashboard_Service($this->rating_service, $this->entity_service); |
|
| 1087 | 1087 | |
| 1088 | 1088 | // Create an instance of the Publisher Service and the AJAX Adapter. |
| 1089 | 1089 | $publisher_service = new Wordlift_Publisher_Service(); |
| 1090 | - $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1091 | - $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1090 | + $this->property_factory = new Wordlift_Property_Factory($schema_url_property_service); |
|
| 1091 | + $this->property_factory->register(Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service); |
|
| 1092 | 1092 | |
| 1093 | 1093 | $attachment_service = new Wordlift_Attachment_Service(); |
| 1094 | 1094 | |
| 1095 | 1095 | // Instantiate the JSON-LD service. |
| 1096 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1097 | - $this->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter ); |
|
| 1098 | - $this->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service, $this->entity_post_to_jsonld_converter ); |
|
| 1099 | - $this->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter( $this->entity_service, $this->entity_post_to_jsonld_converter, $this->post_to_jsonld_converter ); |
|
| 1100 | - $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service, $this->entity_post_to_jsonld_converter ); |
|
| 1101 | - $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->postid_to_jsonld_converter, $this->jsonld_website_converter ); |
|
| 1102 | - |
|
| 1103 | - $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
|
| 1104 | - $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service ); |
|
| 1105 | - $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
|
| 1106 | - $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service ); |
|
| 1107 | - $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
|
| 1096 | + $property_getter = Wordlift_Property_Getter_Factory::create($this->entity_service); |
|
| 1097 | + $this->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter); |
|
| 1098 | + $this->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service, $this->entity_post_to_jsonld_converter); |
|
| 1099 | + $this->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter($this->entity_service, $this->entity_post_to_jsonld_converter, $this->post_to_jsonld_converter); |
|
| 1100 | + $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service, $this->entity_post_to_jsonld_converter); |
|
| 1101 | + $this->jsonld_service = new Wordlift_Jsonld_Service($this->entity_service, $this->postid_to_jsonld_converter, $this->jsonld_website_converter); |
|
| 1102 | + |
|
| 1103 | + $this->key_validation_service = new Wordlift_Key_Validation_Service($this->configuration_service); |
|
| 1104 | + $this->content_filter_service = new Wordlift_Content_Filter_Service($this->entity_service, $this->configuration_service); |
|
| 1105 | + $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service($this->content_filter_service, $this->entity_service); |
|
| 1106 | + $this->sample_data_service = new Wordlift_Sample_Data_Service($this->entity_type_service, $this->configuration_service); |
|
| 1107 | + $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter($this->sample_data_service); |
|
| 1108 | 1108 | |
| 1109 | 1109 | // Initialize the shortcodes. |
| 1110 | 1110 | new Wordlift_Navigator_Shortcode(); |
| 1111 | 1111 | new Wordlift_Chord_Shortcode(); |
| 1112 | 1112 | new Wordlift_Geomap_Shortcode(); |
| 1113 | 1113 | new Wordlift_Timeline_Shortcode(); |
| 1114 | - new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
|
| 1114 | + new Wordlift_Related_Entities_Cloud_Shortcode($this->relation_service); |
|
| 1115 | 1115 | |
| 1116 | 1116 | // Initialize the SEO service. |
| 1117 | 1117 | new Wordlift_Seo_Service(); |
@@ -1123,11 +1123,11 @@ discard block |
||
| 1123 | 1123 | $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
| 1124 | 1124 | |
| 1125 | 1125 | /** Adapters. */ |
| 1126 | - $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
|
| 1127 | - $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $publisher_service ); |
|
| 1128 | - $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 1129 | - $this->batch_analysis_adapter = new Wordlift_Batch_Analysis_Adapter( $this->batch_analysis_service ); |
|
| 1130 | - $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
|
| 1126 | + $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter($this->entity_type_service); |
|
| 1127 | + $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter($publisher_service); |
|
| 1128 | + $this->tinymce_adapter = new Wordlift_Tinymce_Adapter($this); |
|
| 1129 | + $this->batch_analysis_adapter = new Wordlift_Batch_Analysis_Adapter($this->batch_analysis_service); |
|
| 1130 | + $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter($this->relation_rebuild_service); |
|
| 1131 | 1131 | |
| 1132 | 1132 | /** Async Tasks. */ |
| 1133 | 1133 | new Wordlift_Sparql_Query_Async_Task(); |
@@ -1135,8 +1135,8 @@ discard block |
||
| 1135 | 1135 | new Wordlift_Batch_Analysis_Complete_Async_Task(); |
| 1136 | 1136 | |
| 1137 | 1137 | /** WL Autocomplete. */ |
| 1138 | - $this->autocomplete_service = new Wordlift_Autocomplete_Service( $this->configuration_service ); |
|
| 1139 | - $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $this->autocomplete_service ); |
|
| 1138 | + $this->autocomplete_service = new Wordlift_Autocomplete_Service($this->configuration_service); |
|
| 1139 | + $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter($this->autocomplete_service); |
|
| 1140 | 1140 | |
| 1141 | 1141 | /** WordPress Admin UI. */ |
| 1142 | 1142 | |
@@ -1146,15 +1146,15 @@ discard block |
||
| 1146 | 1146 | $this->select2_element = new Wordlift_Admin_Select2_Element(); |
| 1147 | 1147 | $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
| 1148 | 1148 | $tabs_element = new Wordlift_Admin_Tabs_Element(); |
| 1149 | - $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $publisher_service, $tabs_element, $this->select2_element ); |
|
| 1150 | - $this->author_element = new Wordlift_Admin_Author_Element( $publisher_service, $this->select2_element ); |
|
| 1149 | + $this->publisher_element = new Wordlift_Admin_Publisher_Element($this->configuration_service, $publisher_service, $tabs_element, $this->select2_element); |
|
| 1150 | + $this->author_element = new Wordlift_Admin_Author_Element($publisher_service, $this->select2_element); |
|
| 1151 | 1151 | |
| 1152 | - $this->settings_page = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->publisher_element, $this->radio_input_element ); |
|
| 1153 | - $this->batch_analysis_page = new Wordlift_Batch_Analysis_Page( $this->batch_analysis_service ); |
|
| 1154 | - $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 1152 | + $this->settings_page = new Wordlift_Admin_Settings_Page($this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->publisher_element, $this->radio_input_element); |
|
| 1153 | + $this->batch_analysis_page = new Wordlift_Batch_Analysis_Page($this->batch_analysis_service); |
|
| 1154 | + $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link($this->settings_page); |
|
| 1155 | 1155 | |
| 1156 | 1156 | // Pages. |
| 1157 | - new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 1157 | + new Wordlift_Admin_Post_Edit_Page($this); |
|
| 1158 | 1158 | new Wordlift_Entity_Type_Admin_Service(); |
| 1159 | 1159 | |
| 1160 | 1160 | // create an instance of the entity type list admin page controller. |
@@ -1167,23 +1167,23 @@ discard block |
||
| 1167 | 1167 | $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
| 1168 | 1168 | |
| 1169 | 1169 | //** WordPress Admin */ |
| 1170 | - $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 1171 | - $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 1170 | + $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page($this->configuration_service); |
|
| 1171 | + $this->status_page = new Wordlift_Admin_Status_Page($this->entity_service, $this->sparql_service); |
|
| 1172 | 1172 | |
| 1173 | 1173 | // Create an instance of the install wizard. |
| 1174 | - $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service ); |
|
| 1174 | + $this->admin_setup = new Wordlift_Admin_Setup($this->configuration_service, $this->key_validation_service, $this->entity_service); |
|
| 1175 | 1175 | |
| 1176 | - $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1176 | + $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service($this->entity_post_type_service); |
|
| 1177 | 1177 | |
| 1178 | 1178 | // User Profile. |
| 1179 | - new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1179 | + new Wordlift_Admin_User_Profile_Page($this->author_element, $this->user_service); |
|
| 1180 | 1180 | |
| 1181 | 1181 | $this->entity_page_service = new Wordlift_Entity_Page_Service(); |
| 1182 | 1182 | |
| 1183 | 1183 | // Load the debug service if WP is in debug mode. |
| 1184 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1185 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1186 | - new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1184 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
| 1185 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-debug-service.php'; |
|
| 1186 | + new Wordlift_Debug_Service($this->entity_service, $uri_service); |
|
| 1187 | 1187 | } |
| 1188 | 1188 | |
| 1189 | 1189 | } |
@@ -1200,9 +1200,9 @@ discard block |
||
| 1200 | 1200 | private function set_locale() { |
| 1201 | 1201 | |
| 1202 | 1202 | $plugin_i18n = new Wordlift_i18n(); |
| 1203 | - $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1203 | + $plugin_i18n->set_domain($this->get_plugin_name()); |
|
| 1204 | 1204 | |
| 1205 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1205 | + $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain'); |
|
| 1206 | 1206 | |
| 1207 | 1207 | } |
| 1208 | 1208 | |
@@ -1223,138 +1223,138 @@ discard block |
||
| 1223 | 1223 | $this->user_service |
| 1224 | 1224 | ); |
| 1225 | 1225 | |
| 1226 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1227 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); |
|
| 1226 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles'); |
|
| 1227 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts'); |
|
| 1228 | 1228 | |
| 1229 | 1229 | // Hook the init action to the Topic Taxonomy service. |
| 1230 | - $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1230 | + $this->loader->add_action('init', $this->topic_taxonomy_service, 'init', 0); |
|
| 1231 | 1231 | |
| 1232 | 1232 | // Hook the deleted_post_meta action to the Thumbnail service. |
| 1233 | - $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1233 | + $this->loader->add_action('deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4); |
|
| 1234 | 1234 | |
| 1235 | 1235 | // Hook the added_post_meta action to the Thumbnail service. |
| 1236 | - $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1236 | + $this->loader->add_action('added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4); |
|
| 1237 | 1237 | |
| 1238 | 1238 | // Hook the updated_post_meta action to the Thumbnail service. |
| 1239 | - $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1239 | + $this->loader->add_action('updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4); |
|
| 1240 | 1240 | |
| 1241 | 1241 | // Hook the AJAX wl_timeline action to the Timeline service. |
| 1242 | - $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1242 | + $this->loader->add_action('wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline'); |
|
| 1243 | 1243 | |
| 1244 | 1244 | // Register custom allowed redirect hosts. |
| 1245 | - $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1245 | + $this->loader->add_filter('allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts'); |
|
| 1246 | 1246 | // Hook the AJAX wordlift_redirect action to the Redirect service. |
| 1247 | - $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1247 | + $this->loader->add_action('wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect'); |
|
| 1248 | 1248 | // Hook the AJAX wordlift_redirect action to the Redirect service. |
| 1249 | - $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' ); |
|
| 1249 | + $this->loader->add_action('wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats'); |
|
| 1250 | 1250 | // Hook the AJAX wordlift_redirect action to the Redirect service. |
| 1251 | - $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' ); |
|
| 1251 | + $this->loader->add_action('wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets'); |
|
| 1252 | 1252 | |
| 1253 | 1253 | // Hook save_post to the entity service to update custom fields (such as alternate labels). |
| 1254 | 1254 | // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
| 1255 | - $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1256 | - $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1255 | + $this->loader->add_action('save_post', $this->entity_service, 'save_post', 9, 3); |
|
| 1256 | + $this->loader->add_action('save_post', $this->rating_service, 'set_rating_for', 20, 1); |
|
| 1257 | 1257 | |
| 1258 | - $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1259 | - $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1258 | + $this->loader->add_action('edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1); |
|
| 1259 | + $this->loader->add_action('in_admin_header', $this->rating_service, 'in_admin_header'); |
|
| 1260 | 1260 | |
| 1261 | 1261 | // Entity listing customization (wp-admin/edit.php) |
| 1262 | 1262 | // Add custom columns |
| 1263 | - $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1263 | + $this->loader->add_filter('manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns'); |
|
| 1264 | 1264 | // no explicit entity as it prevents handling of other post types. |
| 1265 | - $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1265 | + $this->loader->add_filter('manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2); |
|
| 1266 | 1266 | // Add 4W selection |
| 1267 | - $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1268 | - $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1269 | - $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' ); |
|
| 1270 | - $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' ); |
|
| 1271 | - $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1267 | + $this->loader->add_action('restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope'); |
|
| 1268 | + $this->loader->add_filter('posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope'); |
|
| 1269 | + $this->loader->add_action('pre_get_posts', $this->entity_list_service, 'pre_get_posts'); |
|
| 1270 | + $this->loader->add_action('load-edit.php', $this->entity_list_service, 'load_edit'); |
|
| 1271 | + $this->loader->add_filter('wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args'); |
|
| 1272 | 1272 | |
| 1273 | 1273 | // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
| 1274 | 1274 | // entities. |
| 1275 | - $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1275 | + $this->loader->add_filter('prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2); |
|
| 1276 | 1276 | |
| 1277 | 1277 | // Filter imported post meta. |
| 1278 | - $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1278 | + $this->loader->add_filter('wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3); |
|
| 1279 | 1279 | |
| 1280 | 1280 | // Notify the import service when an import starts and ends. |
| 1281 | - $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1282 | - $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1281 | + $this->loader->add_action('import_start', $this->import_service, 'import_start', 10, 0); |
|
| 1282 | + $this->loader->add_action('import_end', $this->import_service, 'import_end', 10, 0); |
|
| 1283 | 1283 | |
| 1284 | 1284 | // Hook the AJAX wl_rebuild action to the Rebuild Service. |
| 1285 | - $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1285 | + $this->loader->add_action('wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild'); |
|
| 1286 | 1286 | |
| 1287 | 1287 | // Hook the menu to the Download Your Data page. |
| 1288 | - $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 ); |
|
| 1289 | - $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 ); |
|
| 1290 | - $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 ); |
|
| 1288 | + $this->loader->add_action('admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0); |
|
| 1289 | + $this->loader->add_action('admin_menu', $this->status_page, 'admin_menu', 100, 0); |
|
| 1290 | + $this->loader->add_action('admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0); |
|
| 1291 | 1291 | |
| 1292 | 1292 | // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
| 1293 | - $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1293 | + $this->loader->add_action('wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10); |
|
| 1294 | 1294 | |
| 1295 | 1295 | // Hook the AJAX wl_jsonld action to the JSON-LD service. |
| 1296 | - $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1296 | + $this->loader->add_action('wp_ajax_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1297 | 1297 | |
| 1298 | 1298 | // Hook the AJAX wl_validate_key action to the Key Validation service. |
| 1299 | - $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1299 | + $this->loader->add_action('wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key'); |
|
| 1300 | 1300 | |
| 1301 | 1301 | // Hook the `admin_init` function to the Admin Setup. |
| 1302 | - $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1302 | + $this->loader->add_action('admin_init', $this->admin_setup, 'admin_init'); |
|
| 1303 | 1303 | |
| 1304 | 1304 | // Hook the admin_init to the settings page. |
| 1305 | - $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1305 | + $this->loader->add_action('admin_init', $this->settings_page, 'admin_init'); |
|
| 1306 | 1306 | |
| 1307 | 1307 | // Hook the menu creation on the general wordlift menu creation |
| 1308 | - $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 ); |
|
| 1309 | - if ( defined( 'WORDLIFT_BATCH' ) && WORDLIFT_BATCH ) { |
|
| 1308 | + $this->loader->add_action('wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2); |
|
| 1309 | + if (defined('WORDLIFT_BATCH') && WORDLIFT_BATCH) { |
|
| 1310 | 1310 | // Add the functionality only if a flag is set in wp-config.php . |
| 1311 | - $this->loader->add_action( 'wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2 ); |
|
| 1311 | + $this->loader->add_action('wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2); |
|
| 1312 | 1312 | } |
| 1313 | 1313 | |
| 1314 | 1314 | // Hook key update. |
| 1315 | - $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1316 | - $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1315 | + $this->loader->add_action('pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2); |
|
| 1316 | + $this->loader->add_action('update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2); |
|
| 1317 | 1317 | |
| 1318 | 1318 | // Add additional action links to the WordLift plugin in the plugins page. |
| 1319 | - $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1319 | + $this->loader->add_filter('plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1); |
|
| 1320 | 1320 | |
| 1321 | 1321 | // Hook the AJAX `wl_publisher` action name. |
| 1322 | - $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1322 | + $this->loader->add_action('wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher'); |
|
| 1323 | 1323 | |
| 1324 | 1324 | // Hook row actions for the entity type list admin. |
| 1325 | - $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1325 | + $this->loader->add_filter('wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2); |
|
| 1326 | 1326 | |
| 1327 | 1327 | /** Ajax actions. */ |
| 1328 | - $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' ); |
|
| 1328 | + $this->loader->add_action('wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export'); |
|
| 1329 | 1329 | |
| 1330 | 1330 | // Hook capabilities manipulation to allow access to entity type admin |
| 1331 | 1331 | // page on wordpress versions before 4.7. |
| 1332 | 1332 | global $wp_version; |
| 1333 | - if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1334 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1333 | + if (version_compare($wp_version, '4.7', '<')) { |
|
| 1334 | + $this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4); |
|
| 1335 | 1335 | } |
| 1336 | 1336 | |
| 1337 | - $this->loader->add_action( 'wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1337 | + $this->loader->add_action('wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1); |
|
| 1338 | 1338 | |
| 1339 | 1339 | /** Adapters. */ |
| 1340 | - $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1341 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_auto_selected_posts', $this->batch_analysis_adapter, 'submit_auto_selected_posts', 10 ); |
|
| 1342 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_all_posts', $this->batch_analysis_adapter, 'submit_all_posts', 10 ); |
|
| 1343 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit', 10 ); |
|
| 1344 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel', 10 ); |
|
| 1345 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning', 10 ); |
|
| 1346 | - $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all', 10 ); |
|
| 1340 | + $this->loader->add_filter('mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1); |
|
| 1341 | + $this->loader->add_action('wp_ajax_wl_batch_analysis_submit_auto_selected_posts', $this->batch_analysis_adapter, 'submit_auto_selected_posts', 10); |
|
| 1342 | + $this->loader->add_action('wp_ajax_wl_batch_analysis_submit_all_posts', $this->batch_analysis_adapter, 'submit_all_posts', 10); |
|
| 1343 | + $this->loader->add_action('wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit', 10); |
|
| 1344 | + $this->loader->add_action('wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel', 10); |
|
| 1345 | + $this->loader->add_action('wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning', 10); |
|
| 1346 | + $this->loader->add_action('wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all', 10); |
|
| 1347 | 1347 | |
| 1348 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' ); |
|
| 1349 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' ); |
|
| 1348 | + $this->loader->add_action('wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create'); |
|
| 1349 | + $this->loader->add_action('wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete'); |
|
| 1350 | 1350 | |
| 1351 | 1351 | // Handle the autocomplete request. |
| 1352 | - add_action( 'wp_ajax_wl_autocomplete', array( $this->autocomplete_adapter, 'wl_autocomplete' ) ); |
|
| 1353 | - add_action( 'wp_ajax_nopriv_wl_autocomplete', array( $this->autocomplete_adapter, 'wl_autocomplete' ) ); |
|
| 1352 | + add_action('wp_ajax_wl_autocomplete', array($this->autocomplete_adapter, 'wl_autocomplete')); |
|
| 1353 | + add_action('wp_ajax_nopriv_wl_autocomplete', array($this->autocomplete_adapter, 'wl_autocomplete')); |
|
| 1354 | 1354 | |
| 1355 | 1355 | // Hooks to restrict multisite super admin from manipulating entity types. |
| 1356 | - if ( is_multisite() ) { |
|
| 1357 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1356 | + if (is_multisite()) { |
|
| 1357 | + $this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4); |
|
| 1358 | 1358 | } |
| 1359 | 1359 | |
| 1360 | 1360 | } |
@@ -1368,49 +1368,49 @@ discard block |
||
| 1368 | 1368 | */ |
| 1369 | 1369 | private function define_public_hooks() { |
| 1370 | 1370 | |
| 1371 | - $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1371 | + $plugin_public = new Wordlift_Public($this->get_plugin_name(), $this->get_version()); |
|
| 1372 | 1372 | |
| 1373 | 1373 | // Register the entity post type. |
| 1374 | - $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1374 | + $this->loader->add_action('init', $this->entity_post_type_service, 'register'); |
|
| 1375 | 1375 | |
| 1376 | 1376 | // Bind the link generation and handling hooks to the entity link service. |
| 1377 | - $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1378 | - $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1379 | - $this->loader->add_filter( 'wp_unique_post_slug_is_bad_flat_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3 ); |
|
| 1380 | - $this->loader->add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4 ); |
|
| 1377 | + $this->loader->add_filter('post_type_link', $this->entity_link_service, 'post_type_link', 10, 4); |
|
| 1378 | + $this->loader->add_action('pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1); |
|
| 1379 | + $this->loader->add_filter('wp_unique_post_slug_is_bad_flat_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3); |
|
| 1380 | + $this->loader->add_filter('wp_unique_post_slug_is_bad_hierarchical_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4); |
|
| 1381 | 1381 | |
| 1382 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1383 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1382 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles'); |
|
| 1383 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts'); |
|
| 1384 | 1384 | |
| 1385 | 1385 | // Hook the content filter service to add entity links. |
| 1386 | - $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1386 | + $this->loader->add_filter('the_content', $this->content_filter_service, 'the_content'); |
|
| 1387 | 1387 | |
| 1388 | 1388 | // Hook the AJAX wl_timeline action to the Timeline service. |
| 1389 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1389 | + $this->loader->add_action('wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline'); |
|
| 1390 | 1390 | |
| 1391 | 1391 | // Hook the ShareThis service. |
| 1392 | - $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1393 | - $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1392 | + $this->loader->add_filter('the_content', $this->sharethis_service, 'the_content', 99); |
|
| 1393 | + $this->loader->add_filter('the_excerpt', $this->sharethis_service, 'the_excerpt', 99); |
|
| 1394 | 1394 | |
| 1395 | 1395 | // Hook the AJAX wl_jsonld action to the JSON-LD service. |
| 1396 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1396 | + $this->loader->add_action('wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1397 | 1397 | |
| 1398 | 1398 | // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
| 1399 | 1399 | // in order to tweak WP's `WP_Query` to include entities in queries related |
| 1400 | 1400 | // to categories. |
| 1401 | - $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1401 | + $this->loader->add_action('pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1); |
|
| 1402 | 1402 | |
| 1403 | 1403 | /* |
| 1404 | 1404 | * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service` |
| 1405 | 1405 | * in order to tweak WP's `WP_Query` to show event related entities in reverse |
| 1406 | 1406 | * order of start time. |
| 1407 | 1407 | */ |
| 1408 | - $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1408 | + $this->loader->add_action('pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1); |
|
| 1409 | 1409 | |
| 1410 | - $this->loader->add_action( 'wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1410 | + $this->loader->add_action('wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1); |
|
| 1411 | 1411 | |
| 1412 | 1412 | // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
| 1413 | - $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1413 | + $this->loader->add_action('save_post', $this->entity_type_adapter, 'save_post', 9, 3); |
|
| 1414 | 1414 | |
| 1415 | 1415 | } |
| 1416 | 1416 | |