@@ -7,145 +7,145 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | class Wordlift_Admin_Dashboard_V2 { |
| 9 | 9 | |
| 10 | - const TODAYS_TIP = 'wl_todays_tip_data'; |
|
| 11 | - const AVERAGE_POSITION = 'wl_search_rankings_average_position'; |
|
| 12 | - |
|
| 13 | - /** |
|
| 14 | - * The {@link Wordlift_Admin_Search_Rankings_Service} instance. |
|
| 15 | - * |
|
| 16 | - * @since 3.20.0 |
|
| 17 | - * @access private |
|
| 18 | - * @var \Wordlift_Admin_Search_Rankings_Service $search_rankings_service The {@link Wordlift_Admin_Search_Rankings_Service} instance. |
|
| 19 | - */ |
|
| 20 | - private $search_rankings_service; |
|
| 21 | - |
|
| 22 | - /** |
|
| 23 | - * The {@link Wordlift_Dashboard_Service} instance. |
|
| 24 | - * |
|
| 25 | - * @var \Wordlift_Dashboard_Service $dashboard_service The {@link Wordlift_Dashboard_Service} instance. |
|
| 26 | - * @access private |
|
| 27 | - * @since 3.20.0 |
|
| 28 | - */ |
|
| 29 | - private $dashboard_service; |
|
| 30 | - |
|
| 31 | - /** |
|
| 32 | - * @var \Wordlift_Entity_Service $entity_service |
|
| 33 | - */ |
|
| 34 | - private $entity_service; |
|
| 35 | - |
|
| 36 | - /** |
|
| 37 | - * Wordlift_Admin_Dashboard_V2 constructor. |
|
| 38 | - * |
|
| 39 | - * @param \Wordlift_Admin_Search_Rankings_Service $search_rankings_service The {@link Wordlift_Admin_Search_Rankings_Service} instance. |
|
| 40 | - * @param $dashboard_service |
|
| 41 | - * |
|
| 42 | - * @since 3.20.0 |
|
| 43 | - * |
|
| 44 | - */ |
|
| 45 | - public function __construct( $search_rankings_service, $dashboard_service, $entity_service ) { |
|
| 46 | - |
|
| 47 | - add_action( 'wp_dashboard_setup', array( $this, 'dashboard_setup' ) ); |
|
| 48 | - |
|
| 49 | - // Define where to access the tip. |
|
| 50 | - defined( 'WL_TODAYS_TIP_JSON_URL' ) || define( 'WL_TODAYS_TIP_JSON_URL', 'https://wordlift.io/blog' ); |
|
| 51 | - defined( 'WL_TODAYS_TIP_JSON_URL_IT' ) || define( 'WL_TODAYS_TIP_JSON_URL_IT', '/it/wp-json/wp/v2/posts?context=embed&per_page=1&categories=27' ); |
|
| 52 | - defined( 'WL_TODAYS_TIP_JSON_URL_EN' ) || define( 'WL_TODAYS_TIP_JSON_URL_EN', '/en/wp-json/wp/v2/posts?context=embed&per_page=1&categories=38' ); |
|
| 53 | - |
|
| 54 | - $this->search_rankings_service = $search_rankings_service; |
|
| 55 | - $this->dashboard_service = $dashboard_service; |
|
| 56 | - $this->entity_service = $entity_service; |
|
| 57 | - |
|
| 58 | - } |
|
| 59 | - |
|
| 60 | - /** |
|
| 61 | - * Set up the dashboard metabox. |
|
| 62 | - * |
|
| 63 | - * @since 3.20.0 |
|
| 64 | - */ |
|
| 65 | - public function dashboard_setup() { |
|
| 66 | - |
|
| 67 | - wp_add_dashboard_widget( |
|
| 68 | - 'wl-dashboard-v2', |
|
| 69 | - __( 'WordLift Dashboard', 'wordlift' ), |
|
| 70 | - array( $this, 'dashboard_setup_callback' ) |
|
| 71 | - ); |
|
| 72 | - |
|
| 73 | - } |
|
| 74 | - |
|
| 75 | - /** |
|
| 76 | - * The dashboard setup callback. |
|
| 77 | - * |
|
| 78 | - * @since 3.20.0 |
|
| 79 | - */ |
|
| 80 | - public function dashboard_setup_callback() { |
|
| 81 | - |
|
| 82 | - // Get the average position. |
|
| 83 | - $average_position_string = $this->get_average_position(); |
|
| 84 | - |
|
| 85 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/partials/wordlift-admin-dashboard-v2.php'; |
|
| 86 | - |
|
| 87 | - } |
|
| 88 | - |
|
| 89 | - /** |
|
| 90 | - * Get the keyword average position. |
|
| 91 | - * |
|
| 92 | - * @return string The formatted average position string (or `n/a` if not available). |
|
| 93 | - * @since 3.20.0 |
|
| 94 | - * |
|
| 95 | - */ |
|
| 96 | - private function get_average_position() { |
|
| 97 | - |
|
| 98 | - // Get the cache value. |
|
| 99 | - $average_position = get_transient( self::AVERAGE_POSITION ); |
|
| 100 | - |
|
| 101 | - // If there's no cached value, load it. |
|
| 102 | - if ( false === $average_position ) { |
|
| 103 | - // Get the average position from Search Ranking Service. |
|
| 104 | - $average_position = @$this->search_rankings_service->get_average_position(); |
|
| 105 | - |
|
| 106 | - // If there was an error return 'n/a'. |
|
| 107 | - if ( false === $average_position ) { |
|
| 108 | - return esc_html( _x( 'n/a', 'Dashboard', 'wordlift' ) ); |
|
| 109 | - } |
|
| 110 | - } |
|
| 111 | - |
|
| 112 | - // Store the value for one day. |
|
| 113 | - set_transient( self::AVERAGE_POSITION, $average_position, 86400 ); // One day. |
|
| 114 | - |
|
| 115 | - // Format the average position with one decimal. |
|
| 116 | - return number_format( $average_position, 1 ); |
|
| 117 | - } |
|
| 118 | - |
|
| 119 | - /** |
|
| 120 | - * Get the top entities. |
|
| 121 | - * |
|
| 122 | - * @return array|object|null An array of top entities. |
|
| 123 | - * @since 3.20.0 |
|
| 124 | - * |
|
| 125 | - */ |
|
| 126 | - private function get_top_entities() { |
|
| 127 | - /** |
|
| 128 | - * @since 3.27.7 |
|
| 10 | + const TODAYS_TIP = 'wl_todays_tip_data'; |
|
| 11 | + const AVERAGE_POSITION = 'wl_search_rankings_average_position'; |
|
| 12 | + |
|
| 13 | + /** |
|
| 14 | + * The {@link Wordlift_Admin_Search_Rankings_Service} instance. |
|
| 15 | + * |
|
| 16 | + * @since 3.20.0 |
|
| 17 | + * @access private |
|
| 18 | + * @var \Wordlift_Admin_Search_Rankings_Service $search_rankings_service The {@link Wordlift_Admin_Search_Rankings_Service} instance. |
|
| 19 | + */ |
|
| 20 | + private $search_rankings_service; |
|
| 21 | + |
|
| 22 | + /** |
|
| 23 | + * The {@link Wordlift_Dashboard_Service} instance. |
|
| 24 | + * |
|
| 25 | + * @var \Wordlift_Dashboard_Service $dashboard_service The {@link Wordlift_Dashboard_Service} instance. |
|
| 26 | + * @access private |
|
| 27 | + * @since 3.20.0 |
|
| 28 | + */ |
|
| 29 | + private $dashboard_service; |
|
| 30 | + |
|
| 31 | + /** |
|
| 32 | + * @var \Wordlift_Entity_Service $entity_service |
|
| 33 | + */ |
|
| 34 | + private $entity_service; |
|
| 35 | + |
|
| 36 | + /** |
|
| 37 | + * Wordlift_Admin_Dashboard_V2 constructor. |
|
| 38 | + * |
|
| 39 | + * @param \Wordlift_Admin_Search_Rankings_Service $search_rankings_service The {@link Wordlift_Admin_Search_Rankings_Service} instance. |
|
| 40 | + * @param $dashboard_service |
|
| 41 | + * |
|
| 42 | + * @since 3.20.0 |
|
| 43 | + * |
|
| 44 | + */ |
|
| 45 | + public function __construct( $search_rankings_service, $dashboard_service, $entity_service ) { |
|
| 46 | + |
|
| 47 | + add_action( 'wp_dashboard_setup', array( $this, 'dashboard_setup' ) ); |
|
| 48 | + |
|
| 49 | + // Define where to access the tip. |
|
| 50 | + defined( 'WL_TODAYS_TIP_JSON_URL' ) || define( 'WL_TODAYS_TIP_JSON_URL', 'https://wordlift.io/blog' ); |
|
| 51 | + defined( 'WL_TODAYS_TIP_JSON_URL_IT' ) || define( 'WL_TODAYS_TIP_JSON_URL_IT', '/it/wp-json/wp/v2/posts?context=embed&per_page=1&categories=27' ); |
|
| 52 | + defined( 'WL_TODAYS_TIP_JSON_URL_EN' ) || define( 'WL_TODAYS_TIP_JSON_URL_EN', '/en/wp-json/wp/v2/posts?context=embed&per_page=1&categories=38' ); |
|
| 53 | + |
|
| 54 | + $this->search_rankings_service = $search_rankings_service; |
|
| 55 | + $this->dashboard_service = $dashboard_service; |
|
| 56 | + $this->entity_service = $entity_service; |
|
| 57 | + |
|
| 58 | + } |
|
| 59 | + |
|
| 60 | + /** |
|
| 61 | + * Set up the dashboard metabox. |
|
| 62 | + * |
|
| 63 | + * @since 3.20.0 |
|
| 64 | + */ |
|
| 65 | + public function dashboard_setup() { |
|
| 66 | + |
|
| 67 | + wp_add_dashboard_widget( |
|
| 68 | + 'wl-dashboard-v2', |
|
| 69 | + __( 'WordLift Dashboard', 'wordlift' ), |
|
| 70 | + array( $this, 'dashboard_setup_callback' ) |
|
| 71 | + ); |
|
| 72 | + |
|
| 73 | + } |
|
| 74 | + |
|
| 75 | + /** |
|
| 76 | + * The dashboard setup callback. |
|
| 77 | + * |
|
| 78 | + * @since 3.20.0 |
|
| 79 | + */ |
|
| 80 | + public function dashboard_setup_callback() { |
|
| 81 | + |
|
| 82 | + // Get the average position. |
|
| 83 | + $average_position_string = $this->get_average_position(); |
|
| 84 | + |
|
| 85 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/partials/wordlift-admin-dashboard-v2.php'; |
|
| 86 | + |
|
| 87 | + } |
|
| 88 | + |
|
| 89 | + /** |
|
| 90 | + * Get the keyword average position. |
|
| 91 | + * |
|
| 92 | + * @return string The formatted average position string (or `n/a` if not available). |
|
| 93 | + * @since 3.20.0 |
|
| 94 | + * |
|
| 95 | + */ |
|
| 96 | + private function get_average_position() { |
|
| 97 | + |
|
| 98 | + // Get the cache value. |
|
| 99 | + $average_position = get_transient( self::AVERAGE_POSITION ); |
|
| 100 | + |
|
| 101 | + // If there's no cached value, load it. |
|
| 102 | + if ( false === $average_position ) { |
|
| 103 | + // Get the average position from Search Ranking Service. |
|
| 104 | + $average_position = @$this->search_rankings_service->get_average_position(); |
|
| 105 | + |
|
| 106 | + // If there was an error return 'n/a'. |
|
| 107 | + if ( false === $average_position ) { |
|
| 108 | + return esc_html( _x( 'n/a', 'Dashboard', 'wordlift' ) ); |
|
| 109 | + } |
|
| 110 | + } |
|
| 111 | + |
|
| 112 | + // Store the value for one day. |
|
| 113 | + set_transient( self::AVERAGE_POSITION, $average_position, 86400 ); // One day. |
|
| 114 | + |
|
| 115 | + // Format the average position with one decimal. |
|
| 116 | + return number_format( $average_position, 1 ); |
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + /** |
|
| 120 | + * Get the top entities. |
|
| 121 | + * |
|
| 122 | + * @return array|object|null An array of top entities. |
|
| 123 | + * @since 3.20.0 |
|
| 124 | + * |
|
| 125 | + */ |
|
| 126 | + private function get_top_entities() { |
|
| 127 | + /** |
|
| 128 | + * @since 3.27.7 |
|
| 129 | 129 | * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
| 130 | 130 | * Top entities are generated by cron now. |
| 131 | - */ |
|
| 132 | - return get_option( Top_Entities::OPTION_KEY, array() ); |
|
| 133 | - } |
|
| 131 | + */ |
|
| 132 | + return get_option( Top_Entities::OPTION_KEY, array() ); |
|
| 133 | + } |
|
| 134 | 134 | |
| 135 | - /** |
|
| 136 | - * Get the today's tip block. |
|
| 137 | - * |
|
| 138 | - * @since 3.20.0 |
|
| 139 | - */ |
|
| 140 | - public static function get_todays_tip_block() { |
|
| 135 | + /** |
|
| 136 | + * Get the today's tip block. |
|
| 137 | + * |
|
| 138 | + * @since 3.20.0 |
|
| 139 | + */ |
|
| 140 | + public static function get_todays_tip_block() { |
|
| 141 | 141 | |
| 142 | - $data = @self::get_todays_tip_data(); |
|
| 142 | + $data = @self::get_todays_tip_data(); |
|
| 143 | 143 | |
| 144 | - // Unable to get data from the local cache, nor from the remote URL. |
|
| 145 | - if ( false === $data ) { |
|
| 146 | - return; |
|
| 147 | - } |
|
| 148 | - ?> |
|
| 144 | + // Unable to get data from the local cache, nor from the remote URL. |
|
| 145 | + if ( false === $data ) { |
|
| 146 | + return; |
|
| 147 | + } |
|
| 148 | + ?> |
|
| 149 | 149 | |
| 150 | 150 | <div id="wl-todays-tip" class="wl-dashboard__block wl-dashboard__block--todays-tip"> |
| 151 | 151 | <header> |
@@ -160,53 +160,53 @@ discard block |
||
| 160 | 160 | </div> |
| 161 | 161 | <?php |
| 162 | 162 | |
| 163 | - } |
|
| 164 | - |
|
| 165 | - /** |
|
| 166 | - * Get the today's tip data. |
|
| 167 | - * |
|
| 168 | - * @return array|false The today's tip data or false in case of error. |
|
| 169 | - * @since 3.20.0 |
|
| 170 | - * |
|
| 171 | - */ |
|
| 172 | - private static function get_todays_tip_data() { |
|
| 173 | - |
|
| 174 | - // Return the transient. |
|
| 175 | - if ( false !== get_transient( self::TODAYS_TIP ) ) { |
|
| 176 | - return get_transient( self::TODAYS_TIP ); |
|
| 177 | - } |
|
| 178 | - |
|
| 179 | - // If the transient isn't available, query the remote web site. |
|
| 180 | - $url = WL_TODAYS_TIP_JSON_URL |
|
| 181 | - . ( 'it' === get_bloginfo( 'language' ) ? WL_TODAYS_TIP_JSON_URL_IT : WL_TODAYS_TIP_JSON_URL_EN ); |
|
| 182 | - |
|
| 183 | - $response = wp_remote_get( $url ); |
|
| 184 | - |
|
| 185 | - if ( is_wp_error( $response ) |
|
| 186 | - || ! isset( $response['response']['code'] ) |
|
| 187 | - || 2 !== (int) $response['response']['code'] / 100 ) { |
|
| 188 | - return false; |
|
| 189 | - } |
|
| 190 | - |
|
| 191 | - $json = json_decode( $response['body'], true ); |
|
| 192 | - |
|
| 193 | - if ( empty( $json ) |
|
| 194 | - || ! isset( $json[0]['title']['rendered'] ) |
|
| 195 | - || ! isset( $json[0]['excerpt']['rendered'] ) |
|
| 196 | - || ! isset( $json[0]['link'] ) ) { |
|
| 197 | - return false; |
|
| 198 | - } |
|
| 199 | - |
|
| 200 | - $value = array( |
|
| 201 | - 'title' => $json[0]['title']['rendered'], |
|
| 202 | - 'excerpt' => '<!-- cached -->' . $json[0]['excerpt']['rendered'], |
|
| 203 | - 'link' => $json[0]['link'], |
|
| 204 | - ); |
|
| 205 | - |
|
| 206 | - // Store the results for one day. |
|
| 207 | - set_transient( self::TODAYS_TIP, $value, 86400 ); |
|
| 208 | - |
|
| 209 | - return $value; |
|
| 210 | - } |
|
| 163 | + } |
|
| 164 | + |
|
| 165 | + /** |
|
| 166 | + * Get the today's tip data. |
|
| 167 | + * |
|
| 168 | + * @return array|false The today's tip data or false in case of error. |
|
| 169 | + * @since 3.20.0 |
|
| 170 | + * |
|
| 171 | + */ |
|
| 172 | + private static function get_todays_tip_data() { |
|
| 173 | + |
|
| 174 | + // Return the transient. |
|
| 175 | + if ( false !== get_transient( self::TODAYS_TIP ) ) { |
|
| 176 | + return get_transient( self::TODAYS_TIP ); |
|
| 177 | + } |
|
| 178 | + |
|
| 179 | + // If the transient isn't available, query the remote web site. |
|
| 180 | + $url = WL_TODAYS_TIP_JSON_URL |
|
| 181 | + . ( 'it' === get_bloginfo( 'language' ) ? WL_TODAYS_TIP_JSON_URL_IT : WL_TODAYS_TIP_JSON_URL_EN ); |
|
| 182 | + |
|
| 183 | + $response = wp_remote_get( $url ); |
|
| 184 | + |
|
| 185 | + if ( is_wp_error( $response ) |
|
| 186 | + || ! isset( $response['response']['code'] ) |
|
| 187 | + || 2 !== (int) $response['response']['code'] / 100 ) { |
|
| 188 | + return false; |
|
| 189 | + } |
|
| 190 | + |
|
| 191 | + $json = json_decode( $response['body'], true ); |
|
| 192 | + |
|
| 193 | + if ( empty( $json ) |
|
| 194 | + || ! isset( $json[0]['title']['rendered'] ) |
|
| 195 | + || ! isset( $json[0]['excerpt']['rendered'] ) |
|
| 196 | + || ! isset( $json[0]['link'] ) ) { |
|
| 197 | + return false; |
|
| 198 | + } |
|
| 199 | + |
|
| 200 | + $value = array( |
|
| 201 | + 'title' => $json[0]['title']['rendered'], |
|
| 202 | + 'excerpt' => '<!-- cached -->' . $json[0]['excerpt']['rendered'], |
|
| 203 | + 'link' => $json[0]['link'], |
|
| 204 | + ); |
|
| 205 | + |
|
| 206 | + // Store the results for one day. |
|
| 207 | + set_transient( self::TODAYS_TIP, $value, 86400 ); |
|
| 208 | + |
|
| 209 | + return $value; |
|
| 210 | + } |
|
| 211 | 211 | |
| 212 | 212 | } |
@@ -42,14 +42,14 @@ discard block |
||
| 42 | 42 | * @since 3.20.0 |
| 43 | 43 | * |
| 44 | 44 | */ |
| 45 | - public function __construct( $search_rankings_service, $dashboard_service, $entity_service ) { |
|
| 45 | + public function __construct($search_rankings_service, $dashboard_service, $entity_service) { |
|
| 46 | 46 | |
| 47 | - add_action( 'wp_dashboard_setup', array( $this, 'dashboard_setup' ) ); |
|
| 47 | + add_action('wp_dashboard_setup', array($this, 'dashboard_setup')); |
|
| 48 | 48 | |
| 49 | 49 | // Define where to access the tip. |
| 50 | - defined( 'WL_TODAYS_TIP_JSON_URL' ) || define( 'WL_TODAYS_TIP_JSON_URL', 'https://wordlift.io/blog' ); |
|
| 51 | - defined( 'WL_TODAYS_TIP_JSON_URL_IT' ) || define( 'WL_TODAYS_TIP_JSON_URL_IT', '/it/wp-json/wp/v2/posts?context=embed&per_page=1&categories=27' ); |
|
| 52 | - defined( 'WL_TODAYS_TIP_JSON_URL_EN' ) || define( 'WL_TODAYS_TIP_JSON_URL_EN', '/en/wp-json/wp/v2/posts?context=embed&per_page=1&categories=38' ); |
|
| 50 | + defined('WL_TODAYS_TIP_JSON_URL') || define('WL_TODAYS_TIP_JSON_URL', 'https://wordlift.io/blog'); |
|
| 51 | + defined('WL_TODAYS_TIP_JSON_URL_IT') || define('WL_TODAYS_TIP_JSON_URL_IT', '/it/wp-json/wp/v2/posts?context=embed&per_page=1&categories=27'); |
|
| 52 | + defined('WL_TODAYS_TIP_JSON_URL_EN') || define('WL_TODAYS_TIP_JSON_URL_EN', '/en/wp-json/wp/v2/posts?context=embed&per_page=1&categories=38'); |
|
| 53 | 53 | |
| 54 | 54 | $this->search_rankings_service = $search_rankings_service; |
| 55 | 55 | $this->dashboard_service = $dashboard_service; |
@@ -66,8 +66,8 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | wp_add_dashboard_widget( |
| 68 | 68 | 'wl-dashboard-v2', |
| 69 | - __( 'WordLift Dashboard', 'wordlift' ), |
|
| 70 | - array( $this, 'dashboard_setup_callback' ) |
|
| 69 | + __('WordLift Dashboard', 'wordlift'), |
|
| 70 | + array($this, 'dashboard_setup_callback') |
|
| 71 | 71 | ); |
| 72 | 72 | |
| 73 | 73 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | // Get the average position. |
| 83 | 83 | $average_position_string = $this->get_average_position(); |
| 84 | 84 | |
| 85 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/partials/wordlift-admin-dashboard-v2.php'; |
|
| 85 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/partials/wordlift-admin-dashboard-v2.php'; |
|
| 86 | 86 | |
| 87 | 87 | } |
| 88 | 88 | |
@@ -96,24 +96,24 @@ discard block |
||
| 96 | 96 | private function get_average_position() { |
| 97 | 97 | |
| 98 | 98 | // Get the cache value. |
| 99 | - $average_position = get_transient( self::AVERAGE_POSITION ); |
|
| 99 | + $average_position = get_transient(self::AVERAGE_POSITION); |
|
| 100 | 100 | |
| 101 | 101 | // If there's no cached value, load it. |
| 102 | - if ( false === $average_position ) { |
|
| 102 | + if (false === $average_position) { |
|
| 103 | 103 | // Get the average position from Search Ranking Service. |
| 104 | 104 | $average_position = @$this->search_rankings_service->get_average_position(); |
| 105 | 105 | |
| 106 | 106 | // If there was an error return 'n/a'. |
| 107 | - if ( false === $average_position ) { |
|
| 108 | - return esc_html( _x( 'n/a', 'Dashboard', 'wordlift' ) ); |
|
| 107 | + if (false === $average_position) { |
|
| 108 | + return esc_html(_x('n/a', 'Dashboard', 'wordlift')); |
|
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | // Store the value for one day. |
| 113 | - set_transient( self::AVERAGE_POSITION, $average_position, 86400 ); // One day. |
|
| 113 | + set_transient(self::AVERAGE_POSITION, $average_position, 86400); // One day. |
|
| 114 | 114 | |
| 115 | 115 | // Format the average position with one decimal. |
| 116 | - return number_format( $average_position, 1 ); |
|
| 116 | + return number_format($average_position, 1); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
| 130 | 130 | * Top entities are generated by cron now. |
| 131 | 131 | */ |
| 132 | - return get_option( Top_Entities::OPTION_KEY, array() ); |
|
| 132 | + return get_option(Top_Entities::OPTION_KEY, array()); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | /** |
@@ -142,20 +142,20 @@ discard block |
||
| 142 | 142 | $data = @self::get_todays_tip_data(); |
| 143 | 143 | |
| 144 | 144 | // Unable to get data from the local cache, nor from the remote URL. |
| 145 | - if ( false === $data ) { |
|
| 145 | + if (false === $data) { |
|
| 146 | 146 | return; |
| 147 | 147 | } |
| 148 | 148 | ?> |
| 149 | 149 | |
| 150 | 150 | <div id="wl-todays-tip" class="wl-dashboard__block wl-dashboard__block--todays-tip"> |
| 151 | 151 | <header> |
| 152 | - <h3><?php echo __( "Today's Tip", 'wordlift' ); ?></h3> |
|
| 152 | + <h3><?php echo __("Today's Tip", 'wordlift'); ?></h3> |
|
| 153 | 153 | </header> |
| 154 | 154 | <article> |
| 155 | - <p><strong><?php echo esc_html( wp_strip_all_tags( $data['title'] ) ); ?></strong> |
|
| 156 | - <?php echo esc_html( wp_strip_all_tags( $data['excerpt'] ) ); ?> |
|
| 155 | + <p><strong><?php echo esc_html(wp_strip_all_tags($data['title'])); ?></strong> |
|
| 156 | + <?php echo esc_html(wp_strip_all_tags($data['excerpt'])); ?> |
|
| 157 | 157 | <a target="_blank" |
| 158 | - href="<?php echo esc_attr( $data['link'] ); ?>"><?php echo esc_html( __( 'Read more', 'wordlift' ) ); ?></a> |
|
| 158 | + href="<?php echo esc_attr($data['link']); ?>"><?php echo esc_html(__('Read more', 'wordlift')); ?></a> |
|
| 159 | 159 | </p> |
| 160 | 160 | </div> |
| 161 | 161 | <?php |
@@ -172,39 +172,39 @@ discard block |
||
| 172 | 172 | private static function get_todays_tip_data() { |
| 173 | 173 | |
| 174 | 174 | // Return the transient. |
| 175 | - if ( false !== get_transient( self::TODAYS_TIP ) ) { |
|
| 176 | - return get_transient( self::TODAYS_TIP ); |
|
| 175 | + if (false !== get_transient(self::TODAYS_TIP)) { |
|
| 176 | + return get_transient(self::TODAYS_TIP); |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | // If the transient isn't available, query the remote web site. |
| 180 | 180 | $url = WL_TODAYS_TIP_JSON_URL |
| 181 | - . ( 'it' === get_bloginfo( 'language' ) ? WL_TODAYS_TIP_JSON_URL_IT : WL_TODAYS_TIP_JSON_URL_EN ); |
|
| 181 | + . ('it' === get_bloginfo('language') ? WL_TODAYS_TIP_JSON_URL_IT : WL_TODAYS_TIP_JSON_URL_EN); |
|
| 182 | 182 | |
| 183 | - $response = wp_remote_get( $url ); |
|
| 183 | + $response = wp_remote_get($url); |
|
| 184 | 184 | |
| 185 | - if ( is_wp_error( $response ) |
|
| 186 | - || ! isset( $response['response']['code'] ) |
|
| 187 | - || 2 !== (int) $response['response']['code'] / 100 ) { |
|
| 185 | + if (is_wp_error($response) |
|
| 186 | + || ! isset($response['response']['code']) |
|
| 187 | + || 2 !== (int) $response['response']['code'] / 100) { |
|
| 188 | 188 | return false; |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | - $json = json_decode( $response['body'], true ); |
|
| 191 | + $json = json_decode($response['body'], true); |
|
| 192 | 192 | |
| 193 | - if ( empty( $json ) |
|
| 194 | - || ! isset( $json[0]['title']['rendered'] ) |
|
| 195 | - || ! isset( $json[0]['excerpt']['rendered'] ) |
|
| 196 | - || ! isset( $json[0]['link'] ) ) { |
|
| 193 | + if (empty($json) |
|
| 194 | + || ! isset($json[0]['title']['rendered']) |
|
| 195 | + || ! isset($json[0]['excerpt']['rendered']) |
|
| 196 | + || ! isset($json[0]['link'])) { |
|
| 197 | 197 | return false; |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | $value = array( |
| 201 | 201 | 'title' => $json[0]['title']['rendered'], |
| 202 | - 'excerpt' => '<!-- cached -->' . $json[0]['excerpt']['rendered'], |
|
| 202 | + 'excerpt' => '<!-- cached -->'.$json[0]['excerpt']['rendered'], |
|
| 203 | 203 | 'link' => $json[0]['link'], |
| 204 | 204 | ); |
| 205 | 205 | |
| 206 | 206 | // Store the results for one day. |
| 207 | - set_transient( self::TODAYS_TIP, $value, 86400 ); |
|
| 207 | + set_transient(self::TODAYS_TIP, $value, 86400); |
|
| 208 | 208 | |
| 209 | 209 | return $value; |
| 210 | 210 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | // If this file is called directly, abort. |
| 51 | 51 | if ( ! defined( 'WPINC' ) ) { |
| 52 | - die; |
|
| 52 | + die; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php'; |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | function wl_write_log( $log ) { |
| 74 | 74 | |
| 75 | - Wordlift_Log_Service::get_instance()->debug( $log ); |
|
| 75 | + Wordlift_Log_Service::get_instance()->debug( $log ); |
|
| 76 | 76 | |
| 77 | 77 | } |
| 78 | 78 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | function wl_write_log_hide_key( $text ) { |
| 91 | 91 | |
| 92 | - return str_ireplace( wl_configuration_get_key(), '<hidden>', $text ); |
|
| 92 | + return str_ireplace( wl_configuration_get_key(), '<hidden>', $text ); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
@@ -97,21 +97,21 @@ discard block |
||
| 97 | 97 | * see http://vip.wordpress.com/documentation/register-additional-html-attributes-for-tinymce-and-wp-kses/ |
| 98 | 98 | */ |
| 99 | 99 | function wordlift_allowed_post_tags() { |
| 100 | - global $allowedposttags; |
|
| 101 | - |
|
| 102 | - $tags = array( 'span' ); |
|
| 103 | - $new_attributes = array( |
|
| 104 | - 'itemscope' => array(), |
|
| 105 | - 'itemtype' => array(), |
|
| 106 | - 'itemprop' => array(), |
|
| 107 | - 'itemid' => array(), |
|
| 108 | - ); |
|
| 109 | - |
|
| 110 | - foreach ( $tags as $tag ) { |
|
| 111 | - if ( isset( $allowedposttags[ $tag ] ) && is_array( $allowedposttags[ $tag ] ) ) { |
|
| 112 | - $allowedposttags[ $tag ] = array_merge( $allowedposttags[ $tag ], $new_attributes ); |
|
| 113 | - } |
|
| 114 | - } |
|
| 100 | + global $allowedposttags; |
|
| 101 | + |
|
| 102 | + $tags = array( 'span' ); |
|
| 103 | + $new_attributes = array( |
|
| 104 | + 'itemscope' => array(), |
|
| 105 | + 'itemtype' => array(), |
|
| 106 | + 'itemprop' => array(), |
|
| 107 | + 'itemid' => array(), |
|
| 108 | + ); |
|
| 109 | + |
|
| 110 | + foreach ( $tags as $tag ) { |
|
| 111 | + if ( isset( $allowedposttags[ $tag ] ) && is_array( $allowedposttags[ $tag ] ) ) { |
|
| 112 | + $allowedposttags[ $tag ] = array_merge( $allowedposttags[ $tag ], $new_attributes ); |
|
| 113 | + } |
|
| 114 | + } |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | // add allowed post tags. |
@@ -122,18 +122,18 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | function wordlift_admin_enqueue_scripts() { |
| 124 | 124 | |
| 125 | - // Added for compatibility with WordPress 3.9 (see http://make.wordpress.org/core/2014/04/16/jquery-ui-and-wpdialogs-in-wordpress-3-9/) |
|
| 126 | - wp_enqueue_script( 'wpdialogs' ); |
|
| 127 | - wp_enqueue_style( 'wp-jquery-ui-dialog' ); |
|
| 125 | + // Added for compatibility with WordPress 3.9 (see http://make.wordpress.org/core/2014/04/16/jquery-ui-and-wpdialogs-in-wordpress-3-9/) |
|
| 126 | + wp_enqueue_script( 'wpdialogs' ); |
|
| 127 | + wp_enqueue_style( 'wp-jquery-ui-dialog' ); |
|
| 128 | 128 | |
| 129 | - wp_enqueue_style( 'wordlift-reloaded', plugin_dir_url( __FILE__ ) . 'css/wordlift-reloaded.min.css' ); |
|
| 129 | + wp_enqueue_style( 'wordlift-reloaded', plugin_dir_url( __FILE__ ) . 'css/wordlift-reloaded.min.css' ); |
|
| 130 | 130 | |
| 131 | - wp_enqueue_script( 'jquery-ui-autocomplete' ); |
|
| 131 | + wp_enqueue_script( 'jquery-ui-autocomplete' ); |
|
| 132 | 132 | |
| 133 | - // Disable auto-save for custom entity posts only |
|
| 134 | - if ( Wordlift_Entity_Service::TYPE_NAME === get_post_type() ) { |
|
| 135 | - wp_dequeue_script( 'autosave' ); |
|
| 136 | - } |
|
| 133 | + // Disable auto-save for custom entity posts only |
|
| 134 | + if ( Wordlift_Entity_Service::TYPE_NAME === get_post_type() ) { |
|
| 135 | + wp_dequeue_script( 'autosave' ); |
|
| 136 | + } |
|
| 137 | 137 | |
| 138 | 138 | } |
| 139 | 139 | |
@@ -149,18 +149,18 @@ discard block |
||
| 149 | 149 | */ |
| 150 | 150 | function wordlift_allowed_html( $allowedtags, $context ) { |
| 151 | 151 | |
| 152 | - if ( 'post' !== $context ) { |
|
| 153 | - return $allowedtags; |
|
| 154 | - } |
|
| 155 | - |
|
| 156 | - return array_merge_recursive( $allowedtags, array( |
|
| 157 | - 'span' => array( |
|
| 158 | - 'itemscope' => true, |
|
| 159 | - 'itemtype' => true, |
|
| 160 | - 'itemid' => true, |
|
| 161 | - 'itemprop' => true, |
|
| 162 | - ), |
|
| 163 | - ) ); |
|
| 152 | + if ( 'post' !== $context ) { |
|
| 153 | + return $allowedtags; |
|
| 154 | + } |
|
| 155 | + |
|
| 156 | + return array_merge_recursive( $allowedtags, array( |
|
| 157 | + 'span' => array( |
|
| 158 | + 'itemscope' => true, |
|
| 159 | + 'itemtype' => true, |
|
| 160 | + 'itemid' => true, |
|
| 161 | + 'itemprop' => true, |
|
| 162 | + ), |
|
| 163 | + ) ); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | add_filter( 'wp_kses_allowed_html', 'wordlift_allowed_html', 10, 2 ); |
@@ -174,16 +174,16 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | function wl_get_coordinates( $post_id ) { |
| 176 | 176 | |
| 177 | - $latitude = wl_schema_get_value( $post_id, 'latitude' ); |
|
| 178 | - $longitude = wl_schema_get_value( $post_id, 'longitude' ); |
|
| 177 | + $latitude = wl_schema_get_value( $post_id, 'latitude' ); |
|
| 178 | + $longitude = wl_schema_get_value( $post_id, 'longitude' ); |
|
| 179 | 179 | |
| 180 | - // DO NOT set latitude/longitude to 0/0 as default values. It's a specific |
|
| 181 | - // place on the globe:"The zero/zero point of this system is located in the |
|
| 182 | - // Gulf of Guinea about 625 km (390 mi) south of Tema, Ghana." |
|
| 183 | - return array( |
|
| 184 | - 'latitude' => isset( $latitude[0] ) && is_numeric( $latitude[0] ) ? $latitude[0] : '', |
|
| 185 | - 'longitude' => isset( $longitude[0] ) && is_numeric( $longitude[0] ) ? $longitude[0] : '', |
|
| 186 | - ); |
|
| 180 | + // DO NOT set latitude/longitude to 0/0 as default values. It's a specific |
|
| 181 | + // place on the globe:"The zero/zero point of this system is located in the |
|
| 182 | + // Gulf of Guinea about 625 km (390 mi) south of Tema, Ghana." |
|
| 183 | + return array( |
|
| 184 | + 'latitude' => isset( $latitude[0] ) && is_numeric( $latitude[0] ) ? $latitude[0] : '', |
|
| 185 | + 'longitude' => isset( $longitude[0] ) && is_numeric( $longitude[0] ) ? $longitude[0] : '', |
|
| 186 | + ); |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /** |
@@ -197,9 +197,9 @@ discard block |
||
| 197 | 197 | */ |
| 198 | 198 | function wl_get_image_urls( $post_id ) { |
| 199 | 199 | |
| 200 | - return Wordlift_Storage_Factory::get_instance() |
|
| 201 | - ->post_images() |
|
| 202 | - ->get( $post_id ); |
|
| 200 | + return Wordlift_Storage_Factory::get_instance() |
|
| 201 | + ->post_images() |
|
| 202 | + ->get( $post_id ); |
|
| 203 | 203 | |
| 204 | 204 | } |
| 205 | 205 | |
@@ -213,24 +213,24 @@ discard block |
||
| 213 | 213 | */ |
| 214 | 214 | function wl_get_attachment_for_source_url( $parent_post_id, $source_url ) { |
| 215 | 215 | |
| 216 | - // wl_write_log( "wl_get_attachment_for_source_url [ parent post id :: $parent_post_id ][ source url :: $source_url ]" ); |
|
| 216 | + // wl_write_log( "wl_get_attachment_for_source_url [ parent post id :: $parent_post_id ][ source url :: $source_url ]" ); |
|
| 217 | 217 | |
| 218 | - $posts = get_posts( array( |
|
| 219 | - 'post_type' => 'attachment', |
|
| 220 | - 'posts_per_page' => 1, |
|
| 221 | - 'post_status' => 'any', |
|
| 222 | - 'post_parent' => $parent_post_id, |
|
| 223 | - 'meta_key' => 'wl_source_url', |
|
| 224 | - 'meta_value' => $source_url, |
|
| 225 | - ) ); |
|
| 218 | + $posts = get_posts( array( |
|
| 219 | + 'post_type' => 'attachment', |
|
| 220 | + 'posts_per_page' => 1, |
|
| 221 | + 'post_status' => 'any', |
|
| 222 | + 'post_parent' => $parent_post_id, |
|
| 223 | + 'meta_key' => 'wl_source_url', |
|
| 224 | + 'meta_value' => $source_url, |
|
| 225 | + ) ); |
|
| 226 | 226 | |
| 227 | - // Return the found post. |
|
| 228 | - if ( 1 === count( $posts ) ) { |
|
| 229 | - return $posts[0]; |
|
| 230 | - } |
|
| 227 | + // Return the found post. |
|
| 228 | + if ( 1 === count( $posts ) ) { |
|
| 229 | + return $posts[0]; |
|
| 230 | + } |
|
| 231 | 231 | |
| 232 | - // Return null. |
|
| 233 | - return null; |
|
| 232 | + // Return null. |
|
| 233 | + return null; |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | /** |
@@ -241,8 +241,8 @@ discard block |
||
| 241 | 241 | */ |
| 242 | 242 | function wl_set_source_url( $post_id, $source_url ) { |
| 243 | 243 | |
| 244 | - delete_post_meta( $post_id, 'wl_source_url' ); |
|
| 245 | - add_post_meta( $post_id, 'wl_source_url', $source_url ); |
|
| 244 | + delete_post_meta( $post_id, 'wl_source_url' ); |
|
| 245 | + add_post_meta( $post_id, 'wl_source_url', $source_url ); |
|
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | /** |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | */ |
| 260 | 260 | function wl_sanitize_uri_path( $path, $char = '_' ) { |
| 261 | 261 | |
| 262 | - return Wordlift_Uri_Service::get_instance()->sanitize_path( $path, $char ); |
|
| 262 | + return Wordlift_Uri_Service::get_instance()->sanitize_path( $path, $char ); |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | /** |
@@ -271,47 +271,47 @@ discard block |
||
| 271 | 271 | */ |
| 272 | 272 | function wl_replace_item_id_with_uri( $content ) { |
| 273 | 273 | |
| 274 | - $log = Wordlift_Log_Service::get_logger( 'wl_replace_item_id_with_uri' ); |
|
| 275 | - $log->trace( 'Replacing item IDs with URIs...' ); |
|
| 274 | + $log = Wordlift_Log_Service::get_logger( 'wl_replace_item_id_with_uri' ); |
|
| 275 | + $log->trace( 'Replacing item IDs with URIs...' ); |
|
| 276 | 276 | |
| 277 | - // Strip slashes, see https://core.trac.wordpress.org/ticket/21767 |
|
| 278 | - $content = stripslashes( $content ); |
|
| 277 | + // Strip slashes, see https://core.trac.wordpress.org/ticket/21767 |
|
| 278 | + $content = stripslashes( $content ); |
|
| 279 | 279 | |
| 280 | - // If any match are found. |
|
| 281 | - $matches = array(); |
|
| 282 | - if ( 0 < preg_match_all( '/ itemid="([^"]+)"/i', $content, $matches, PREG_SET_ORDER ) ) { |
|
| 280 | + // If any match are found. |
|
| 281 | + $matches = array(); |
|
| 282 | + if ( 0 < preg_match_all( '/ itemid="([^"]+)"/i', $content, $matches, PREG_SET_ORDER ) ) { |
|
| 283 | 283 | |
| 284 | - foreach ( $matches as $match ) { |
|
| 284 | + foreach ( $matches as $match ) { |
|
| 285 | 285 | |
| 286 | - // Get the item ID. |
|
| 287 | - $item_id = $match[1]; |
|
| 286 | + // Get the item ID. |
|
| 287 | + $item_id = $match[1]; |
|
| 288 | 288 | |
| 289 | - // Get the post bound to that item ID (looking both in the 'official' URI and in the 'same-as' . |
|
| 290 | - $post = Wordlift_Entity_Service::get_instance() |
|
| 291 | - ->get_entity_post_by_uri( $item_id ); |
|
| 289 | + // Get the post bound to that item ID (looking both in the 'official' URI and in the 'same-as' . |
|
| 290 | + $post = Wordlift_Entity_Service::get_instance() |
|
| 291 | + ->get_entity_post_by_uri( $item_id ); |
|
| 292 | 292 | |
| 293 | - // If no entity is found, continue to the next one. |
|
| 294 | - if ( null === $post ) { |
|
| 295 | - continue; |
|
| 296 | - } |
|
| 293 | + // If no entity is found, continue to the next one. |
|
| 294 | + if ( null === $post ) { |
|
| 295 | + continue; |
|
| 296 | + } |
|
| 297 | 297 | |
| 298 | - // Get the URI for that post. |
|
| 299 | - $uri = wl_get_entity_uri( $post->ID ); |
|
| 298 | + // Get the URI for that post. |
|
| 299 | + $uri = wl_get_entity_uri( $post->ID ); |
|
| 300 | 300 | |
| 301 | - // wl_write_log( "wl_replace_item_id_with_uri [ item id :: $item_id ][ uri :: $uri ]" ); |
|
| 301 | + // wl_write_log( "wl_replace_item_id_with_uri [ item id :: $item_id ][ uri :: $uri ]" ); |
|
| 302 | 302 | |
| 303 | - // If the item ID and the URI differ, replace the item ID with the URI saved in WordPress. |
|
| 304 | - if ( $item_id !== $uri ) { |
|
| 305 | - $uri_e = esc_html( $uri ); |
|
| 306 | - $content = str_replace( " itemid=\"$item_id\"", " itemid=\"$uri_e\"", $content ); |
|
| 307 | - } |
|
| 308 | - } |
|
| 309 | - } |
|
| 303 | + // If the item ID and the URI differ, replace the item ID with the URI saved in WordPress. |
|
| 304 | + if ( $item_id !== $uri ) { |
|
| 305 | + $uri_e = esc_html( $uri ); |
|
| 306 | + $content = str_replace( " itemid=\"$item_id\"", " itemid=\"$uri_e\"", $content ); |
|
| 307 | + } |
|
| 308 | + } |
|
| 309 | + } |
|
| 310 | 310 | |
| 311 | - // Reapply slashes. |
|
| 312 | - $content = addslashes( $content ); |
|
| 311 | + // Reapply slashes. |
|
| 312 | + $content = addslashes( $content ); |
|
| 313 | 313 | |
| 314 | - return $content; |
|
| 314 | + return $content; |
|
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | add_filter( 'content_save_pre', 'wl_replace_item_id_with_uri', 1, 1 ); |
@@ -374,29 +374,29 @@ discard block |
||
| 374 | 374 | */ |
| 375 | 375 | function activate_wordlift() { |
| 376 | 376 | |
| 377 | - $log = Wordlift_Log_Service::get_logger( 'activate_wordlift' ); |
|
| 378 | - |
|
| 379 | - $log->info( 'Activating WordLift...' ); |
|
| 380 | - |
|
| 381 | - require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-activator.php'; |
|
| 382 | - Wordlift_Activator::activate(); |
|
| 383 | - |
|
| 384 | - /** |
|
| 385 | - * Tell the {@link Wordlift_Http_Api} class that we're activating, to let it run activation tasks. |
|
| 386 | - * |
|
| 387 | - * @see https://github.com/insideout10/wordlift-plugin/issues/820 related issue. |
|
| 388 | - * @since 3.19.2 |
|
| 389 | - */ |
|
| 390 | - Wordlift_Http_Api::activate(); |
|
| 391 | - |
|
| 392 | - // Ensure the post type is registered before flushing the rewrite rules. |
|
| 393 | - Wordlift_Entity_Post_Type_Service::get_instance()->register(); |
|
| 394 | - flush_rewrite_rules(); |
|
| 395 | - /** |
|
| 396 | - * @since 3.27.7 |
|
| 397 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
| 398 | - */ |
|
| 399 | - Top_Entities::activate(); |
|
| 377 | + $log = Wordlift_Log_Service::get_logger( 'activate_wordlift' ); |
|
| 378 | + |
|
| 379 | + $log->info( 'Activating WordLift...' ); |
|
| 380 | + |
|
| 381 | + require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-activator.php'; |
|
| 382 | + Wordlift_Activator::activate(); |
|
| 383 | + |
|
| 384 | + /** |
|
| 385 | + * Tell the {@link Wordlift_Http_Api} class that we're activating, to let it run activation tasks. |
|
| 386 | + * |
|
| 387 | + * @see https://github.com/insideout10/wordlift-plugin/issues/820 related issue. |
|
| 388 | + * @since 3.19.2 |
|
| 389 | + */ |
|
| 390 | + Wordlift_Http_Api::activate(); |
|
| 391 | + |
|
| 392 | + // Ensure the post type is registered before flushing the rewrite rules. |
|
| 393 | + Wordlift_Entity_Post_Type_Service::get_instance()->register(); |
|
| 394 | + flush_rewrite_rules(); |
|
| 395 | + /** |
|
| 396 | + * @since 3.27.7 |
|
| 397 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
| 398 | + */ |
|
| 399 | + Top_Entities::activate(); |
|
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | /** |
@@ -405,16 +405,16 @@ discard block |
||
| 405 | 405 | */ |
| 406 | 406 | function deactivate_wordlift() { |
| 407 | 407 | |
| 408 | - require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-deactivator.php'; |
|
| 409 | - Wordlift_Deactivator::deactivate(); |
|
| 410 | - Wordlift_Http_Api::deactivate(); |
|
| 411 | - Ttl_Cache_Cleaner::deactivate(); |
|
| 412 | - /** |
|
| 413 | - * @since 3.27.7 |
|
| 414 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
| 415 | - */ |
|
| 416 | - Top_Entities::deactivate(); |
|
| 417 | - flush_rewrite_rules(); |
|
| 408 | + require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-deactivator.php'; |
|
| 409 | + Wordlift_Deactivator::deactivate(); |
|
| 410 | + Wordlift_Http_Api::deactivate(); |
|
| 411 | + Ttl_Cache_Cleaner::deactivate(); |
|
| 412 | + /** |
|
| 413 | + * @since 3.27.7 |
|
| 414 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
| 415 | + */ |
|
| 416 | + Top_Entities::deactivate(); |
|
| 417 | + flush_rewrite_rules(); |
|
| 418 | 418 | |
| 419 | 419 | } |
| 420 | 420 | |
@@ -437,98 +437,98 @@ discard block |
||
| 437 | 437 | * @since 1.0.0 |
| 438 | 438 | */ |
| 439 | 439 | function run_wordlift() { |
| 440 | - /** |
|
| 441 | - * Filter: wl_feature__enable__widgets. |
|
| 442 | - * |
|
| 443 | - * @param bool whether the widgets needed to be registered, defaults to true. |
|
| 444 | - * |
|
| 445 | - * @return bool |
|
| 446 | - * @since 3.27.6 |
|
| 447 | - */ |
|
| 448 | - if ( apply_filters( 'wl_feature__enable__widgets', true ) ) { |
|
| 449 | - add_action( 'widgets_init', 'wl_register_chord_widget' ); |
|
| 450 | - add_action( 'widgets_init', 'wl_register_geo_widget' ); |
|
| 451 | - add_action( 'widgets_init', 'wl_register_timeline_widget' ); |
|
| 452 | - } |
|
| 453 | - add_filter( 'widget_text', 'do_shortcode' ); |
|
| 454 | - |
|
| 455 | - |
|
| 456 | - /** |
|
| 457 | - * Filter: wl_feature__enable__analysis |
|
| 458 | - * |
|
| 459 | - * @param bool Whether to send api request to analysis or not |
|
| 460 | - * |
|
| 461 | - * @return bool |
|
| 462 | - * @since 3.27.6 |
|
| 463 | - */ |
|
| 464 | - if ( apply_filters( 'wl_feature__enable__analysis', true ) ) { |
|
| 465 | - add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_action' ); |
|
| 466 | - } else { |
|
| 467 | - add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_disabled_action' ); |
|
| 468 | - } |
|
| 469 | - |
|
| 470 | - /* |
|
| 440 | + /** |
|
| 441 | + * Filter: wl_feature__enable__widgets. |
|
| 442 | + * |
|
| 443 | + * @param bool whether the widgets needed to be registered, defaults to true. |
|
| 444 | + * |
|
| 445 | + * @return bool |
|
| 446 | + * @since 3.27.6 |
|
| 447 | + */ |
|
| 448 | + if ( apply_filters( 'wl_feature__enable__widgets', true ) ) { |
|
| 449 | + add_action( 'widgets_init', 'wl_register_chord_widget' ); |
|
| 450 | + add_action( 'widgets_init', 'wl_register_geo_widget' ); |
|
| 451 | + add_action( 'widgets_init', 'wl_register_timeline_widget' ); |
|
| 452 | + } |
|
| 453 | + add_filter( 'widget_text', 'do_shortcode' ); |
|
| 454 | + |
|
| 455 | + |
|
| 456 | + /** |
|
| 457 | + * Filter: wl_feature__enable__analysis |
|
| 458 | + * |
|
| 459 | + * @param bool Whether to send api request to analysis or not |
|
| 460 | + * |
|
| 461 | + * @return bool |
|
| 462 | + * @since 3.27.6 |
|
| 463 | + */ |
|
| 464 | + if ( apply_filters( 'wl_feature__enable__analysis', true ) ) { |
|
| 465 | + add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_action' ); |
|
| 466 | + } else { |
|
| 467 | + add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_disabled_action' ); |
|
| 468 | + } |
|
| 469 | + |
|
| 470 | + /* |
|
| 471 | 471 | * We introduce the WordLift autoloader, since we start using classes in namespaces, i.e. Wordlift\Http. |
| 472 | 472 | * |
| 473 | 473 | * @since 3.21.2 |
| 474 | 474 | */ |
| 475 | - wordlift_plugin_autoload_register(); |
|
| 475 | + wordlift_plugin_autoload_register(); |
|
| 476 | 476 | |
| 477 | - $plugin = new Wordlift(); |
|
| 478 | - $plugin->run(); |
|
| 477 | + $plugin = new Wordlift(); |
|
| 478 | + $plugin->run(); |
|
| 479 | 479 | |
| 480 | - // Initialize the TTL Cache Cleaner. |
|
| 481 | - new Ttl_Cache_Cleaner(); |
|
| 480 | + // Initialize the TTL Cache Cleaner. |
|
| 481 | + new Ttl_Cache_Cleaner(); |
|
| 482 | 482 | |
| 483 | - // Load the new Post Adapter. |
|
| 484 | - new Post_Adapter(); |
|
| 483 | + // Load the new Post Adapter. |
|
| 484 | + new Post_Adapter(); |
|
| 485 | 485 | |
| 486 | - // Load the API Data Hooks. |
|
| 487 | - new Api_Data_Hooks(); |
|
| 486 | + // Load the API Data Hooks. |
|
| 487 | + new Api_Data_Hooks(); |
|
| 488 | 488 | |
| 489 | - add_action( 'plugins_loaded', function () use ( $plugin ) { |
|
| 490 | - // Load early. **PLEASE NOTE** that features are applied only to calls that happen **AFTER** the `plugins_loaded` |
|
| 491 | - // action. |
|
| 492 | - require_once plugin_dir_path( __FILE__ ) . 'wordlift/features/index.php'; |
|
| 489 | + add_action( 'plugins_loaded', function () use ( $plugin ) { |
|
| 490 | + // Load early. **PLEASE NOTE** that features are applied only to calls that happen **AFTER** the `plugins_loaded` |
|
| 491 | + // action. |
|
| 492 | + require_once plugin_dir_path( __FILE__ ) . 'wordlift/features/index.php'; |
|
| 493 | 493 | |
| 494 | - // Licenses Images. |
|
| 495 | - $user_agent = User_Agent::get_user_agent(); |
|
| 496 | - $wordlift_key = Wordlift_Configuration_Service::get_instance()->get_key(); |
|
| 497 | - $api_service = new Default_Api_Service( apply_filters( 'wl_api_base_url', WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE ), 60, $user_agent, $wordlift_key ); |
|
| 498 | - $image_license_factory = new Image_License_Factory(); |
|
| 499 | - $image_license_service = new Image_License_Service( $api_service, $image_license_factory ); |
|
| 500 | - $image_license_cache = new Ttl_Cache( 'image-license', 86400 * 30 ); // 30 days. |
|
| 501 | - $cached_image_license_service = new Cached_Image_License_Service( $image_license_service, $image_license_cache ); |
|
| 494 | + // Licenses Images. |
|
| 495 | + $user_agent = User_Agent::get_user_agent(); |
|
| 496 | + $wordlift_key = Wordlift_Configuration_Service::get_instance()->get_key(); |
|
| 497 | + $api_service = new Default_Api_Service( apply_filters( 'wl_api_base_url', WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE ), 60, $user_agent, $wordlift_key ); |
|
| 498 | + $image_license_factory = new Image_License_Factory(); |
|
| 499 | + $image_license_service = new Image_License_Service( $api_service, $image_license_factory ); |
|
| 500 | + $image_license_cache = new Ttl_Cache( 'image-license', 86400 * 30 ); // 30 days. |
|
| 501 | + $cached_image_license_service = new Cached_Image_License_Service( $image_license_service, $image_license_cache ); |
|
| 502 | 502 | |
| 503 | - $image_license_scheduler = new Image_License_Scheduler( $image_license_service, $image_license_cache ); |
|
| 504 | - $image_license_cleanup_service = new Image_License_Cleanup_Service(); |
|
| 503 | + $image_license_scheduler = new Image_License_Scheduler( $image_license_service, $image_license_cache ); |
|
| 504 | + $image_license_cleanup_service = new Image_License_Cleanup_Service(); |
|
| 505 | 505 | |
| 506 | - // Get the cached data. If we have cached data, we load the notifier. |
|
| 507 | - $image_license_data = $image_license_cache->get( Cached_Image_License_Service::GET_NON_PUBLIC_DOMAIN_IMAGES ); |
|
| 508 | - if ( null !== $image_license_data ) { |
|
| 509 | - $image_license_page = new Image_License_Page( $image_license_data, Wordlift::get_instance()->get_version() ); |
|
| 510 | - new Image_License_Notifier( $image_license_data, $image_license_page ); |
|
| 511 | - } |
|
| 506 | + // Get the cached data. If we have cached data, we load the notifier. |
|
| 507 | + $image_license_data = $image_license_cache->get( Cached_Image_License_Service::GET_NON_PUBLIC_DOMAIN_IMAGES ); |
|
| 508 | + if ( null !== $image_license_data ) { |
|
| 509 | + $image_license_page = new Image_License_Page( $image_license_data, Wordlift::get_instance()->get_version() ); |
|
| 510 | + new Image_License_Notifier( $image_license_data, $image_license_page ); |
|
| 511 | + } |
|
| 512 | 512 | |
| 513 | - $remove_all_images_task = new Remove_All_Images_Task( $cached_image_license_service ); |
|
| 514 | - $remove_all_images_task_adapter = new Task_Ajax_Adapter( $remove_all_images_task ); |
|
| 513 | + $remove_all_images_task = new Remove_All_Images_Task( $cached_image_license_service ); |
|
| 514 | + $remove_all_images_task_adapter = new Task_Ajax_Adapter( $remove_all_images_task ); |
|
| 515 | 515 | |
| 516 | - $reload_data_task = new Reload_Data_Task(); |
|
| 517 | - $reload_data_task_adapter = new Task_Ajax_Adapter( $reload_data_task ); |
|
| 516 | + $reload_data_task = new Reload_Data_Task(); |
|
| 517 | + $reload_data_task_adapter = new Task_Ajax_Adapter( $reload_data_task ); |
|
| 518 | 518 | |
| 519 | - $add_license_caption_or_remove_task = new Add_License_Caption_Or_Remove_Task( $cached_image_license_service ); |
|
| 520 | - $add_license_caption_or_remove_task_adapter = new Task_Ajax_Adapter( $add_license_caption_or_remove_task ); |
|
| 519 | + $add_license_caption_or_remove_task = new Add_License_Caption_Or_Remove_Task( $cached_image_license_service ); |
|
| 520 | + $add_license_caption_or_remove_task_adapter = new Task_Ajax_Adapter( $add_license_caption_or_remove_task ); |
|
| 521 | 521 | |
| 522 | - $remove_all_images_task_page = new Remove_All_Images_Page( new Task_Ajax_Adapters_Registry( $remove_all_images_task_adapter ), $plugin->get_version() ); |
|
| 523 | - $reload_data_task_page = new Reload_Data_Page( new Task_Ajax_Adapters_Registry( $reload_data_task_adapter ), $plugin->get_version() ); |
|
| 524 | - $add_license_caption_or_remove_task_page = new Add_License_Caption_Or_Remove_Page( new Task_Ajax_Adapters_Registry( $add_license_caption_or_remove_task_adapter ), $plugin->get_version() ); |
|
| 522 | + $remove_all_images_task_page = new Remove_All_Images_Page( new Task_Ajax_Adapters_Registry( $remove_all_images_task_adapter ), $plugin->get_version() ); |
|
| 523 | + $reload_data_task_page = new Reload_Data_Page( new Task_Ajax_Adapters_Registry( $reload_data_task_adapter ), $plugin->get_version() ); |
|
| 524 | + $add_license_caption_or_remove_task_page = new Add_License_Caption_Or_Remove_Page( new Task_Ajax_Adapters_Registry( $add_license_caption_or_remove_task_adapter ), $plugin->get_version() ); |
|
| 525 | 525 | |
| 526 | - new Wordlift_Products_Navigator_Shortcode_REST(); |
|
| 526 | + new Wordlift_Products_Navigator_Shortcode_REST(); |
|
| 527 | 527 | |
| 528 | - // Register the Dataset module, requires `$api_service`. |
|
| 529 | - require_once plugin_dir_path( __FILE__ ) . 'wordlift/dataset/index.php'; |
|
| 528 | + // Register the Dataset module, requires `$api_service`. |
|
| 529 | + require_once plugin_dir_path( __FILE__ ) . 'wordlift/dataset/index.php'; |
|
| 530 | 530 | |
| 531 | - } ); |
|
| 531 | + } ); |
|
| 532 | 532 | |
| 533 | 533 | } |
| 534 | 534 | |
@@ -542,45 +542,45 @@ discard block |
||
| 542 | 542 | */ |
| 543 | 543 | function wordlift_plugin_autoload_register() { |
| 544 | 544 | |
| 545 | - spl_autoload_register( function ( $class_name ) { |
|
| 545 | + spl_autoload_register( function ( $class_name ) { |
|
| 546 | 546 | |
| 547 | - // Bail out if these are not our classes. |
|
| 548 | - if ( 0 !== strpos( $class_name, 'Wordlift\\' ) ) { |
|
| 549 | - return false; |
|
| 550 | - } |
|
| 547 | + // Bail out if these are not our classes. |
|
| 548 | + if ( 0 !== strpos( $class_name, 'Wordlift\\' ) ) { |
|
| 549 | + return false; |
|
| 550 | + } |
|
| 551 | 551 | |
| 552 | - $class_name_lc = strtolower( str_replace( '_', '-', $class_name ) ); |
|
| 552 | + $class_name_lc = strtolower( str_replace( '_', '-', $class_name ) ); |
|
| 553 | 553 | |
| 554 | - preg_match( '|^(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches ); |
|
| 554 | + preg_match( '|^(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches ); |
|
| 555 | 555 | |
| 556 | - $path = str_replace( '\\', DIRECTORY_SEPARATOR, $matches[1] ); |
|
| 557 | - $file = 'class-' . $matches[2] . '.php'; |
|
| 556 | + $path = str_replace( '\\', DIRECTORY_SEPARATOR, $matches[1] ); |
|
| 557 | + $file = 'class-' . $matches[2] . '.php'; |
|
| 558 | 558 | |
| 559 | - $full_path = plugin_dir_path( __FILE__ ) . $path . DIRECTORY_SEPARATOR . $file; |
|
| 559 | + $full_path = plugin_dir_path( __FILE__ ) . $path . DIRECTORY_SEPARATOR . $file; |
|
| 560 | 560 | |
| 561 | - if ( ! file_exists( $full_path ) ) { |
|
| 562 | - echo( "Class $class_name not found at $full_path." ); |
|
| 561 | + if ( ! file_exists( $full_path ) ) { |
|
| 562 | + echo( "Class $class_name not found at $full_path." ); |
|
| 563 | 563 | |
| 564 | - return false; |
|
| 565 | - } |
|
| 564 | + return false; |
|
| 565 | + } |
|
| 566 | 566 | |
| 567 | - require_once $full_path; |
|
| 567 | + require_once $full_path; |
|
| 568 | 568 | |
| 569 | - return true; |
|
| 570 | - } ); |
|
| 569 | + return true; |
|
| 570 | + } ); |
|
| 571 | 571 | |
| 572 | 572 | } |
| 573 | 573 | |
| 574 | 574 | function wl_block_categories( $categories, $post ) { |
| 575 | - return array_merge( |
|
| 576 | - $categories, |
|
| 577 | - array( |
|
| 578 | - array( |
|
| 579 | - 'slug' => 'wordlift', |
|
| 580 | - 'title' => __( 'WordLift', 'wordlift' ), |
|
| 581 | - ), |
|
| 582 | - ) |
|
| 583 | - ); |
|
| 575 | + return array_merge( |
|
| 576 | + $categories, |
|
| 577 | + array( |
|
| 578 | + array( |
|
| 579 | + 'slug' => 'wordlift', |
|
| 580 | + 'title' => __( 'WordLift', 'wordlift' ), |
|
| 581 | + ), |
|
| 582 | + ) |
|
| 583 | + ); |
|
| 584 | 584 | } |
| 585 | 585 | |
| 586 | 586 | add_filter( 'block_categories', 'wl_block_categories', 10, 2 ); |
@@ -65,1552 +65,1552 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | class Wordlift { |
| 67 | 67 | |
| 68 | - //<editor-fold desc="## FIELDS"> |
|
| 69 | - |
|
| 70 | - /** |
|
| 71 | - * The loader that's responsible for maintaining and registering all hooks that power |
|
| 72 | - * the plugin. |
|
| 73 | - * |
|
| 74 | - * @since 1.0.0 |
|
| 75 | - * @access protected |
|
| 76 | - * @var Wordlift_Loader $loader Maintains and registers all hooks for the plugin. |
|
| 77 | - */ |
|
| 78 | - protected $loader; |
|
| 79 | - |
|
| 80 | - /** |
|
| 81 | - * The unique identifier of this plugin. |
|
| 82 | - * |
|
| 83 | - * @since 1.0.0 |
|
| 84 | - * @access protected |
|
| 85 | - * @var string $plugin_name The string used to uniquely identify this plugin. |
|
| 86 | - */ |
|
| 87 | - protected $plugin_name; |
|
| 88 | - |
|
| 89 | - /** |
|
| 90 | - * The current version of the plugin. |
|
| 91 | - * |
|
| 92 | - * @since 1.0.0 |
|
| 93 | - * @access protected |
|
| 94 | - * @var string $version The current version of the plugin. |
|
| 95 | - */ |
|
| 96 | - protected $version; |
|
| 97 | - |
|
| 98 | - /** |
|
| 99 | - * The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 100 | - * |
|
| 101 | - * @since 3.12.0 |
|
| 102 | - * @access protected |
|
| 103 | - * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 104 | - */ |
|
| 105 | - protected $tinymce_adapter; |
|
| 106 | - |
|
| 107 | - /** |
|
| 108 | - * The {@link Faq_Tinymce_Adapter} instance |
|
| 109 | - * @since 3.26.0 |
|
| 110 | - * @access protected |
|
| 111 | - * @var Faq_Tinymce_Adapter $faq_tinymce_adapter . |
|
| 112 | - */ |
|
| 113 | - //protected $faq_tinymce_adapter; |
|
| 114 | - |
|
| 115 | - /** |
|
| 116 | - * The Thumbnail service. |
|
| 117 | - * |
|
| 118 | - * @since 3.1.5 |
|
| 119 | - * @access private |
|
| 120 | - * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service. |
|
| 121 | - */ |
|
| 122 | - private $thumbnail_service; |
|
| 123 | - |
|
| 124 | - /** |
|
| 125 | - * The UI service. |
|
| 126 | - * |
|
| 127 | - * @since 3.2.0 |
|
| 128 | - * @access private |
|
| 129 | - * @var \Wordlift_UI_Service $ui_service The UI service. |
|
| 130 | - */ |
|
| 131 | - private $ui_service; |
|
| 132 | - |
|
| 133 | - /** |
|
| 134 | - * The Schema service. |
|
| 135 | - * |
|
| 136 | - * @since 3.3.0 |
|
| 137 | - * @access protected |
|
| 138 | - * @var \Wordlift_Schema_Service $schema_service The Schema service. |
|
| 139 | - */ |
|
| 140 | - protected $schema_service; |
|
| 141 | - |
|
| 142 | - /** |
|
| 143 | - * The Entity service. |
|
| 144 | - * |
|
| 145 | - * @since 3.1.0 |
|
| 146 | - * @access protected |
|
| 147 | - * @var \Wordlift_Entity_Service $entity_service The Entity service. |
|
| 148 | - */ |
|
| 149 | - protected $entity_service; |
|
| 150 | - |
|
| 151 | - /** |
|
| 152 | - * The Topic Taxonomy service. |
|
| 153 | - * |
|
| 154 | - * @since 3.5.0 |
|
| 155 | - * @access private |
|
| 156 | - * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service. |
|
| 157 | - */ |
|
| 158 | - private $topic_taxonomy_service; |
|
| 159 | - |
|
| 160 | - /** |
|
| 161 | - * The Entity Types Taxonomy service. |
|
| 162 | - * |
|
| 163 | - * @since 3.18.0 |
|
| 164 | - * @access private |
|
| 165 | - * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service. |
|
| 166 | - */ |
|
| 167 | - private $entity_types_taxonomy_service; |
|
| 168 | - |
|
| 169 | - /** |
|
| 170 | - * The User service. |
|
| 171 | - * |
|
| 172 | - * @since 3.1.7 |
|
| 173 | - * @access protected |
|
| 174 | - * @var \Wordlift_User_Service $user_service The User service. |
|
| 175 | - */ |
|
| 176 | - protected $user_service; |
|
| 177 | - |
|
| 178 | - /** |
|
| 179 | - * The Timeline service. |
|
| 180 | - * |
|
| 181 | - * @since 3.1.0 |
|
| 182 | - * @access private |
|
| 183 | - * @var \Wordlift_Timeline_Service $timeline_service The Timeline service. |
|
| 184 | - */ |
|
| 185 | - private $timeline_service; |
|
| 186 | - |
|
| 187 | - /** |
|
| 188 | - * The Redirect service. |
|
| 189 | - * |
|
| 190 | - * @since 3.2.0 |
|
| 191 | - * @access private |
|
| 192 | - * @var \Wordlift_Redirect_Service $redirect_service The Redirect service. |
|
| 193 | - */ |
|
| 194 | - private $redirect_service; |
|
| 195 | - |
|
| 196 | - /** |
|
| 197 | - * The Notice service. |
|
| 198 | - * |
|
| 199 | - * @since 3.3.0 |
|
| 200 | - * @access private |
|
| 201 | - * @var \Wordlift_Notice_Service $notice_service The Notice service. |
|
| 202 | - */ |
|
| 203 | - private $notice_service; |
|
| 204 | - |
|
| 205 | - /** |
|
| 206 | - * The Entity list customization. |
|
| 207 | - * |
|
| 208 | - * @since 3.3.0 |
|
| 209 | - * @access protected |
|
| 210 | - * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service. |
|
| 211 | - */ |
|
| 212 | - protected $entity_list_service; |
|
| 213 | - |
|
| 214 | - /** |
|
| 215 | - * The Entity Types Taxonomy Walker. |
|
| 216 | - * |
|
| 217 | - * @since 3.1.0 |
|
| 218 | - * @access private |
|
| 219 | - * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker |
|
| 220 | - */ |
|
| 221 | - private $entity_types_taxonomy_walker; |
|
| 222 | - |
|
| 223 | - /** |
|
| 224 | - * The ShareThis service. |
|
| 225 | - * |
|
| 226 | - * @since 3.2.0 |
|
| 227 | - * @access private |
|
| 228 | - * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service. |
|
| 229 | - */ |
|
| 230 | - private $sharethis_service; |
|
| 231 | - |
|
| 232 | - /** |
|
| 233 | - * The PrimaShop adapter. |
|
| 234 | - * |
|
| 235 | - * @since 3.2.3 |
|
| 236 | - * @access private |
|
| 237 | - * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter. |
|
| 238 | - */ |
|
| 239 | - private $primashop_adapter; |
|
| 240 | - |
|
| 241 | - /** |
|
| 242 | - * The WordLift Dashboard adapter. |
|
| 243 | - * |
|
| 244 | - * @since 3.4.0 |
|
| 245 | - * @access private |
|
| 246 | - * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service; |
|
| 247 | - */ |
|
| 248 | - private $dashboard_service; |
|
| 249 | - |
|
| 250 | - /** |
|
| 251 | - * The entity type service. |
|
| 252 | - * |
|
| 253 | - * @since 3.6.0 |
|
| 254 | - * @access private |
|
| 255 | - * @var \Wordlift_Entity_Post_Type_Service |
|
| 256 | - */ |
|
| 257 | - private $entity_post_type_service; |
|
| 258 | - |
|
| 259 | - /** |
|
| 260 | - * The entity link service used to mangle links to entities with a custom slug or even w/o a slug. |
|
| 261 | - * |
|
| 262 | - * @since 3.6.0 |
|
| 263 | - * @access private |
|
| 264 | - * @var \Wordlift_Entity_Link_Service $entity_link_service The {@link Wordlift_Entity_Link_Service} instance. |
|
| 265 | - */ |
|
| 266 | - private $entity_link_service; |
|
| 267 | - |
|
| 268 | - /** |
|
| 269 | - * A {@link Wordlift_Sparql_Service} instance. |
|
| 270 | - * |
|
| 271 | - * @since 3.6.0 |
|
| 272 | - * @access protected |
|
| 273 | - * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance. |
|
| 274 | - */ |
|
| 275 | - protected $sparql_service; |
|
| 276 | - |
|
| 277 | - /** |
|
| 278 | - * A {@link Wordlift_Import_Service} instance. |
|
| 279 | - * |
|
| 280 | - * @since 3.6.0 |
|
| 281 | - * @access private |
|
| 282 | - * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance. |
|
| 283 | - */ |
|
| 284 | - private $import_service; |
|
| 285 | - |
|
| 286 | - /** |
|
| 287 | - * A {@link Wordlift_Rebuild_Service} instance. |
|
| 288 | - * |
|
| 289 | - * @since 3.6.0 |
|
| 290 | - * @access private |
|
| 291 | - * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance. |
|
| 292 | - */ |
|
| 293 | - private $rebuild_service; |
|
| 294 | - |
|
| 295 | - /** |
|
| 296 | - * A {@link Wordlift_Jsonld_Service} instance. |
|
| 297 | - * |
|
| 298 | - * @since 3.7.0 |
|
| 299 | - * @access protected |
|
| 300 | - * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance. |
|
| 301 | - */ |
|
| 302 | - protected $jsonld_service; |
|
| 303 | - |
|
| 304 | - /** |
|
| 305 | - * A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 306 | - * |
|
| 307 | - * @since 3.14.0 |
|
| 308 | - * @access protected |
|
| 309 | - * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 310 | - */ |
|
| 311 | - protected $jsonld_website_converter; |
|
| 312 | - |
|
| 313 | - /** |
|
| 314 | - * A {@link Wordlift_Property_Factory} instance. |
|
| 315 | - * |
|
| 316 | - * @since 3.7.0 |
|
| 317 | - * @access private |
|
| 318 | - * @var \Wordlift_Property_Factory $property_factory |
|
| 319 | - */ |
|
| 320 | - private $property_factory; |
|
| 321 | - |
|
| 322 | - /** |
|
| 323 | - * The 'Download Your Data' page. |
|
| 324 | - * |
|
| 325 | - * @since 3.6.0 |
|
| 326 | - * @access private |
|
| 327 | - * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page. |
|
| 328 | - */ |
|
| 329 | - private $download_your_data_page; |
|
| 330 | - |
|
| 331 | - /** |
|
| 332 | - * The 'WordLift Settings' page. |
|
| 333 | - * |
|
| 334 | - * @since 3.11.0 |
|
| 335 | - * @access protected |
|
| 336 | - * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page. |
|
| 337 | - */ |
|
| 338 | - protected $settings_page; |
|
| 339 | - |
|
| 340 | - /** |
|
| 341 | - * The install wizard page. |
|
| 342 | - * |
|
| 343 | - * @since 3.9.0 |
|
| 344 | - * @access private |
|
| 345 | - * @var \Wordlift_Admin_Setup $admin_setup The Install wizard. |
|
| 346 | - */ |
|
| 347 | - public $admin_setup; |
|
| 348 | - |
|
| 349 | - /** |
|
| 350 | - * The Content Filter Service hooks up to the 'the_content' filter and provides |
|
| 351 | - * linking of entities to their pages. |
|
| 352 | - * |
|
| 353 | - * @since 3.8.0 |
|
| 354 | - * @access private |
|
| 355 | - * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance. |
|
| 356 | - */ |
|
| 357 | - private $content_filter_service; |
|
| 358 | - |
|
| 359 | - /** |
|
| 360 | - * The Faq Content filter service |
|
| 361 | - * @since 3.26.0 |
|
| 362 | - * @access private |
|
| 363 | - * @var Faq_Content_Filter $faq_content_filter_service A {@link Faq_Content_Filter} instance. |
|
| 364 | - */ |
|
| 365 | - private $faq_content_filter_service; |
|
| 366 | - |
|
| 367 | - /** |
|
| 368 | - * A {@link Wordlift_Key_Validation_Service} instance. |
|
| 369 | - * |
|
| 370 | - * @since 3.9.0 |
|
| 371 | - * @access private |
|
| 372 | - * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance. |
|
| 373 | - */ |
|
| 374 | - private $key_validation_service; |
|
| 375 | - |
|
| 376 | - /** |
|
| 377 | - * A {@link Wordlift_Rating_Service} instance. |
|
| 378 | - * |
|
| 379 | - * @since 3.10.0 |
|
| 380 | - * @access private |
|
| 381 | - * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance. |
|
| 382 | - */ |
|
| 383 | - private $rating_service; |
|
| 384 | - |
|
| 385 | - /** |
|
| 386 | - * A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 387 | - * |
|
| 388 | - * @since 3.10.0 |
|
| 389 | - * @access protected |
|
| 390 | - * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 391 | - */ |
|
| 392 | - protected $post_to_jsonld_converter; |
|
| 393 | - |
|
| 394 | - /** |
|
| 395 | - * A {@link Wordlift_Configuration_Service} instance. |
|
| 396 | - * |
|
| 397 | - * @since 3.10.0 |
|
| 398 | - * @access protected |
|
| 399 | - * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance. |
|
| 400 | - */ |
|
| 401 | - protected $configuration_service; |
|
| 402 | - |
|
| 403 | - /** |
|
| 404 | - * A {@link Wordlift_Install_Service} instance. |
|
| 405 | - * |
|
| 406 | - * @since 3.18.0 |
|
| 407 | - * @access protected |
|
| 408 | - * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance. |
|
| 409 | - */ |
|
| 410 | - protected $install_service; |
|
| 411 | - |
|
| 412 | - /** |
|
| 413 | - * A {@link Wordlift_Entity_Type_Service} instance. |
|
| 414 | - * |
|
| 415 | - * @since 3.10.0 |
|
| 416 | - * @access protected |
|
| 417 | - * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance. |
|
| 418 | - */ |
|
| 419 | - protected $entity_type_service; |
|
| 420 | - |
|
| 421 | - /** |
|
| 422 | - * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 423 | - * |
|
| 424 | - * @since 3.10.0 |
|
| 425 | - * @access protected |
|
| 426 | - * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 427 | - */ |
|
| 428 | - protected $entity_post_to_jsonld_converter; |
|
| 429 | - |
|
| 430 | - /** |
|
| 431 | - * A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 432 | - * |
|
| 433 | - * @since 3.10.0 |
|
| 434 | - * @access protected |
|
| 435 | - * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 436 | - */ |
|
| 437 | - protected $postid_to_jsonld_converter; |
|
| 438 | - |
|
| 439 | - /** |
|
| 440 | - * The {@link Wordlift_Admin_Status_Page} class. |
|
| 441 | - * |
|
| 442 | - * @since 3.9.8 |
|
| 443 | - * @access private |
|
| 444 | - * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class. |
|
| 445 | - */ |
|
| 446 | - private $status_page; |
|
| 447 | - |
|
| 448 | - /** |
|
| 449 | - * The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 450 | - * |
|
| 451 | - * @since 3.11.0 |
|
| 452 | - * @access protected |
|
| 453 | - * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 454 | - */ |
|
| 455 | - protected $category_taxonomy_service; |
|
| 456 | - |
|
| 457 | - /** |
|
| 458 | - * The {@link Wordlift_Entity_Page_Service} instance. |
|
| 459 | - * |
|
| 460 | - * @since 3.11.0 |
|
| 461 | - * @access protected |
|
| 462 | - * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance. |
|
| 463 | - */ |
|
| 464 | - protected $entity_page_service; |
|
| 465 | - |
|
| 466 | - /** |
|
| 467 | - * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 468 | - * |
|
| 469 | - * @since 3.11.0 |
|
| 470 | - * @access protected |
|
| 471 | - * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 472 | - */ |
|
| 473 | - protected $settings_page_action_link; |
|
| 474 | - |
|
| 475 | - /** |
|
| 476 | - * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 477 | - * |
|
| 478 | - * @since 3.11.0 |
|
| 479 | - * @access protected |
|
| 480 | - * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 481 | - */ |
|
| 482 | - protected $analytics_settings_page_action_link; |
|
| 483 | - |
|
| 484 | - /** |
|
| 485 | - * The {@link Wordlift_Analytics_Connect} class. |
|
| 486 | - * |
|
| 487 | - * @since 3.11.0 |
|
| 488 | - * @access protected |
|
| 489 | - * @var \Wordlift_Analytics_Connect $analytics_connect The {@link Wordlift_Analytics_Connect} class. |
|
| 490 | - */ |
|
| 491 | - protected $analytics_connect; |
|
| 492 | - |
|
| 493 | - /** |
|
| 494 | - * The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 495 | - * |
|
| 496 | - * @since 3.11.0 |
|
| 497 | - * @access protected |
|
| 498 | - * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 499 | - */ |
|
| 500 | - protected $publisher_ajax_adapter; |
|
| 501 | - |
|
| 502 | - /** |
|
| 503 | - * The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 504 | - * |
|
| 505 | - * @since 3.11.0 |
|
| 506 | - * @access protected |
|
| 507 | - * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 508 | - */ |
|
| 509 | - protected $input_element; |
|
| 510 | - |
|
| 511 | - /** |
|
| 512 | - * The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 513 | - * |
|
| 514 | - * @since 3.13.0 |
|
| 515 | - * @access protected |
|
| 516 | - * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 517 | - */ |
|
| 518 | - protected $radio_input_element; |
|
| 519 | - |
|
| 520 | - /** |
|
| 521 | - * The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 522 | - * |
|
| 523 | - * @since 3.11.0 |
|
| 524 | - * @access protected |
|
| 525 | - * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 526 | - */ |
|
| 527 | - protected $language_select_element; |
|
| 528 | - |
|
| 529 | - /** |
|
| 530 | - * The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
| 531 | - * |
|
| 532 | - * @since 3.18.0 |
|
| 533 | - * @access protected |
|
| 534 | - * @var \Wordlift_Admin_Country_Select_Element $country_select_element The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
| 535 | - */ |
|
| 536 | - protected $country_select_element; |
|
| 537 | - |
|
| 538 | - /** |
|
| 539 | - * The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 540 | - * |
|
| 541 | - * @since 3.11.0 |
|
| 542 | - * @access protected |
|
| 543 | - * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 544 | - */ |
|
| 545 | - protected $publisher_element; |
|
| 546 | - |
|
| 547 | - /** |
|
| 548 | - * The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 549 | - * |
|
| 550 | - * @since 3.11.0 |
|
| 551 | - * @access protected |
|
| 552 | - * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 553 | - */ |
|
| 554 | - protected $select2_element; |
|
| 555 | - |
|
| 556 | - /** |
|
| 557 | - * The controller for the entity type list admin page |
|
| 558 | - * |
|
| 559 | - * @since 3.11.0 |
|
| 560 | - * @access private |
|
| 561 | - * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class. |
|
| 562 | - */ |
|
| 563 | - private $entity_type_admin_page; |
|
| 564 | - |
|
| 565 | - /** |
|
| 566 | - * The controller for the entity type settings admin page |
|
| 567 | - * |
|
| 568 | - * @since 3.11.0 |
|
| 569 | - * @access private |
|
| 570 | - * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class. |
|
| 571 | - */ |
|
| 572 | - private $entity_type_settings_admin_page; |
|
| 573 | - |
|
| 574 | - /** |
|
| 575 | - * The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 576 | - * |
|
| 577 | - * @since 3.11.0 |
|
| 578 | - * @access protected |
|
| 579 | - * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 580 | - */ |
|
| 581 | - protected $related_entities_cloud_widget; |
|
| 582 | - |
|
| 583 | - /** |
|
| 584 | - * The {@link Wordlift_Admin_Author_Element} instance. |
|
| 585 | - * |
|
| 586 | - * @since 3.14.0 |
|
| 587 | - * @access protected |
|
| 588 | - * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance. |
|
| 589 | - */ |
|
| 590 | - protected $author_element; |
|
| 591 | - |
|
| 592 | - /** |
|
| 593 | - * The {@link Wordlift_Sample_Data_Service} instance. |
|
| 594 | - * |
|
| 595 | - * @since 3.12.0 |
|
| 596 | - * @access protected |
|
| 597 | - * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance. |
|
| 598 | - */ |
|
| 599 | - protected $sample_data_service; |
|
| 600 | - |
|
| 601 | - /** |
|
| 602 | - * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 603 | - * |
|
| 604 | - * @since 3.12.0 |
|
| 605 | - * @access protected |
|
| 606 | - * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 607 | - */ |
|
| 608 | - protected $sample_data_ajax_adapter; |
|
| 609 | - |
|
| 610 | - /** |
|
| 611 | - * The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 612 | - * |
|
| 613 | - * @since 3.14.3 |
|
| 614 | - * @access private |
|
| 615 | - * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 616 | - */ |
|
| 617 | - private $relation_rebuild_service; |
|
| 618 | - |
|
| 619 | - /** |
|
| 620 | - * The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 621 | - * |
|
| 622 | - * @since 3.14.3 |
|
| 623 | - * @access private |
|
| 624 | - * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 625 | - */ |
|
| 626 | - private $relation_rebuild_adapter; |
|
| 627 | - |
|
| 628 | - /** |
|
| 629 | - * The {@link Wordlift_Reference_Rebuild_Service} instance. |
|
| 630 | - * |
|
| 631 | - * @since 3.18.0 |
|
| 632 | - * @access private |
|
| 633 | - * @var \Wordlift_Reference_Rebuild_Service $reference_rebuild_service The {@link Wordlift_Reference_Rebuild_Service} instance. |
|
| 634 | - */ |
|
| 635 | - private $reference_rebuild_service; |
|
| 636 | - |
|
| 637 | - /** |
|
| 638 | - * The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 639 | - * |
|
| 640 | - * @since 3.16.0 |
|
| 641 | - * @access protected |
|
| 642 | - * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 643 | - */ |
|
| 644 | - protected $google_analytics_export_service; |
|
| 645 | - |
|
| 646 | - /** |
|
| 647 | - * {@link Wordlift}'s singleton instance. |
|
| 648 | - * |
|
| 649 | - * @since 3.15.0 |
|
| 650 | - * @access protected |
|
| 651 | - * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance. |
|
| 652 | - */ |
|
| 653 | - protected $entity_type_adapter; |
|
| 654 | - |
|
| 655 | - /** |
|
| 656 | - * The {@link Wordlift_Storage_Factory} instance. |
|
| 657 | - * |
|
| 658 | - * @since 3.15.0 |
|
| 659 | - * @access protected |
|
| 660 | - * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance. |
|
| 661 | - */ |
|
| 662 | - protected $storage_factory; |
|
| 663 | - |
|
| 664 | - /** |
|
| 665 | - * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 666 | - * |
|
| 667 | - * @since 3.15.0 |
|
| 668 | - * @access protected |
|
| 669 | - * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 670 | - */ |
|
| 671 | - protected $rendition_factory; |
|
| 672 | - |
|
| 673 | - /** |
|
| 674 | - * The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 675 | - * |
|
| 676 | - * @since 3.15.0 |
|
| 677 | - * @access private |
|
| 678 | - * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 679 | - */ |
|
| 680 | - private $autocomplete_adapter; |
|
| 681 | - |
|
| 682 | - /** |
|
| 683 | - * The {@link Wordlift_Relation_Service} instance. |
|
| 684 | - * |
|
| 685 | - * @since 3.15.0 |
|
| 686 | - * @access protected |
|
| 687 | - * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance. |
|
| 688 | - */ |
|
| 689 | - protected $relation_service; |
|
| 690 | - |
|
| 691 | - /** |
|
| 692 | - * The {@link Wordlift_Cached_Post_Converter} instance. |
|
| 693 | - * |
|
| 694 | - * @since 3.16.0 |
|
| 695 | - * @access protected |
|
| 696 | - * @var \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance. |
|
| 697 | - * |
|
| 698 | - */ |
|
| 699 | - protected $cached_postid_to_jsonld_converter; |
|
| 700 | - |
|
| 701 | - /** |
|
| 702 | - * The {@link Wordlift_Entity_Uri_Service} instance. |
|
| 703 | - * |
|
| 704 | - * @since 3.16.3 |
|
| 705 | - * @access protected |
|
| 706 | - * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance. |
|
| 707 | - */ |
|
| 708 | - protected $entity_uri_service; |
|
| 709 | - |
|
| 710 | - /** |
|
| 711 | - * The {@link Wordlift_Publisher_Service} instance. |
|
| 712 | - * |
|
| 713 | - * @since 3.19.0 |
|
| 714 | - * @access protected |
|
| 715 | - * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance. |
|
| 716 | - */ |
|
| 717 | - protected $publisher_service; |
|
| 718 | - |
|
| 719 | - /** |
|
| 720 | - * The {@link Wordlift_Context_Cards_Service} instance. |
|
| 721 | - * |
|
| 722 | - * @var \Wordlift_Context_Cards_Service The {@link Wordlift_Context_Cards_Service} instance. |
|
| 723 | - */ |
|
| 724 | - protected $context_cards_service; |
|
| 725 | - |
|
| 726 | - /** |
|
| 727 | - * {@link Wordlift}'s singleton instance. |
|
| 728 | - * |
|
| 729 | - * @since 3.11.2 |
|
| 730 | - * @access private |
|
| 731 | - * @var Wordlift $instance {@link Wordlift}'s singleton instance. |
|
| 732 | - */ |
|
| 733 | - private static $instance; |
|
| 734 | - |
|
| 735 | - //</editor-fold> |
|
| 736 | - |
|
| 737 | - /** |
|
| 738 | - * Define the core functionality of the plugin. |
|
| 739 | - * |
|
| 740 | - * Set the plugin name and the plugin version that can be used throughout the plugin. |
|
| 741 | - * Load the dependencies, define the locale, and set the hooks for the admin area and |
|
| 742 | - * the public-facing side of the site. |
|
| 743 | - * |
|
| 744 | - * @since 1.0.0 |
|
| 745 | - */ |
|
| 746 | - public function __construct() { |
|
| 747 | - |
|
| 748 | - self::$instance = $this; |
|
| 749 | - |
|
| 750 | - $this->plugin_name = 'wordlift'; |
|
| 751 | - $this->version = '3.27.6.1'; |
|
| 752 | - $this->load_dependencies(); |
|
| 753 | - $this->set_locale(); |
|
| 754 | - $this->define_admin_hooks(); |
|
| 755 | - $this->define_public_hooks(); |
|
| 756 | - |
|
| 757 | - // If we're in `WP_CLI` load the related files. |
|
| 758 | - if ( class_exists( 'WP_CLI' ) ) { |
|
| 759 | - $this->load_cli_dependencies(); |
|
| 760 | - } |
|
| 761 | - |
|
| 762 | - } |
|
| 763 | - |
|
| 764 | - /** |
|
| 765 | - * Get the singleton instance. |
|
| 766 | - * |
|
| 767 | - * @return Wordlift The {@link Wordlift} singleton instance. |
|
| 768 | - * @since 3.11.2 |
|
| 769 | - * |
|
| 770 | - */ |
|
| 771 | - public static function get_instance() { |
|
| 772 | - |
|
| 773 | - return self::$instance; |
|
| 774 | - } |
|
| 775 | - |
|
| 776 | - /** |
|
| 777 | - * Load the required dependencies for this plugin. |
|
| 778 | - * |
|
| 779 | - * Include the following files that make up the plugin: |
|
| 780 | - * |
|
| 781 | - * - Wordlift_Loader. Orchestrates the hooks of the plugin. |
|
| 782 | - * - Wordlift_i18n. Defines internationalization functionality. |
|
| 783 | - * - Wordlift_Admin. Defines all hooks for the admin area. |
|
| 784 | - * - Wordlift_Public. Defines all hooks for the public side of the site. |
|
| 785 | - * |
|
| 786 | - * Create an instance of the loader which will be used to register the hooks |
|
| 787 | - * with WordPress. |
|
| 788 | - * |
|
| 789 | - * @throws Exception |
|
| 790 | - * @since 1.0.0 |
|
| 791 | - * @access private |
|
| 792 | - */ |
|
| 793 | - private function load_dependencies() { |
|
| 794 | - |
|
| 795 | - /** |
|
| 796 | - * The class responsible for orchestrating the actions and filters of the |
|
| 797 | - * core plugin. |
|
| 798 | - */ |
|
| 799 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 800 | - |
|
| 801 | - // The class responsible for plugin uninstall. |
|
| 802 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
|
| 803 | - |
|
| 804 | - /** |
|
| 805 | - * The class responsible for defining internationalization functionality |
|
| 806 | - * of the plugin. |
|
| 807 | - */ |
|
| 808 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 809 | - |
|
| 810 | - /** |
|
| 811 | - * WordLift's supported languages. |
|
| 812 | - */ |
|
| 813 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 814 | - |
|
| 815 | - /** |
|
| 816 | - * WordLift's supported countries. |
|
| 817 | - */ |
|
| 818 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php'; |
|
| 819 | - |
|
| 820 | - /** |
|
| 821 | - * Provide support functions to sanitize data. |
|
| 822 | - */ |
|
| 823 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 824 | - |
|
| 825 | - /** Services. */ |
|
| 826 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 827 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
|
| 828 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 829 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 830 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 831 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 832 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 833 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
|
| 834 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 835 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php'; |
|
| 836 | - |
|
| 837 | - /** |
|
| 838 | - * The Query builder. |
|
| 839 | - */ |
|
| 840 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 841 | - |
|
| 842 | - /** |
|
| 843 | - * The Schema service. |
|
| 844 | - */ |
|
| 845 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 846 | - |
|
| 847 | - /** |
|
| 848 | - * The schema:url property service. |
|
| 849 | - */ |
|
| 850 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 851 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 852 | - |
|
| 853 | - /** |
|
| 854 | - * The UI service. |
|
| 855 | - */ |
|
| 856 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 857 | - |
|
| 858 | - /** |
|
| 859 | - * The Thumbnail service. |
|
| 860 | - */ |
|
| 861 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 862 | - |
|
| 863 | - /** |
|
| 864 | - * The Entity Types Taxonomy service. |
|
| 865 | - */ |
|
| 866 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 867 | - |
|
| 868 | - /** |
|
| 869 | - * The Entity service. |
|
| 870 | - */ |
|
| 871 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
|
| 872 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 873 | - |
|
| 874 | - // Add the entity rating service. |
|
| 875 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 876 | - |
|
| 877 | - /** |
|
| 878 | - * The User service. |
|
| 879 | - */ |
|
| 880 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 881 | - |
|
| 882 | - /** |
|
| 883 | - * The Timeline service. |
|
| 884 | - */ |
|
| 885 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 886 | - |
|
| 887 | - /** |
|
| 888 | - * The Topic Taxonomy service. |
|
| 889 | - */ |
|
| 890 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 891 | - |
|
| 892 | - /** |
|
| 893 | - * The SPARQL service. |
|
| 894 | - */ |
|
| 895 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 896 | - |
|
| 897 | - /** |
|
| 898 | - * The WordLift import service. |
|
| 899 | - */ |
|
| 900 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 901 | - |
|
| 902 | - /** |
|
| 903 | - * The WordLift URI service. |
|
| 904 | - */ |
|
| 905 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 906 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 907 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 908 | - |
|
| 909 | - /** |
|
| 910 | - * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
|
| 911 | - */ |
|
| 912 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php'; |
|
| 913 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php'; |
|
| 914 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php'; |
|
| 915 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php'; |
|
| 916 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php'; |
|
| 917 | - |
|
| 918 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 919 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 920 | - |
|
| 921 | - /** |
|
| 922 | - * Load the converters. |
|
| 923 | - */ |
|
| 924 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 925 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 926 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 927 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 928 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 929 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 930 | - |
|
| 931 | - /** |
|
| 932 | - * Load cache-related files. |
|
| 933 | - */ |
|
| 934 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
|
| 935 | - |
|
| 936 | - /** |
|
| 937 | - * Load the content filter. |
|
| 938 | - */ |
|
| 939 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 940 | - |
|
| 941 | - /* |
|
| 68 | + //<editor-fold desc="## FIELDS"> |
|
| 69 | + |
|
| 70 | + /** |
|
| 71 | + * The loader that's responsible for maintaining and registering all hooks that power |
|
| 72 | + * the plugin. |
|
| 73 | + * |
|
| 74 | + * @since 1.0.0 |
|
| 75 | + * @access protected |
|
| 76 | + * @var Wordlift_Loader $loader Maintains and registers all hooks for the plugin. |
|
| 77 | + */ |
|
| 78 | + protected $loader; |
|
| 79 | + |
|
| 80 | + /** |
|
| 81 | + * The unique identifier of this plugin. |
|
| 82 | + * |
|
| 83 | + * @since 1.0.0 |
|
| 84 | + * @access protected |
|
| 85 | + * @var string $plugin_name The string used to uniquely identify this plugin. |
|
| 86 | + */ |
|
| 87 | + protected $plugin_name; |
|
| 88 | + |
|
| 89 | + /** |
|
| 90 | + * The current version of the plugin. |
|
| 91 | + * |
|
| 92 | + * @since 1.0.0 |
|
| 93 | + * @access protected |
|
| 94 | + * @var string $version The current version of the plugin. |
|
| 95 | + */ |
|
| 96 | + protected $version; |
|
| 97 | + |
|
| 98 | + /** |
|
| 99 | + * The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 100 | + * |
|
| 101 | + * @since 3.12.0 |
|
| 102 | + * @access protected |
|
| 103 | + * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 104 | + */ |
|
| 105 | + protected $tinymce_adapter; |
|
| 106 | + |
|
| 107 | + /** |
|
| 108 | + * The {@link Faq_Tinymce_Adapter} instance |
|
| 109 | + * @since 3.26.0 |
|
| 110 | + * @access protected |
|
| 111 | + * @var Faq_Tinymce_Adapter $faq_tinymce_adapter . |
|
| 112 | + */ |
|
| 113 | + //protected $faq_tinymce_adapter; |
|
| 114 | + |
|
| 115 | + /** |
|
| 116 | + * The Thumbnail service. |
|
| 117 | + * |
|
| 118 | + * @since 3.1.5 |
|
| 119 | + * @access private |
|
| 120 | + * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service. |
|
| 121 | + */ |
|
| 122 | + private $thumbnail_service; |
|
| 123 | + |
|
| 124 | + /** |
|
| 125 | + * The UI service. |
|
| 126 | + * |
|
| 127 | + * @since 3.2.0 |
|
| 128 | + * @access private |
|
| 129 | + * @var \Wordlift_UI_Service $ui_service The UI service. |
|
| 130 | + */ |
|
| 131 | + private $ui_service; |
|
| 132 | + |
|
| 133 | + /** |
|
| 134 | + * The Schema service. |
|
| 135 | + * |
|
| 136 | + * @since 3.3.0 |
|
| 137 | + * @access protected |
|
| 138 | + * @var \Wordlift_Schema_Service $schema_service The Schema service. |
|
| 139 | + */ |
|
| 140 | + protected $schema_service; |
|
| 141 | + |
|
| 142 | + /** |
|
| 143 | + * The Entity service. |
|
| 144 | + * |
|
| 145 | + * @since 3.1.0 |
|
| 146 | + * @access protected |
|
| 147 | + * @var \Wordlift_Entity_Service $entity_service The Entity service. |
|
| 148 | + */ |
|
| 149 | + protected $entity_service; |
|
| 150 | + |
|
| 151 | + /** |
|
| 152 | + * The Topic Taxonomy service. |
|
| 153 | + * |
|
| 154 | + * @since 3.5.0 |
|
| 155 | + * @access private |
|
| 156 | + * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service. |
|
| 157 | + */ |
|
| 158 | + private $topic_taxonomy_service; |
|
| 159 | + |
|
| 160 | + /** |
|
| 161 | + * The Entity Types Taxonomy service. |
|
| 162 | + * |
|
| 163 | + * @since 3.18.0 |
|
| 164 | + * @access private |
|
| 165 | + * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service. |
|
| 166 | + */ |
|
| 167 | + private $entity_types_taxonomy_service; |
|
| 168 | + |
|
| 169 | + /** |
|
| 170 | + * The User service. |
|
| 171 | + * |
|
| 172 | + * @since 3.1.7 |
|
| 173 | + * @access protected |
|
| 174 | + * @var \Wordlift_User_Service $user_service The User service. |
|
| 175 | + */ |
|
| 176 | + protected $user_service; |
|
| 177 | + |
|
| 178 | + /** |
|
| 179 | + * The Timeline service. |
|
| 180 | + * |
|
| 181 | + * @since 3.1.0 |
|
| 182 | + * @access private |
|
| 183 | + * @var \Wordlift_Timeline_Service $timeline_service The Timeline service. |
|
| 184 | + */ |
|
| 185 | + private $timeline_service; |
|
| 186 | + |
|
| 187 | + /** |
|
| 188 | + * The Redirect service. |
|
| 189 | + * |
|
| 190 | + * @since 3.2.0 |
|
| 191 | + * @access private |
|
| 192 | + * @var \Wordlift_Redirect_Service $redirect_service The Redirect service. |
|
| 193 | + */ |
|
| 194 | + private $redirect_service; |
|
| 195 | + |
|
| 196 | + /** |
|
| 197 | + * The Notice service. |
|
| 198 | + * |
|
| 199 | + * @since 3.3.0 |
|
| 200 | + * @access private |
|
| 201 | + * @var \Wordlift_Notice_Service $notice_service The Notice service. |
|
| 202 | + */ |
|
| 203 | + private $notice_service; |
|
| 204 | + |
|
| 205 | + /** |
|
| 206 | + * The Entity list customization. |
|
| 207 | + * |
|
| 208 | + * @since 3.3.0 |
|
| 209 | + * @access protected |
|
| 210 | + * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service. |
|
| 211 | + */ |
|
| 212 | + protected $entity_list_service; |
|
| 213 | + |
|
| 214 | + /** |
|
| 215 | + * The Entity Types Taxonomy Walker. |
|
| 216 | + * |
|
| 217 | + * @since 3.1.0 |
|
| 218 | + * @access private |
|
| 219 | + * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker |
|
| 220 | + */ |
|
| 221 | + private $entity_types_taxonomy_walker; |
|
| 222 | + |
|
| 223 | + /** |
|
| 224 | + * The ShareThis service. |
|
| 225 | + * |
|
| 226 | + * @since 3.2.0 |
|
| 227 | + * @access private |
|
| 228 | + * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service. |
|
| 229 | + */ |
|
| 230 | + private $sharethis_service; |
|
| 231 | + |
|
| 232 | + /** |
|
| 233 | + * The PrimaShop adapter. |
|
| 234 | + * |
|
| 235 | + * @since 3.2.3 |
|
| 236 | + * @access private |
|
| 237 | + * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter. |
|
| 238 | + */ |
|
| 239 | + private $primashop_adapter; |
|
| 240 | + |
|
| 241 | + /** |
|
| 242 | + * The WordLift Dashboard adapter. |
|
| 243 | + * |
|
| 244 | + * @since 3.4.0 |
|
| 245 | + * @access private |
|
| 246 | + * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service; |
|
| 247 | + */ |
|
| 248 | + private $dashboard_service; |
|
| 249 | + |
|
| 250 | + /** |
|
| 251 | + * The entity type service. |
|
| 252 | + * |
|
| 253 | + * @since 3.6.0 |
|
| 254 | + * @access private |
|
| 255 | + * @var \Wordlift_Entity_Post_Type_Service |
|
| 256 | + */ |
|
| 257 | + private $entity_post_type_service; |
|
| 258 | + |
|
| 259 | + /** |
|
| 260 | + * The entity link service used to mangle links to entities with a custom slug or even w/o a slug. |
|
| 261 | + * |
|
| 262 | + * @since 3.6.0 |
|
| 263 | + * @access private |
|
| 264 | + * @var \Wordlift_Entity_Link_Service $entity_link_service The {@link Wordlift_Entity_Link_Service} instance. |
|
| 265 | + */ |
|
| 266 | + private $entity_link_service; |
|
| 267 | + |
|
| 268 | + /** |
|
| 269 | + * A {@link Wordlift_Sparql_Service} instance. |
|
| 270 | + * |
|
| 271 | + * @since 3.6.0 |
|
| 272 | + * @access protected |
|
| 273 | + * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance. |
|
| 274 | + */ |
|
| 275 | + protected $sparql_service; |
|
| 276 | + |
|
| 277 | + /** |
|
| 278 | + * A {@link Wordlift_Import_Service} instance. |
|
| 279 | + * |
|
| 280 | + * @since 3.6.0 |
|
| 281 | + * @access private |
|
| 282 | + * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance. |
|
| 283 | + */ |
|
| 284 | + private $import_service; |
|
| 285 | + |
|
| 286 | + /** |
|
| 287 | + * A {@link Wordlift_Rebuild_Service} instance. |
|
| 288 | + * |
|
| 289 | + * @since 3.6.0 |
|
| 290 | + * @access private |
|
| 291 | + * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance. |
|
| 292 | + */ |
|
| 293 | + private $rebuild_service; |
|
| 294 | + |
|
| 295 | + /** |
|
| 296 | + * A {@link Wordlift_Jsonld_Service} instance. |
|
| 297 | + * |
|
| 298 | + * @since 3.7.0 |
|
| 299 | + * @access protected |
|
| 300 | + * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance. |
|
| 301 | + */ |
|
| 302 | + protected $jsonld_service; |
|
| 303 | + |
|
| 304 | + /** |
|
| 305 | + * A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 306 | + * |
|
| 307 | + * @since 3.14.0 |
|
| 308 | + * @access protected |
|
| 309 | + * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 310 | + */ |
|
| 311 | + protected $jsonld_website_converter; |
|
| 312 | + |
|
| 313 | + /** |
|
| 314 | + * A {@link Wordlift_Property_Factory} instance. |
|
| 315 | + * |
|
| 316 | + * @since 3.7.0 |
|
| 317 | + * @access private |
|
| 318 | + * @var \Wordlift_Property_Factory $property_factory |
|
| 319 | + */ |
|
| 320 | + private $property_factory; |
|
| 321 | + |
|
| 322 | + /** |
|
| 323 | + * The 'Download Your Data' page. |
|
| 324 | + * |
|
| 325 | + * @since 3.6.0 |
|
| 326 | + * @access private |
|
| 327 | + * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page. |
|
| 328 | + */ |
|
| 329 | + private $download_your_data_page; |
|
| 330 | + |
|
| 331 | + /** |
|
| 332 | + * The 'WordLift Settings' page. |
|
| 333 | + * |
|
| 334 | + * @since 3.11.0 |
|
| 335 | + * @access protected |
|
| 336 | + * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page. |
|
| 337 | + */ |
|
| 338 | + protected $settings_page; |
|
| 339 | + |
|
| 340 | + /** |
|
| 341 | + * The install wizard page. |
|
| 342 | + * |
|
| 343 | + * @since 3.9.0 |
|
| 344 | + * @access private |
|
| 345 | + * @var \Wordlift_Admin_Setup $admin_setup The Install wizard. |
|
| 346 | + */ |
|
| 347 | + public $admin_setup; |
|
| 348 | + |
|
| 349 | + /** |
|
| 350 | + * The Content Filter Service hooks up to the 'the_content' filter and provides |
|
| 351 | + * linking of entities to their pages. |
|
| 352 | + * |
|
| 353 | + * @since 3.8.0 |
|
| 354 | + * @access private |
|
| 355 | + * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance. |
|
| 356 | + */ |
|
| 357 | + private $content_filter_service; |
|
| 358 | + |
|
| 359 | + /** |
|
| 360 | + * The Faq Content filter service |
|
| 361 | + * @since 3.26.0 |
|
| 362 | + * @access private |
|
| 363 | + * @var Faq_Content_Filter $faq_content_filter_service A {@link Faq_Content_Filter} instance. |
|
| 364 | + */ |
|
| 365 | + private $faq_content_filter_service; |
|
| 366 | + |
|
| 367 | + /** |
|
| 368 | + * A {@link Wordlift_Key_Validation_Service} instance. |
|
| 369 | + * |
|
| 370 | + * @since 3.9.0 |
|
| 371 | + * @access private |
|
| 372 | + * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance. |
|
| 373 | + */ |
|
| 374 | + private $key_validation_service; |
|
| 375 | + |
|
| 376 | + /** |
|
| 377 | + * A {@link Wordlift_Rating_Service} instance. |
|
| 378 | + * |
|
| 379 | + * @since 3.10.0 |
|
| 380 | + * @access private |
|
| 381 | + * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance. |
|
| 382 | + */ |
|
| 383 | + private $rating_service; |
|
| 384 | + |
|
| 385 | + /** |
|
| 386 | + * A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 387 | + * |
|
| 388 | + * @since 3.10.0 |
|
| 389 | + * @access protected |
|
| 390 | + * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 391 | + */ |
|
| 392 | + protected $post_to_jsonld_converter; |
|
| 393 | + |
|
| 394 | + /** |
|
| 395 | + * A {@link Wordlift_Configuration_Service} instance. |
|
| 396 | + * |
|
| 397 | + * @since 3.10.0 |
|
| 398 | + * @access protected |
|
| 399 | + * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance. |
|
| 400 | + */ |
|
| 401 | + protected $configuration_service; |
|
| 402 | + |
|
| 403 | + /** |
|
| 404 | + * A {@link Wordlift_Install_Service} instance. |
|
| 405 | + * |
|
| 406 | + * @since 3.18.0 |
|
| 407 | + * @access protected |
|
| 408 | + * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance. |
|
| 409 | + */ |
|
| 410 | + protected $install_service; |
|
| 411 | + |
|
| 412 | + /** |
|
| 413 | + * A {@link Wordlift_Entity_Type_Service} instance. |
|
| 414 | + * |
|
| 415 | + * @since 3.10.0 |
|
| 416 | + * @access protected |
|
| 417 | + * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance. |
|
| 418 | + */ |
|
| 419 | + protected $entity_type_service; |
|
| 420 | + |
|
| 421 | + /** |
|
| 422 | + * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 423 | + * |
|
| 424 | + * @since 3.10.0 |
|
| 425 | + * @access protected |
|
| 426 | + * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 427 | + */ |
|
| 428 | + protected $entity_post_to_jsonld_converter; |
|
| 429 | + |
|
| 430 | + /** |
|
| 431 | + * A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 432 | + * |
|
| 433 | + * @since 3.10.0 |
|
| 434 | + * @access protected |
|
| 435 | + * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 436 | + */ |
|
| 437 | + protected $postid_to_jsonld_converter; |
|
| 438 | + |
|
| 439 | + /** |
|
| 440 | + * The {@link Wordlift_Admin_Status_Page} class. |
|
| 441 | + * |
|
| 442 | + * @since 3.9.8 |
|
| 443 | + * @access private |
|
| 444 | + * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class. |
|
| 445 | + */ |
|
| 446 | + private $status_page; |
|
| 447 | + |
|
| 448 | + /** |
|
| 449 | + * The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 450 | + * |
|
| 451 | + * @since 3.11.0 |
|
| 452 | + * @access protected |
|
| 453 | + * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 454 | + */ |
|
| 455 | + protected $category_taxonomy_service; |
|
| 456 | + |
|
| 457 | + /** |
|
| 458 | + * The {@link Wordlift_Entity_Page_Service} instance. |
|
| 459 | + * |
|
| 460 | + * @since 3.11.0 |
|
| 461 | + * @access protected |
|
| 462 | + * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance. |
|
| 463 | + */ |
|
| 464 | + protected $entity_page_service; |
|
| 465 | + |
|
| 466 | + /** |
|
| 467 | + * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 468 | + * |
|
| 469 | + * @since 3.11.0 |
|
| 470 | + * @access protected |
|
| 471 | + * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 472 | + */ |
|
| 473 | + protected $settings_page_action_link; |
|
| 474 | + |
|
| 475 | + /** |
|
| 476 | + * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 477 | + * |
|
| 478 | + * @since 3.11.0 |
|
| 479 | + * @access protected |
|
| 480 | + * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 481 | + */ |
|
| 482 | + protected $analytics_settings_page_action_link; |
|
| 483 | + |
|
| 484 | + /** |
|
| 485 | + * The {@link Wordlift_Analytics_Connect} class. |
|
| 486 | + * |
|
| 487 | + * @since 3.11.0 |
|
| 488 | + * @access protected |
|
| 489 | + * @var \Wordlift_Analytics_Connect $analytics_connect The {@link Wordlift_Analytics_Connect} class. |
|
| 490 | + */ |
|
| 491 | + protected $analytics_connect; |
|
| 492 | + |
|
| 493 | + /** |
|
| 494 | + * The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 495 | + * |
|
| 496 | + * @since 3.11.0 |
|
| 497 | + * @access protected |
|
| 498 | + * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 499 | + */ |
|
| 500 | + protected $publisher_ajax_adapter; |
|
| 501 | + |
|
| 502 | + /** |
|
| 503 | + * The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 504 | + * |
|
| 505 | + * @since 3.11.0 |
|
| 506 | + * @access protected |
|
| 507 | + * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 508 | + */ |
|
| 509 | + protected $input_element; |
|
| 510 | + |
|
| 511 | + /** |
|
| 512 | + * The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 513 | + * |
|
| 514 | + * @since 3.13.0 |
|
| 515 | + * @access protected |
|
| 516 | + * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 517 | + */ |
|
| 518 | + protected $radio_input_element; |
|
| 519 | + |
|
| 520 | + /** |
|
| 521 | + * The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 522 | + * |
|
| 523 | + * @since 3.11.0 |
|
| 524 | + * @access protected |
|
| 525 | + * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 526 | + */ |
|
| 527 | + protected $language_select_element; |
|
| 528 | + |
|
| 529 | + /** |
|
| 530 | + * The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
| 531 | + * |
|
| 532 | + * @since 3.18.0 |
|
| 533 | + * @access protected |
|
| 534 | + * @var \Wordlift_Admin_Country_Select_Element $country_select_element The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
| 535 | + */ |
|
| 536 | + protected $country_select_element; |
|
| 537 | + |
|
| 538 | + /** |
|
| 539 | + * The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 540 | + * |
|
| 541 | + * @since 3.11.0 |
|
| 542 | + * @access protected |
|
| 543 | + * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 544 | + */ |
|
| 545 | + protected $publisher_element; |
|
| 546 | + |
|
| 547 | + /** |
|
| 548 | + * The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 549 | + * |
|
| 550 | + * @since 3.11.0 |
|
| 551 | + * @access protected |
|
| 552 | + * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 553 | + */ |
|
| 554 | + protected $select2_element; |
|
| 555 | + |
|
| 556 | + /** |
|
| 557 | + * The controller for the entity type list admin page |
|
| 558 | + * |
|
| 559 | + * @since 3.11.0 |
|
| 560 | + * @access private |
|
| 561 | + * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class. |
|
| 562 | + */ |
|
| 563 | + private $entity_type_admin_page; |
|
| 564 | + |
|
| 565 | + /** |
|
| 566 | + * The controller for the entity type settings admin page |
|
| 567 | + * |
|
| 568 | + * @since 3.11.0 |
|
| 569 | + * @access private |
|
| 570 | + * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class. |
|
| 571 | + */ |
|
| 572 | + private $entity_type_settings_admin_page; |
|
| 573 | + |
|
| 574 | + /** |
|
| 575 | + * The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 576 | + * |
|
| 577 | + * @since 3.11.0 |
|
| 578 | + * @access protected |
|
| 579 | + * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 580 | + */ |
|
| 581 | + protected $related_entities_cloud_widget; |
|
| 582 | + |
|
| 583 | + /** |
|
| 584 | + * The {@link Wordlift_Admin_Author_Element} instance. |
|
| 585 | + * |
|
| 586 | + * @since 3.14.0 |
|
| 587 | + * @access protected |
|
| 588 | + * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance. |
|
| 589 | + */ |
|
| 590 | + protected $author_element; |
|
| 591 | + |
|
| 592 | + /** |
|
| 593 | + * The {@link Wordlift_Sample_Data_Service} instance. |
|
| 594 | + * |
|
| 595 | + * @since 3.12.0 |
|
| 596 | + * @access protected |
|
| 597 | + * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance. |
|
| 598 | + */ |
|
| 599 | + protected $sample_data_service; |
|
| 600 | + |
|
| 601 | + /** |
|
| 602 | + * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 603 | + * |
|
| 604 | + * @since 3.12.0 |
|
| 605 | + * @access protected |
|
| 606 | + * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 607 | + */ |
|
| 608 | + protected $sample_data_ajax_adapter; |
|
| 609 | + |
|
| 610 | + /** |
|
| 611 | + * The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 612 | + * |
|
| 613 | + * @since 3.14.3 |
|
| 614 | + * @access private |
|
| 615 | + * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 616 | + */ |
|
| 617 | + private $relation_rebuild_service; |
|
| 618 | + |
|
| 619 | + /** |
|
| 620 | + * The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 621 | + * |
|
| 622 | + * @since 3.14.3 |
|
| 623 | + * @access private |
|
| 624 | + * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 625 | + */ |
|
| 626 | + private $relation_rebuild_adapter; |
|
| 627 | + |
|
| 628 | + /** |
|
| 629 | + * The {@link Wordlift_Reference_Rebuild_Service} instance. |
|
| 630 | + * |
|
| 631 | + * @since 3.18.0 |
|
| 632 | + * @access private |
|
| 633 | + * @var \Wordlift_Reference_Rebuild_Service $reference_rebuild_service The {@link Wordlift_Reference_Rebuild_Service} instance. |
|
| 634 | + */ |
|
| 635 | + private $reference_rebuild_service; |
|
| 636 | + |
|
| 637 | + /** |
|
| 638 | + * The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 639 | + * |
|
| 640 | + * @since 3.16.0 |
|
| 641 | + * @access protected |
|
| 642 | + * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 643 | + */ |
|
| 644 | + protected $google_analytics_export_service; |
|
| 645 | + |
|
| 646 | + /** |
|
| 647 | + * {@link Wordlift}'s singleton instance. |
|
| 648 | + * |
|
| 649 | + * @since 3.15.0 |
|
| 650 | + * @access protected |
|
| 651 | + * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance. |
|
| 652 | + */ |
|
| 653 | + protected $entity_type_adapter; |
|
| 654 | + |
|
| 655 | + /** |
|
| 656 | + * The {@link Wordlift_Storage_Factory} instance. |
|
| 657 | + * |
|
| 658 | + * @since 3.15.0 |
|
| 659 | + * @access protected |
|
| 660 | + * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance. |
|
| 661 | + */ |
|
| 662 | + protected $storage_factory; |
|
| 663 | + |
|
| 664 | + /** |
|
| 665 | + * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 666 | + * |
|
| 667 | + * @since 3.15.0 |
|
| 668 | + * @access protected |
|
| 669 | + * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 670 | + */ |
|
| 671 | + protected $rendition_factory; |
|
| 672 | + |
|
| 673 | + /** |
|
| 674 | + * The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 675 | + * |
|
| 676 | + * @since 3.15.0 |
|
| 677 | + * @access private |
|
| 678 | + * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 679 | + */ |
|
| 680 | + private $autocomplete_adapter; |
|
| 681 | + |
|
| 682 | + /** |
|
| 683 | + * The {@link Wordlift_Relation_Service} instance. |
|
| 684 | + * |
|
| 685 | + * @since 3.15.0 |
|
| 686 | + * @access protected |
|
| 687 | + * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance. |
|
| 688 | + */ |
|
| 689 | + protected $relation_service; |
|
| 690 | + |
|
| 691 | + /** |
|
| 692 | + * The {@link Wordlift_Cached_Post_Converter} instance. |
|
| 693 | + * |
|
| 694 | + * @since 3.16.0 |
|
| 695 | + * @access protected |
|
| 696 | + * @var \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance. |
|
| 697 | + * |
|
| 698 | + */ |
|
| 699 | + protected $cached_postid_to_jsonld_converter; |
|
| 700 | + |
|
| 701 | + /** |
|
| 702 | + * The {@link Wordlift_Entity_Uri_Service} instance. |
|
| 703 | + * |
|
| 704 | + * @since 3.16.3 |
|
| 705 | + * @access protected |
|
| 706 | + * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance. |
|
| 707 | + */ |
|
| 708 | + protected $entity_uri_service; |
|
| 709 | + |
|
| 710 | + /** |
|
| 711 | + * The {@link Wordlift_Publisher_Service} instance. |
|
| 712 | + * |
|
| 713 | + * @since 3.19.0 |
|
| 714 | + * @access protected |
|
| 715 | + * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance. |
|
| 716 | + */ |
|
| 717 | + protected $publisher_service; |
|
| 718 | + |
|
| 719 | + /** |
|
| 720 | + * The {@link Wordlift_Context_Cards_Service} instance. |
|
| 721 | + * |
|
| 722 | + * @var \Wordlift_Context_Cards_Service The {@link Wordlift_Context_Cards_Service} instance. |
|
| 723 | + */ |
|
| 724 | + protected $context_cards_service; |
|
| 725 | + |
|
| 726 | + /** |
|
| 727 | + * {@link Wordlift}'s singleton instance. |
|
| 728 | + * |
|
| 729 | + * @since 3.11.2 |
|
| 730 | + * @access private |
|
| 731 | + * @var Wordlift $instance {@link Wordlift}'s singleton instance. |
|
| 732 | + */ |
|
| 733 | + private static $instance; |
|
| 734 | + |
|
| 735 | + //</editor-fold> |
|
| 736 | + |
|
| 737 | + /** |
|
| 738 | + * Define the core functionality of the plugin. |
|
| 739 | + * |
|
| 740 | + * Set the plugin name and the plugin version that can be used throughout the plugin. |
|
| 741 | + * Load the dependencies, define the locale, and set the hooks for the admin area and |
|
| 742 | + * the public-facing side of the site. |
|
| 743 | + * |
|
| 744 | + * @since 1.0.0 |
|
| 745 | + */ |
|
| 746 | + public function __construct() { |
|
| 747 | + |
|
| 748 | + self::$instance = $this; |
|
| 749 | + |
|
| 750 | + $this->plugin_name = 'wordlift'; |
|
| 751 | + $this->version = '3.27.6.1'; |
|
| 752 | + $this->load_dependencies(); |
|
| 753 | + $this->set_locale(); |
|
| 754 | + $this->define_admin_hooks(); |
|
| 755 | + $this->define_public_hooks(); |
|
| 756 | + |
|
| 757 | + // If we're in `WP_CLI` load the related files. |
|
| 758 | + if ( class_exists( 'WP_CLI' ) ) { |
|
| 759 | + $this->load_cli_dependencies(); |
|
| 760 | + } |
|
| 761 | + |
|
| 762 | + } |
|
| 763 | + |
|
| 764 | + /** |
|
| 765 | + * Get the singleton instance. |
|
| 766 | + * |
|
| 767 | + * @return Wordlift The {@link Wordlift} singleton instance. |
|
| 768 | + * @since 3.11.2 |
|
| 769 | + * |
|
| 770 | + */ |
|
| 771 | + public static function get_instance() { |
|
| 772 | + |
|
| 773 | + return self::$instance; |
|
| 774 | + } |
|
| 775 | + |
|
| 776 | + /** |
|
| 777 | + * Load the required dependencies for this plugin. |
|
| 778 | + * |
|
| 779 | + * Include the following files that make up the plugin: |
|
| 780 | + * |
|
| 781 | + * - Wordlift_Loader. Orchestrates the hooks of the plugin. |
|
| 782 | + * - Wordlift_i18n. Defines internationalization functionality. |
|
| 783 | + * - Wordlift_Admin. Defines all hooks for the admin area. |
|
| 784 | + * - Wordlift_Public. Defines all hooks for the public side of the site. |
|
| 785 | + * |
|
| 786 | + * Create an instance of the loader which will be used to register the hooks |
|
| 787 | + * with WordPress. |
|
| 788 | + * |
|
| 789 | + * @throws Exception |
|
| 790 | + * @since 1.0.0 |
|
| 791 | + * @access private |
|
| 792 | + */ |
|
| 793 | + private function load_dependencies() { |
|
| 794 | + |
|
| 795 | + /** |
|
| 796 | + * The class responsible for orchestrating the actions and filters of the |
|
| 797 | + * core plugin. |
|
| 798 | + */ |
|
| 799 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 800 | + |
|
| 801 | + // The class responsible for plugin uninstall. |
|
| 802 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
|
| 803 | + |
|
| 804 | + /** |
|
| 805 | + * The class responsible for defining internationalization functionality |
|
| 806 | + * of the plugin. |
|
| 807 | + */ |
|
| 808 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 809 | + |
|
| 810 | + /** |
|
| 811 | + * WordLift's supported languages. |
|
| 812 | + */ |
|
| 813 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 814 | + |
|
| 815 | + /** |
|
| 816 | + * WordLift's supported countries. |
|
| 817 | + */ |
|
| 818 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php'; |
|
| 819 | + |
|
| 820 | + /** |
|
| 821 | + * Provide support functions to sanitize data. |
|
| 822 | + */ |
|
| 823 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 824 | + |
|
| 825 | + /** Services. */ |
|
| 826 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 827 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
|
| 828 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 829 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 830 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 831 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 832 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 833 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
|
| 834 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 835 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php'; |
|
| 836 | + |
|
| 837 | + /** |
|
| 838 | + * The Query builder. |
|
| 839 | + */ |
|
| 840 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 841 | + |
|
| 842 | + /** |
|
| 843 | + * The Schema service. |
|
| 844 | + */ |
|
| 845 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 846 | + |
|
| 847 | + /** |
|
| 848 | + * The schema:url property service. |
|
| 849 | + */ |
|
| 850 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 851 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 852 | + |
|
| 853 | + /** |
|
| 854 | + * The UI service. |
|
| 855 | + */ |
|
| 856 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 857 | + |
|
| 858 | + /** |
|
| 859 | + * The Thumbnail service. |
|
| 860 | + */ |
|
| 861 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 862 | + |
|
| 863 | + /** |
|
| 864 | + * The Entity Types Taxonomy service. |
|
| 865 | + */ |
|
| 866 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 867 | + |
|
| 868 | + /** |
|
| 869 | + * The Entity service. |
|
| 870 | + */ |
|
| 871 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
|
| 872 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 873 | + |
|
| 874 | + // Add the entity rating service. |
|
| 875 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 876 | + |
|
| 877 | + /** |
|
| 878 | + * The User service. |
|
| 879 | + */ |
|
| 880 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 881 | + |
|
| 882 | + /** |
|
| 883 | + * The Timeline service. |
|
| 884 | + */ |
|
| 885 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 886 | + |
|
| 887 | + /** |
|
| 888 | + * The Topic Taxonomy service. |
|
| 889 | + */ |
|
| 890 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 891 | + |
|
| 892 | + /** |
|
| 893 | + * The SPARQL service. |
|
| 894 | + */ |
|
| 895 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 896 | + |
|
| 897 | + /** |
|
| 898 | + * The WordLift import service. |
|
| 899 | + */ |
|
| 900 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 901 | + |
|
| 902 | + /** |
|
| 903 | + * The WordLift URI service. |
|
| 904 | + */ |
|
| 905 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 906 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 907 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 908 | + |
|
| 909 | + /** |
|
| 910 | + * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
|
| 911 | + */ |
|
| 912 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php'; |
|
| 913 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php'; |
|
| 914 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php'; |
|
| 915 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php'; |
|
| 916 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php'; |
|
| 917 | + |
|
| 918 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 919 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 920 | + |
|
| 921 | + /** |
|
| 922 | + * Load the converters. |
|
| 923 | + */ |
|
| 924 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 925 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 926 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 927 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 928 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 929 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 930 | + |
|
| 931 | + /** |
|
| 932 | + * Load cache-related files. |
|
| 933 | + */ |
|
| 934 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
|
| 935 | + |
|
| 936 | + /** |
|
| 937 | + * Load the content filter. |
|
| 938 | + */ |
|
| 939 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 940 | + |
|
| 941 | + /* |
|
| 942 | 942 | * Load the excerpt helper. |
| 943 | 943 | */ |
| 944 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 945 | - |
|
| 946 | - /** |
|
| 947 | - * Load the JSON-LD service to publish entities using JSON-LD.s |
|
| 948 | - * |
|
| 949 | - * @since 3.8.0 |
|
| 950 | - */ |
|
| 951 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 952 | - |
|
| 953 | - // The Publisher Service and the AJAX adapter. |
|
| 954 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 955 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 956 | - |
|
| 957 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 958 | - |
|
| 959 | - /** |
|
| 960 | - * Load the WordLift key validation service. |
|
| 961 | - */ |
|
| 962 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 963 | - |
|
| 964 | - // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
|
| 965 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 966 | - |
|
| 967 | - // Load the `Wordlift_Entity_Page_Service` class definition. |
|
| 968 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
| 969 | - |
|
| 970 | - /** Linked Data. */ |
|
| 971 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 972 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 973 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 974 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 975 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 976 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 977 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 978 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 979 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 980 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 981 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 982 | - |
|
| 983 | - /** Linked Data Rendition. */ |
|
| 984 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php'; |
|
| 985 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php'; |
|
| 986 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php'; |
|
| 987 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 988 | - |
|
| 989 | - /** Services. */ |
|
| 990 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 991 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php'; |
|
| 992 | - |
|
| 993 | - /** Adapters. */ |
|
| 994 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 995 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 996 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 997 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 998 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php'; |
|
| 999 | - |
|
| 1000 | - /** Async Tasks. */ |
|
| 1001 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php'; |
|
| 1002 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 1003 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php'; |
|
| 1004 | - |
|
| 1005 | - /** Autocomplete. */ |
|
| 1006 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 1007 | - |
|
| 1008 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
|
| 1009 | - |
|
| 1010 | - /** Analytics */ |
|
| 1011 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 1012 | - |
|
| 1013 | - /** |
|
| 1014 | - * The class responsible for defining all actions that occur in the admin area. |
|
| 1015 | - */ |
|
| 1016 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 1017 | - |
|
| 1018 | - /** |
|
| 1019 | - * The class to customize the entity list admin page. |
|
| 1020 | - */ |
|
| 1021 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 1022 | - |
|
| 1023 | - /** |
|
| 1024 | - * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
|
| 1025 | - */ |
|
| 1026 | - global $wp_version; |
|
| 1027 | - if ( version_compare( $wp_version, '5.3', '<' ) ) { |
|
| 1028 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 1029 | - } else { |
|
| 1030 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
| 1031 | - } |
|
| 1032 | - |
|
| 1033 | - /** |
|
| 1034 | - * The Notice service. |
|
| 1035 | - */ |
|
| 1036 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 1037 | - |
|
| 1038 | - /** |
|
| 1039 | - * The PrimaShop adapter. |
|
| 1040 | - */ |
|
| 1041 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 1042 | - |
|
| 1043 | - /** |
|
| 1044 | - * The WordLift Dashboard service. |
|
| 1045 | - */ |
|
| 1046 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 1047 | - |
|
| 1048 | - /** |
|
| 1049 | - * The admin 'Install wizard' page. |
|
| 1050 | - */ |
|
| 1051 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 1052 | - |
|
| 1053 | - /** |
|
| 1054 | - * The WordLift entity type list admin page controller. |
|
| 1055 | - */ |
|
| 1056 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 1057 | - |
|
| 1058 | - /** |
|
| 1059 | - * The WordLift entity type settings admin page controller. |
|
| 1060 | - */ |
|
| 1061 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 1062 | - |
|
| 1063 | - /** |
|
| 1064 | - * The admin 'Download Your Data' page. |
|
| 1065 | - */ |
|
| 1066 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 1067 | - |
|
| 1068 | - /** |
|
| 1069 | - * The admin 'WordLift Settings' page. |
|
| 1070 | - */ |
|
| 1071 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php'; |
|
| 1072 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 1073 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 1074 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 1075 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 1076 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 1077 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 1078 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 1079 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 1080 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 1081 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 1082 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 1083 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
| 1084 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 1085 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
| 1086 | - |
|
| 1087 | - /** Admin Pages */ |
|
| 1088 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 1089 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 1090 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-page.php'; |
|
| 1091 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 1092 | - |
|
| 1093 | - /** |
|
| 1094 | - * The class responsible for defining all actions that occur in the public-facing |
|
| 1095 | - * side of the site. |
|
| 1096 | - */ |
|
| 1097 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 1098 | - |
|
| 1099 | - /** |
|
| 1100 | - * The shortcode abstract class. |
|
| 1101 | - */ |
|
| 1102 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 1103 | - |
|
| 1104 | - /** |
|
| 1105 | - * The Timeline shortcode. |
|
| 1106 | - */ |
|
| 1107 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 1108 | - |
|
| 1109 | - /** |
|
| 1110 | - * The Navigator shortcode. |
|
| 1111 | - */ |
|
| 1112 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 1113 | - |
|
| 1114 | - /** |
|
| 1115 | - * The Products Navigator shortcode. |
|
| 1116 | - */ |
|
| 1117 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php'; |
|
| 1118 | - |
|
| 1119 | - /** |
|
| 1120 | - * The chord shortcode. |
|
| 1121 | - */ |
|
| 1122 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 1123 | - |
|
| 1124 | - /** |
|
| 1125 | - * The geomap shortcode. |
|
| 1126 | - */ |
|
| 1127 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 1128 | - |
|
| 1129 | - /** |
|
| 1130 | - * The entity cloud shortcode. |
|
| 1131 | - */ |
|
| 1132 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 1133 | - |
|
| 1134 | - /** |
|
| 1135 | - * The entity glossary shortcode. |
|
| 1136 | - */ |
|
| 1137 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
|
| 1138 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 1139 | - |
|
| 1140 | - /** |
|
| 1141 | - * Faceted Search shortcode. |
|
| 1142 | - */ |
|
| 1143 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 1144 | - |
|
| 1145 | - /** |
|
| 1146 | - * The ShareThis service. |
|
| 1147 | - */ |
|
| 1148 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 1149 | - |
|
| 1150 | - /** |
|
| 1151 | - * The SEO service. |
|
| 1152 | - */ |
|
| 1153 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 1154 | - |
|
| 1155 | - /** |
|
| 1156 | - * The AMP service. |
|
| 1157 | - */ |
|
| 1158 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1159 | - |
|
| 1160 | - /** Widgets */ |
|
| 1161 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1162 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1163 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php'; |
|
| 1164 | - |
|
| 1165 | - /* |
|
| 944 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 945 | + |
|
| 946 | + /** |
|
| 947 | + * Load the JSON-LD service to publish entities using JSON-LD.s |
|
| 948 | + * |
|
| 949 | + * @since 3.8.0 |
|
| 950 | + */ |
|
| 951 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 952 | + |
|
| 953 | + // The Publisher Service and the AJAX adapter. |
|
| 954 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 955 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 956 | + |
|
| 957 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 958 | + |
|
| 959 | + /** |
|
| 960 | + * Load the WordLift key validation service. |
|
| 961 | + */ |
|
| 962 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 963 | + |
|
| 964 | + // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
|
| 965 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 966 | + |
|
| 967 | + // Load the `Wordlift_Entity_Page_Service` class definition. |
|
| 968 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
| 969 | + |
|
| 970 | + /** Linked Data. */ |
|
| 971 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 972 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 973 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 974 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 975 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 976 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 977 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 978 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 979 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 980 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 981 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 982 | + |
|
| 983 | + /** Linked Data Rendition. */ |
|
| 984 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php'; |
|
| 985 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php'; |
|
| 986 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php'; |
|
| 987 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 988 | + |
|
| 989 | + /** Services. */ |
|
| 990 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 991 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php'; |
|
| 992 | + |
|
| 993 | + /** Adapters. */ |
|
| 994 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 995 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 996 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 997 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 998 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php'; |
|
| 999 | + |
|
| 1000 | + /** Async Tasks. */ |
|
| 1001 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php'; |
|
| 1002 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 1003 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php'; |
|
| 1004 | + |
|
| 1005 | + /** Autocomplete. */ |
|
| 1006 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 1007 | + |
|
| 1008 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
|
| 1009 | + |
|
| 1010 | + /** Analytics */ |
|
| 1011 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 1012 | + |
|
| 1013 | + /** |
|
| 1014 | + * The class responsible for defining all actions that occur in the admin area. |
|
| 1015 | + */ |
|
| 1016 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 1017 | + |
|
| 1018 | + /** |
|
| 1019 | + * The class to customize the entity list admin page. |
|
| 1020 | + */ |
|
| 1021 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 1022 | + |
|
| 1023 | + /** |
|
| 1024 | + * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
|
| 1025 | + */ |
|
| 1026 | + global $wp_version; |
|
| 1027 | + if ( version_compare( $wp_version, '5.3', '<' ) ) { |
|
| 1028 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 1029 | + } else { |
|
| 1030 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
| 1031 | + } |
|
| 1032 | + |
|
| 1033 | + /** |
|
| 1034 | + * The Notice service. |
|
| 1035 | + */ |
|
| 1036 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 1037 | + |
|
| 1038 | + /** |
|
| 1039 | + * The PrimaShop adapter. |
|
| 1040 | + */ |
|
| 1041 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 1042 | + |
|
| 1043 | + /** |
|
| 1044 | + * The WordLift Dashboard service. |
|
| 1045 | + */ |
|
| 1046 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 1047 | + |
|
| 1048 | + /** |
|
| 1049 | + * The admin 'Install wizard' page. |
|
| 1050 | + */ |
|
| 1051 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 1052 | + |
|
| 1053 | + /** |
|
| 1054 | + * The WordLift entity type list admin page controller. |
|
| 1055 | + */ |
|
| 1056 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 1057 | + |
|
| 1058 | + /** |
|
| 1059 | + * The WordLift entity type settings admin page controller. |
|
| 1060 | + */ |
|
| 1061 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 1062 | + |
|
| 1063 | + /** |
|
| 1064 | + * The admin 'Download Your Data' page. |
|
| 1065 | + */ |
|
| 1066 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 1067 | + |
|
| 1068 | + /** |
|
| 1069 | + * The admin 'WordLift Settings' page. |
|
| 1070 | + */ |
|
| 1071 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php'; |
|
| 1072 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 1073 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 1074 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 1075 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 1076 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 1077 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 1078 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 1079 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 1080 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 1081 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 1082 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 1083 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
| 1084 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 1085 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
| 1086 | + |
|
| 1087 | + /** Admin Pages */ |
|
| 1088 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 1089 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 1090 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-page.php'; |
|
| 1091 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 1092 | + |
|
| 1093 | + /** |
|
| 1094 | + * The class responsible for defining all actions that occur in the public-facing |
|
| 1095 | + * side of the site. |
|
| 1096 | + */ |
|
| 1097 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 1098 | + |
|
| 1099 | + /** |
|
| 1100 | + * The shortcode abstract class. |
|
| 1101 | + */ |
|
| 1102 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 1103 | + |
|
| 1104 | + /** |
|
| 1105 | + * The Timeline shortcode. |
|
| 1106 | + */ |
|
| 1107 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 1108 | + |
|
| 1109 | + /** |
|
| 1110 | + * The Navigator shortcode. |
|
| 1111 | + */ |
|
| 1112 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 1113 | + |
|
| 1114 | + /** |
|
| 1115 | + * The Products Navigator shortcode. |
|
| 1116 | + */ |
|
| 1117 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php'; |
|
| 1118 | + |
|
| 1119 | + /** |
|
| 1120 | + * The chord shortcode. |
|
| 1121 | + */ |
|
| 1122 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 1123 | + |
|
| 1124 | + /** |
|
| 1125 | + * The geomap shortcode. |
|
| 1126 | + */ |
|
| 1127 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 1128 | + |
|
| 1129 | + /** |
|
| 1130 | + * The entity cloud shortcode. |
|
| 1131 | + */ |
|
| 1132 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 1133 | + |
|
| 1134 | + /** |
|
| 1135 | + * The entity glossary shortcode. |
|
| 1136 | + */ |
|
| 1137 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
|
| 1138 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 1139 | + |
|
| 1140 | + /** |
|
| 1141 | + * Faceted Search shortcode. |
|
| 1142 | + */ |
|
| 1143 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 1144 | + |
|
| 1145 | + /** |
|
| 1146 | + * The ShareThis service. |
|
| 1147 | + */ |
|
| 1148 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 1149 | + |
|
| 1150 | + /** |
|
| 1151 | + * The SEO service. |
|
| 1152 | + */ |
|
| 1153 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 1154 | + |
|
| 1155 | + /** |
|
| 1156 | + * The AMP service. |
|
| 1157 | + */ |
|
| 1158 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1159 | + |
|
| 1160 | + /** Widgets */ |
|
| 1161 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1162 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1163 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php'; |
|
| 1164 | + |
|
| 1165 | + /* |
|
| 1166 | 1166 | * Schema.org Services. |
| 1167 | 1167 | * |
| 1168 | 1168 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1169 | 1169 | */ |
| 1170 | - if ( WL_ALL_ENTITY_TYPES ) { |
|
| 1171 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1172 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1173 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1174 | - new Wordlift_Schemaorg_Sync_Service(); |
|
| 1175 | - $schemaorg_property_service = new Wordlift_Schemaorg_Property_Service(); |
|
| 1176 | - new Wordlift_Schemaorg_Class_Service(); |
|
| 1177 | - } else { |
|
| 1178 | - $schemaorg_property_service = null; |
|
| 1179 | - } |
|
| 1170 | + if ( WL_ALL_ENTITY_TYPES ) { |
|
| 1171 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1172 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1173 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1174 | + new Wordlift_Schemaorg_Sync_Service(); |
|
| 1175 | + $schemaorg_property_service = new Wordlift_Schemaorg_Property_Service(); |
|
| 1176 | + new Wordlift_Schemaorg_Class_Service(); |
|
| 1177 | + } else { |
|
| 1178 | + $schemaorg_property_service = null; |
|
| 1179 | + } |
|
| 1180 | 1180 | |
| 1181 | - $this->loader = new Wordlift_Loader(); |
|
| 1181 | + $this->loader = new Wordlift_Loader(); |
|
| 1182 | 1182 | |
| 1183 | - // Instantiate a global logger. |
|
| 1184 | - global $wl_logger; |
|
| 1185 | - $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1183 | + // Instantiate a global logger. |
|
| 1184 | + global $wl_logger; |
|
| 1185 | + $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1186 | 1186 | |
| 1187 | - // Load the `wl-api` end-point. |
|
| 1188 | - new Wordlift_Http_Api(); |
|
| 1187 | + // Load the `wl-api` end-point. |
|
| 1188 | + new Wordlift_Http_Api(); |
|
| 1189 | 1189 | |
| 1190 | - // Load the Install Service. |
|
| 1191 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
|
| 1192 | - $this->install_service = new Wordlift_Install_Service(); |
|
| 1190 | + // Load the Install Service. |
|
| 1191 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
|
| 1192 | + $this->install_service = new Wordlift_Install_Service(); |
|
| 1193 | 1193 | |
| 1194 | - /** Services. */ |
|
| 1195 | - // Create the configuration service. |
|
| 1196 | - $this->configuration_service = new Wordlift_Configuration_Service(); |
|
| 1197 | - $api_service = new Wordlift_Api_Service( $this->configuration_service ); |
|
| 1194 | + /** Services. */ |
|
| 1195 | + // Create the configuration service. |
|
| 1196 | + $this->configuration_service = new Wordlift_Configuration_Service(); |
|
| 1197 | + $api_service = new Wordlift_Api_Service( $this->configuration_service ); |
|
| 1198 | 1198 | |
| 1199 | - // Create an entity type service instance. It'll be later bound to the init action. |
|
| 1200 | - $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 1199 | + // Create an entity type service instance. It'll be later bound to the init action. |
|
| 1200 | + $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 1201 | 1201 | |
| 1202 | - // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
|
| 1203 | - $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 1202 | + // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
|
| 1203 | + $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 1204 | 1204 | |
| 1205 | - // Create an instance of the UI service. |
|
| 1206 | - $this->ui_service = new Wordlift_UI_Service(); |
|
| 1205 | + // Create an instance of the UI service. |
|
| 1206 | + $this->ui_service = new Wordlift_UI_Service(); |
|
| 1207 | 1207 | |
| 1208 | - // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events. |
|
| 1209 | - $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
|
| 1208 | + // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events. |
|
| 1209 | + $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
|
| 1210 | 1210 | |
| 1211 | - $this->sparql_service = new Wordlift_Sparql_Service(); |
|
| 1212 | - $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 1213 | - $this->notice_service = new Wordlift_Notice_Service(); |
|
| 1214 | - $this->relation_service = new Wordlift_Relation_Service(); |
|
| 1211 | + $this->sparql_service = new Wordlift_Sparql_Service(); |
|
| 1212 | + $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 1213 | + $this->notice_service = new Wordlift_Notice_Service(); |
|
| 1214 | + $this->relation_service = new Wordlift_Relation_Service(); |
|
| 1215 | 1215 | |
| 1216 | - $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' ); |
|
| 1217 | - $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service ); |
|
| 1218 | - $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service ); |
|
| 1219 | - $this->user_service = new Wordlift_User_Service( $this->sparql_service, $this->entity_service ); |
|
| 1216 | + $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' ); |
|
| 1217 | + $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service ); |
|
| 1218 | + $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service ); |
|
| 1219 | + $this->user_service = new Wordlift_User_Service( $this->sparql_service, $this->entity_service ); |
|
| 1220 | 1220 | |
| 1221 | - // Instantiate the JSON-LD service. |
|
| 1222 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1221 | + // Instantiate the JSON-LD service. |
|
| 1222 | + $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1223 | 1223 | |
| 1224 | - /** Linked Data. */ |
|
| 1225 | - $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
|
| 1226 | - $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
|
| 1224 | + /** Linked Data. */ |
|
| 1225 | + $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
|
| 1226 | + $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
|
| 1227 | 1227 | |
| 1228 | - $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
|
| 1228 | + $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
|
| 1229 | 1229 | |
| 1230 | - // Create a new instance of the Redirect service. |
|
| 1231 | - $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_uri_service ); |
|
| 1232 | - $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 1230 | + // Create a new instance of the Redirect service. |
|
| 1231 | + $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_uri_service ); |
|
| 1232 | + $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 1233 | 1233 | |
| 1234 | - if ( ! apply_filters( 'wl_feature__enable__dataset-ng', false ) ) { |
|
| 1235 | - new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service ); |
|
| 1236 | - } |
|
| 1234 | + if ( ! apply_filters( 'wl_feature__enable__dataset-ng', false ) ) { |
|
| 1235 | + new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service ); |
|
| 1236 | + } |
|
| 1237 | 1237 | |
| 1238 | - // Create a new instance of the Timeline service and Timeline shortcode. |
|
| 1239 | - $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
|
| 1238 | + // Create a new instance of the Timeline service and Timeline shortcode. |
|
| 1239 | + $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
|
| 1240 | 1240 | |
| 1241 | - $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
|
| 1241 | + $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
|
| 1242 | 1242 | |
| 1243 | - $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
|
| 1244 | - $this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service(); |
|
| 1243 | + $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
|
| 1244 | + $this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service(); |
|
| 1245 | 1245 | |
| 1246 | - // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
|
| 1247 | - $this->sharethis_service = new Wordlift_ShareThis_Service(); |
|
| 1246 | + // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
|
| 1247 | + $this->sharethis_service = new Wordlift_ShareThis_Service(); |
|
| 1248 | 1248 | |
| 1249 | - // Create an instance of the PrimaShop adapter. |
|
| 1250 | - $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
|
| 1249 | + // Create an instance of the PrimaShop adapter. |
|
| 1250 | + $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
|
| 1251 | 1251 | |
| 1252 | - // Create an import service instance to hook later to WP's import function. |
|
| 1253 | - $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() ); |
|
| 1252 | + // Create an import service instance to hook later to WP's import function. |
|
| 1253 | + $this->import_service = new Wordlift_Import_Service( $this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri() ); |
|
| 1254 | 1254 | |
| 1255 | - $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1255 | + $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1256 | 1256 | |
| 1257 | - // Create the entity rating service. |
|
| 1258 | - $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 1257 | + // Create the entity rating service. |
|
| 1258 | + $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 1259 | 1259 | |
| 1260 | - // Create entity list customization (wp-admin/edit.php). |
|
| 1261 | - $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 1260 | + // Create entity list customization (wp-admin/edit.php). |
|
| 1261 | + $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 1262 | 1262 | |
| 1263 | - // Create a new instance of the Redirect service. |
|
| 1264 | - $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
|
| 1263 | + // Create a new instance of the Redirect service. |
|
| 1264 | + $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
|
| 1265 | 1265 | |
| 1266 | - // Create an instance of the Publisher Service and the AJAX Adapter. |
|
| 1267 | - $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service ); |
|
| 1268 | - $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1269 | - $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1266 | + // Create an instance of the Publisher Service and the AJAX Adapter. |
|
| 1267 | + $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service ); |
|
| 1268 | + $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1269 | + $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1270 | 1270 | |
| 1271 | - $attachment_service = new Wordlift_Attachment_Service(); |
|
| 1271 | + $attachment_service = new Wordlift_Attachment_Service(); |
|
| 1272 | 1272 | |
| 1273 | - // Instantiate the JSON-LD service. |
|
| 1274 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1275 | - $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 ); |
|
| 1276 | - $this->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $this->post_to_jsonld_converter ); |
|
| 1277 | - $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 ); |
|
| 1278 | - $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
|
| 1273 | + // Instantiate the JSON-LD service. |
|
| 1274 | + $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1275 | + $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 ); |
|
| 1276 | + $this->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $this->post_to_jsonld_converter ); |
|
| 1277 | + $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 ); |
|
| 1278 | + $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
|
| 1279 | 1279 | |
| 1280 | - $jsonld_cache = new Ttl_Cache( 'jsonld', 86400 ); |
|
| 1281 | - $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache ); |
|
| 1282 | - $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter ); |
|
| 1280 | + $jsonld_cache = new Ttl_Cache( 'jsonld', 86400 ); |
|
| 1281 | + $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache ); |
|
| 1282 | + $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter ); |
|
| 1283 | 1283 | |
| 1284 | - /* |
|
| 1284 | + /* |
|
| 1285 | 1285 | * Load the `Wordlift_Term_JsonLd_Adapter`. |
| 1286 | 1286 | * |
| 1287 | 1287 | * @see https://github.com/insideout10/wordlift-plugin/issues/892 |
| 1288 | 1288 | * |
| 1289 | 1289 | * @since 3.20.0 |
| 1290 | 1290 | */ |
| 1291 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1292 | - $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->jsonld_service ); |
|
| 1293 | - $jsonld_service = new Jsonld_Service( $this->jsonld_service, $term_jsonld_adapter ); |
|
| 1294 | - new Jsonld_Endpoint( $jsonld_service, $this->entity_uri_service ); |
|
| 1295 | - |
|
| 1296 | - // Prints the JSON-LD in the head. |
|
| 1297 | - new Jsonld_Adapter( $this->jsonld_service ); |
|
| 1298 | - |
|
| 1299 | - new Jsonld_By_Id_Endpoint( $this->jsonld_service, $this->entity_uri_service ); |
|
| 1300 | - |
|
| 1301 | - $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
|
| 1302 | - $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service ); |
|
| 1303 | - // Creating Faq Content filter service. |
|
| 1304 | - $this->faq_content_filter_service = new Faq_Content_Filter(); |
|
| 1305 | - $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
|
| 1306 | - $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service ); |
|
| 1307 | - $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
|
| 1308 | - $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->entity_service ); |
|
| 1309 | - |
|
| 1310 | - $this->loader->add_action( 'enqueue_block_editor_assets', $this, 'add_wl_enabled_blocks' ); |
|
| 1311 | - |
|
| 1312 | - /** |
|
| 1313 | - * Filter: wl_feature__enable__blocks. |
|
| 1291 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1292 | + $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->jsonld_service ); |
|
| 1293 | + $jsonld_service = new Jsonld_Service( $this->jsonld_service, $term_jsonld_adapter ); |
|
| 1294 | + new Jsonld_Endpoint( $jsonld_service, $this->entity_uri_service ); |
|
| 1295 | + |
|
| 1296 | + // Prints the JSON-LD in the head. |
|
| 1297 | + new Jsonld_Adapter( $this->jsonld_service ); |
|
| 1298 | + |
|
| 1299 | + new Jsonld_By_Id_Endpoint( $this->jsonld_service, $this->entity_uri_service ); |
|
| 1300 | + |
|
| 1301 | + $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
|
| 1302 | + $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service ); |
|
| 1303 | + // Creating Faq Content filter service. |
|
| 1304 | + $this->faq_content_filter_service = new Faq_Content_Filter(); |
|
| 1305 | + $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
|
| 1306 | + $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service ); |
|
| 1307 | + $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
|
| 1308 | + $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->entity_service ); |
|
| 1309 | + |
|
| 1310 | + $this->loader->add_action( 'enqueue_block_editor_assets', $this, 'add_wl_enabled_blocks' ); |
|
| 1311 | + |
|
| 1312 | + /** |
|
| 1313 | + * Filter: wl_feature__enable__blocks. |
|
| 1314 | + * |
|
| 1315 | + * @param bool whether the blocks needed to be registered, defaults to true. |
|
| 1316 | + * |
|
| 1317 | + * @return bool |
|
| 1318 | + * @since 3.27.6 |
|
| 1319 | + */ |
|
| 1320 | + |
|
| 1321 | + if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 1322 | + // Initialize the short-codes. |
|
| 1323 | + new Wordlift_Navigator_Shortcode(); |
|
| 1324 | + new Wordlift_Chord_Shortcode(); |
|
| 1325 | + new Wordlift_Geomap_Shortcode(); |
|
| 1326 | + new Wordlift_Timeline_Shortcode(); |
|
| 1327 | + new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
|
| 1328 | + new Wordlift_Vocabulary_Shortcode( $this->configuration_service ); |
|
| 1329 | + new Wordlift_Faceted_Search_Shortcode(); |
|
| 1330 | + } |
|
| 1331 | + |
|
| 1332 | + new Wordlift_Products_Navigator_Shortcode(); |
|
| 1333 | + |
|
| 1334 | + |
|
| 1335 | + // Initialize the Context Cards Service |
|
| 1336 | + $this->context_cards_service = new Wordlift_Context_Cards_Service(); |
|
| 1337 | + |
|
| 1338 | + // Initialize the SEO service. |
|
| 1339 | + new Wordlift_Seo_Service(); |
|
| 1340 | + |
|
| 1341 | + // Initialize the AMP service. |
|
| 1342 | + new Wordlift_AMP_Service( $this->jsonld_service ); |
|
| 1343 | + |
|
| 1344 | + /** Services. */ |
|
| 1345 | + $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
|
| 1346 | + new Wordlift_Image_Service(); |
|
| 1347 | + |
|
| 1348 | + /** Adapters. */ |
|
| 1349 | + $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
|
| 1350 | + $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service ); |
|
| 1351 | + $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 1352 | + //$this->faq_tinymce_adapter = new Faq_Tinymce_Adapter(); |
|
| 1353 | + $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
|
| 1354 | + |
|
| 1355 | + /* |
|
| 1356 | + * Exclude our public js from WP-Rocket. |
|
| 1314 | 1357 | * |
| 1315 | - * @param bool whether the blocks needed to be registered, defaults to true. |
|
| 1358 | + * @since 3.19.4 |
|
| 1316 | 1359 | * |
| 1317 | - * @return bool |
|
| 1318 | - * @since 3.27.6 |
|
| 1360 | + * @see https://github.com/insideout10/wordlift-plugin/issues/842. |
|
| 1319 | 1361 | */ |
| 1362 | + new Wordlift_WpRocket_Adapter(); |
|
| 1320 | 1363 | |
| 1321 | - if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 1322 | - // Initialize the short-codes. |
|
| 1323 | - new Wordlift_Navigator_Shortcode(); |
|
| 1324 | - new Wordlift_Chord_Shortcode(); |
|
| 1325 | - new Wordlift_Geomap_Shortcode(); |
|
| 1326 | - new Wordlift_Timeline_Shortcode(); |
|
| 1327 | - new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
|
| 1328 | - new Wordlift_Vocabulary_Shortcode( $this->configuration_service ); |
|
| 1329 | - new Wordlift_Faceted_Search_Shortcode(); |
|
| 1330 | - } |
|
| 1331 | - |
|
| 1332 | - new Wordlift_Products_Navigator_Shortcode(); |
|
| 1364 | + // Create a Rebuild Service instance, which we'll later bound to an ajax call. |
|
| 1365 | + $this->rebuild_service = new Wordlift_Rebuild_Service( |
|
| 1366 | + $this->sparql_service, |
|
| 1367 | + $uri_service |
|
| 1368 | + ); |
|
| 1333 | 1369 | |
| 1370 | + /** Async Tasks. */ |
|
| 1371 | + new Wordlift_Sparql_Query_Async_Task(); |
|
| 1372 | + new Wordlift_Push_References_Async_Task(); |
|
| 1334 | 1373 | |
| 1335 | - // Initialize the Context Cards Service |
|
| 1336 | - $this->context_cards_service = new Wordlift_Context_Cards_Service(); |
|
| 1374 | + /** WordPress Admin UI. */ |
|
| 1337 | 1375 | |
| 1338 | - // Initialize the SEO service. |
|
| 1339 | - new Wordlift_Seo_Service(); |
|
| 1376 | + // UI elements. |
|
| 1377 | + $this->input_element = new Wordlift_Admin_Input_Element(); |
|
| 1378 | + $this->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
|
| 1379 | + $this->select2_element = new Wordlift_Admin_Select2_Element(); |
|
| 1380 | + $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
|
| 1381 | + $this->country_select_element = new Wordlift_Admin_Country_Select_Element(); |
|
| 1382 | + $tabs_element = new Wordlift_Admin_Tabs_Element(); |
|
| 1383 | + $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element ); |
|
| 1384 | + $this->author_element = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element ); |
|
| 1340 | 1385 | |
| 1341 | - // Initialize the AMP service. |
|
| 1342 | - new Wordlift_AMP_Service( $this->jsonld_service ); |
|
| 1386 | + $this->settings_page = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->country_select_element, $this->publisher_element, $this->radio_input_element ); |
|
| 1387 | + $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 1343 | 1388 | |
| 1344 | - /** Services. */ |
|
| 1345 | - $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
|
| 1346 | - new Wordlift_Image_Service(); |
|
| 1389 | + $this->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element ); |
|
| 1390 | + $this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page ); |
|
| 1391 | + $this->analytics_connect = new Wordlift_Analytics_Connect(); |
|
| 1347 | 1392 | |
| 1348 | - /** Adapters. */ |
|
| 1349 | - $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
|
| 1350 | - $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service ); |
|
| 1351 | - $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 1352 | - //$this->faq_tinymce_adapter = new Faq_Tinymce_Adapter(); |
|
| 1353 | - $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
|
| 1354 | - |
|
| 1355 | - /* |
|
| 1356 | - * Exclude our public js from WP-Rocket. |
|
| 1357 | - * |
|
| 1358 | - * @since 3.19.4 |
|
| 1359 | - * |
|
| 1360 | - * @see https://github.com/insideout10/wordlift-plugin/issues/842. |
|
| 1361 | - */ |
|
| 1362 | - new Wordlift_WpRocket_Adapter(); |
|
| 1363 | - |
|
| 1364 | - // Create a Rebuild Service instance, which we'll later bound to an ajax call. |
|
| 1365 | - $this->rebuild_service = new Wordlift_Rebuild_Service( |
|
| 1366 | - $this->sparql_service, |
|
| 1367 | - $uri_service |
|
| 1368 | - ); |
|
| 1369 | - |
|
| 1370 | - /** Async Tasks. */ |
|
| 1371 | - new Wordlift_Sparql_Query_Async_Task(); |
|
| 1372 | - new Wordlift_Push_References_Async_Task(); |
|
| 1373 | - |
|
| 1374 | - /** WordPress Admin UI. */ |
|
| 1375 | - |
|
| 1376 | - // UI elements. |
|
| 1377 | - $this->input_element = new Wordlift_Admin_Input_Element(); |
|
| 1378 | - $this->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
|
| 1379 | - $this->select2_element = new Wordlift_Admin_Select2_Element(); |
|
| 1380 | - $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
|
| 1381 | - $this->country_select_element = new Wordlift_Admin_Country_Select_Element(); |
|
| 1382 | - $tabs_element = new Wordlift_Admin_Tabs_Element(); |
|
| 1383 | - $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element ); |
|
| 1384 | - $this->author_element = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element ); |
|
| 1385 | - |
|
| 1386 | - $this->settings_page = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->country_select_element, $this->publisher_element, $this->radio_input_element ); |
|
| 1387 | - $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 1388 | - |
|
| 1389 | - $this->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element ); |
|
| 1390 | - $this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page ); |
|
| 1391 | - $this->analytics_connect = new Wordlift_Analytics_Connect(); |
|
| 1392 | - |
|
| 1393 | - // Pages. |
|
| 1394 | - /* |
|
| 1393 | + // Pages. |
|
| 1394 | + /* |
|
| 1395 | 1395 | * Call the `wl_can_see_classification_box` filter to determine whether we can display the classification box. |
| 1396 | 1396 | * |
| 1397 | 1397 | * @since 3.20.3 |
| 1398 | 1398 | * |
| 1399 | 1399 | * @see https://github.com/insideout10/wordlift-plugin/issues/914 |
| 1400 | 1400 | */ |
| 1401 | - if ( apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 1402 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1403 | - new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 1404 | - } |
|
| 1405 | - new Wordlift_Entity_Type_Admin_Service(); |
|
| 1401 | + if ( apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 1402 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1403 | + new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 1404 | + } |
|
| 1405 | + new Wordlift_Entity_Type_Admin_Service(); |
|
| 1406 | 1406 | |
| 1407 | - // create an instance of the entity type list admin page controller. |
|
| 1408 | - $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
|
| 1407 | + // create an instance of the entity type list admin page controller. |
|
| 1408 | + $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
|
| 1409 | 1409 | |
| 1410 | - // create an instance of the entity type setting admin page controller. |
|
| 1411 | - $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
|
| 1410 | + // create an instance of the entity type setting admin page controller. |
|
| 1411 | + $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
|
| 1412 | 1412 | |
| 1413 | - /** Widgets */ |
|
| 1414 | - $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
|
| 1413 | + /** Widgets */ |
|
| 1414 | + $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
|
| 1415 | 1415 | |
| 1416 | - /* WordPress Admin. */ |
|
| 1417 | - $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 1418 | - $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 1416 | + /* WordPress Admin. */ |
|
| 1417 | + $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 1418 | + $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 1419 | 1419 | |
| 1420 | - // Create an instance of the install wizard. |
|
| 1421 | - $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service, $this->language_select_element, $this->country_select_element ); |
|
| 1420 | + // Create an instance of the install wizard. |
|
| 1421 | + $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service, $this->language_select_element, $this->country_select_element ); |
|
| 1422 | 1422 | |
| 1423 | - $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1423 | + $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1424 | 1424 | |
| 1425 | - // User Profile. |
|
| 1426 | - new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1425 | + // User Profile. |
|
| 1426 | + new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1427 | 1427 | |
| 1428 | - $this->entity_page_service = new Wordlift_Entity_Page_Service(); |
|
| 1428 | + $this->entity_page_service = new Wordlift_Entity_Page_Service(); |
|
| 1429 | 1429 | |
| 1430 | - // Load the debug service if WP is in debug mode. |
|
| 1431 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1432 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1433 | - new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1434 | - } |
|
| 1430 | + // Load the debug service if WP is in debug mode. |
|
| 1431 | + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1432 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1433 | + new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1434 | + } |
|
| 1435 | 1435 | |
| 1436 | - // Remote Image Service. |
|
| 1437 | - new Wordlift_Remote_Image_Service(); |
|
| 1436 | + // Remote Image Service. |
|
| 1437 | + new Wordlift_Remote_Image_Service(); |
|
| 1438 | 1438 | |
| 1439 | - /* |
|
| 1439 | + /* |
|
| 1440 | 1440 | * Provides mappings between post types and entity types. |
| 1441 | 1441 | * |
| 1442 | 1442 | * @since 3.20.0 |
| 1443 | 1443 | * |
| 1444 | 1444 | * @see https://github.com/insideout10/wordlift-plugin/issues/852. |
| 1445 | 1445 | */ |
| 1446 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php'; |
|
| 1447 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1448 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1446 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php'; |
|
| 1447 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1448 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1449 | 1449 | |
| 1450 | - // Create an instance of the Mapping Service and assign it to the Ajax Adapter. |
|
| 1451 | - new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) ); |
|
| 1450 | + // Create an instance of the Mapping Service and assign it to the Ajax Adapter. |
|
| 1451 | + new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) ); |
|
| 1452 | 1452 | |
| 1453 | - /* |
|
| 1453 | + /* |
|
| 1454 | 1454 | * Batch Operations. They're similar to Batch Actions but do not require working on post types. |
| 1455 | 1455 | * |
| 1456 | 1456 | * Eventually Batch Actions will become Batch Operations. |
| 1457 | 1457 | * |
| 1458 | 1458 | * @since 3.20.0 |
| 1459 | 1459 | */ |
| 1460 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1461 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1460 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1461 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1462 | 1462 | |
| 1463 | - /* |
|
| 1463 | + /* |
|
| 1464 | 1464 | * Add the Search Keywords taxonomy to manage the Search Keywords on WLS. |
| 1465 | 1465 | * |
| 1466 | 1466 | * @link https://github.com/insideout10/wordlift-plugin/issues/761 |
| 1467 | 1467 | * |
| 1468 | 1468 | * @since 3.20.0 |
| 1469 | 1469 | */ |
| 1470 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php'; |
|
| 1471 | - new Wordlift_Search_Keyword_Taxonomy( $api_service ); |
|
| 1470 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php'; |
|
| 1471 | + new Wordlift_Search_Keyword_Taxonomy( $api_service ); |
|
| 1472 | 1472 | |
| 1473 | - /* |
|
| 1473 | + /* |
|
| 1474 | 1474 | * Load the Mappings JSON-LD post processing. |
| 1475 | 1475 | * |
| 1476 | 1476 | * @since 3.25.0 |
| 1477 | 1477 | */ |
| 1478 | 1478 | |
| 1479 | - $mappings_dbo = new Mappings_DBO(); |
|
| 1480 | - $default_rule_validator = new Taxonomy_Rule_Validator(); |
|
| 1481 | - new Post_Type_Rule_Validator(); |
|
| 1482 | - // Taxonomy term rule validator for validating rules for term pages. |
|
| 1483 | - new Taxonomy_Term_Rule_Validator(); |
|
| 1484 | - $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator ); |
|
| 1485 | - $rule_groups_validator = new Rule_Groups_Validator( $rule_validators_registry ); |
|
| 1486 | - $mappings_validator = new Mappings_Validator( $mappings_dbo, $rule_groups_validator ); |
|
| 1487 | - |
|
| 1488 | - new Url_To_Entity_Transform_Function( $this->entity_uri_service ); |
|
| 1489 | - new Taxonomy_To_Terms_Transform_Function(); |
|
| 1490 | - new Post_Id_To_Entity_Transform_Function(); |
|
| 1491 | - $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry(); |
|
| 1492 | - |
|
| 1493 | - /** |
|
| 1494 | - * @since 3.27.1 |
|
| 1495 | - * Intiailize the acf group data formatter. |
|
| 1496 | - */ |
|
| 1497 | - new Acf_Group_Formatter(); |
|
| 1498 | - new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry ); |
|
| 1499 | - |
|
| 1500 | - /** |
|
| 1501 | - * @since 3.26.0 |
|
| 1502 | - * Initialize the Faq JSON LD converter here - disabled. |
|
| 1503 | - */ |
|
| 1504 | - // new Faq_To_Jsonld_Converter(); |
|
| 1505 | - /* |
|
| 1479 | + $mappings_dbo = new Mappings_DBO(); |
|
| 1480 | + $default_rule_validator = new Taxonomy_Rule_Validator(); |
|
| 1481 | + new Post_Type_Rule_Validator(); |
|
| 1482 | + // Taxonomy term rule validator for validating rules for term pages. |
|
| 1483 | + new Taxonomy_Term_Rule_Validator(); |
|
| 1484 | + $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator ); |
|
| 1485 | + $rule_groups_validator = new Rule_Groups_Validator( $rule_validators_registry ); |
|
| 1486 | + $mappings_validator = new Mappings_Validator( $mappings_dbo, $rule_groups_validator ); |
|
| 1487 | + |
|
| 1488 | + new Url_To_Entity_Transform_Function( $this->entity_uri_service ); |
|
| 1489 | + new Taxonomy_To_Terms_Transform_Function(); |
|
| 1490 | + new Post_Id_To_Entity_Transform_Function(); |
|
| 1491 | + $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry(); |
|
| 1492 | + |
|
| 1493 | + /** |
|
| 1494 | + * @since 3.27.1 |
|
| 1495 | + * Intiailize the acf group data formatter. |
|
| 1496 | + */ |
|
| 1497 | + new Acf_Group_Formatter(); |
|
| 1498 | + new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry ); |
|
| 1499 | + |
|
| 1500 | + /** |
|
| 1501 | + * @since 3.26.0 |
|
| 1502 | + * Initialize the Faq JSON LD converter here - disabled. |
|
| 1503 | + */ |
|
| 1504 | + // new Faq_To_Jsonld_Converter(); |
|
| 1505 | + /* |
|
| 1506 | 1506 | * Use the Templates Ajax Endpoint to load HTML templates for the legacy Angular app via admin-ajax.php |
| 1507 | 1507 | * end-point. |
| 1508 | 1508 | * |
| 1509 | 1509 | * @see https://github.com/insideout10/wordlift-plugin/issues/834 |
| 1510 | 1510 | * @since 3.24.4 |
| 1511 | 1511 | */ |
| 1512 | - new Templates_Ajax_Endpoint(); |
|
| 1513 | - // Call this static method to register FAQ routes to rest api - disabled |
|
| 1514 | - //Faq_Rest_Controller::register_routes(); |
|
| 1512 | + new Templates_Ajax_Endpoint(); |
|
| 1513 | + // Call this static method to register FAQ routes to rest api - disabled |
|
| 1514 | + //Faq_Rest_Controller::register_routes(); |
|
| 1515 | 1515 | |
| 1516 | - /* |
|
| 1516 | + /* |
|
| 1517 | 1517 | * Create a singleton for the Analysis_Response_Ops_Factory. |
| 1518 | 1518 | */ |
| 1519 | - $entity_helper = new Entity_Helper( $this->entity_uri_service, $this->entity_service ); |
|
| 1520 | - new Analysis_Response_Ops_Factory( |
|
| 1521 | - $this->entity_uri_service, |
|
| 1522 | - $this->entity_service, |
|
| 1523 | - $this->entity_type_service, |
|
| 1524 | - $this->storage_factory->post_images(), |
|
| 1525 | - $entity_helper |
|
| 1526 | - ); |
|
| 1527 | - |
|
| 1528 | - /** WL Autocomplete. */ |
|
| 1529 | - $autocomplete_service = new All_Autocomplete_Service( array( |
|
| 1530 | - new Local_Autocomplete_Service(), |
|
| 1531 | - new Linked_Data_Autocomplete_Service( $this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service ), |
|
| 1532 | - ) ); |
|
| 1533 | - $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service ); |
|
| 1534 | - |
|
| 1535 | - /** |
|
| 1536 | - * @since 3.27.2 |
|
| 1537 | - * Integrate the recipe maker jsonld & set recipe |
|
| 1538 | - * as default entity type to the wprm_recipe CPT. |
|
| 1539 | - */ |
|
| 1540 | - new Recipe_Maker_Post_Type_Hook(); |
|
| 1541 | - $recipe_maker_validation_service = new Recipe_Maker_Validation_Service(); |
|
| 1542 | - new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service ); |
|
| 1543 | - new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service ); |
|
| 1544 | - new Recipe_Maker_Warning( $recipe_maker_validation_service ); |
|
| 1545 | - new Yoast_Jsonld( $recipe_maker_validation_service ); |
|
| 1546 | - |
|
| 1547 | - /** |
|
| 1548 | - * @since 3.27.4 |
|
| 1549 | - * Add the faq duplicate markup hook. |
|
| 1550 | - */ |
|
| 1551 | - new Faq_Duplicate_Markup_Remover(); |
|
| 1552 | - } |
|
| 1553 | - |
|
| 1554 | - /** |
|
| 1555 | - * Define the locale for this plugin for internationalization. |
|
| 1556 | - * |
|
| 1557 | - * Uses the Wordlift_i18n class in order to set the domain and to register the hook |
|
| 1558 | - * with WordPress. |
|
| 1559 | - * |
|
| 1560 | - * @since 1.0.0 |
|
| 1561 | - * @access private |
|
| 1562 | - */ |
|
| 1563 | - private function set_locale() { |
|
| 1564 | - |
|
| 1565 | - $plugin_i18n = new Wordlift_i18n(); |
|
| 1566 | - $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1567 | - |
|
| 1568 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1569 | - |
|
| 1570 | - } |
|
| 1571 | - |
|
| 1572 | - /** |
|
| 1573 | - * Register all of the hooks related to the admin area functionality |
|
| 1574 | - * of the plugin. |
|
| 1575 | - * |
|
| 1576 | - * @since 1.0.0 |
|
| 1577 | - * @access private |
|
| 1578 | - */ |
|
| 1579 | - private function define_admin_hooks() { |
|
| 1580 | - |
|
| 1581 | - $plugin_admin = new Wordlift_Admin( |
|
| 1582 | - $this->get_plugin_name(), |
|
| 1583 | - $this->get_version(), |
|
| 1584 | - $this->configuration_service, |
|
| 1585 | - $this->notice_service, |
|
| 1586 | - $this->user_service |
|
| 1587 | - ); |
|
| 1588 | - |
|
| 1589 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1590 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 ); |
|
| 1591 | - |
|
| 1592 | - // Hook the init action to taxonomy services. |
|
| 1593 | - $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1594 | - $this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 ); |
|
| 1595 | - |
|
| 1596 | - // Hook the deleted_post_meta action to the Thumbnail service. |
|
| 1597 | - $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1598 | - |
|
| 1599 | - // Hook the added_post_meta action to the Thumbnail service. |
|
| 1600 | - $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1601 | - |
|
| 1602 | - // Hook the updated_post_meta action to the Thumbnail service. |
|
| 1603 | - $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1604 | - |
|
| 1605 | - // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1606 | - $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1607 | - |
|
| 1608 | - // Register custom allowed redirect hosts. |
|
| 1609 | - $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1610 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1611 | - $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1612 | - |
|
| 1613 | - /* |
|
| 1519 | + $entity_helper = new Entity_Helper( $this->entity_uri_service, $this->entity_service ); |
|
| 1520 | + new Analysis_Response_Ops_Factory( |
|
| 1521 | + $this->entity_uri_service, |
|
| 1522 | + $this->entity_service, |
|
| 1523 | + $this->entity_type_service, |
|
| 1524 | + $this->storage_factory->post_images(), |
|
| 1525 | + $entity_helper |
|
| 1526 | + ); |
|
| 1527 | + |
|
| 1528 | + /** WL Autocomplete. */ |
|
| 1529 | + $autocomplete_service = new All_Autocomplete_Service( array( |
|
| 1530 | + new Local_Autocomplete_Service(), |
|
| 1531 | + new Linked_Data_Autocomplete_Service( $this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service ), |
|
| 1532 | + ) ); |
|
| 1533 | + $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service ); |
|
| 1534 | + |
|
| 1535 | + /** |
|
| 1536 | + * @since 3.27.2 |
|
| 1537 | + * Integrate the recipe maker jsonld & set recipe |
|
| 1538 | + * as default entity type to the wprm_recipe CPT. |
|
| 1539 | + */ |
|
| 1540 | + new Recipe_Maker_Post_Type_Hook(); |
|
| 1541 | + $recipe_maker_validation_service = new Recipe_Maker_Validation_Service(); |
|
| 1542 | + new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service ); |
|
| 1543 | + new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service ); |
|
| 1544 | + new Recipe_Maker_Warning( $recipe_maker_validation_service ); |
|
| 1545 | + new Yoast_Jsonld( $recipe_maker_validation_service ); |
|
| 1546 | + |
|
| 1547 | + /** |
|
| 1548 | + * @since 3.27.4 |
|
| 1549 | + * Add the faq duplicate markup hook. |
|
| 1550 | + */ |
|
| 1551 | + new Faq_Duplicate_Markup_Remover(); |
|
| 1552 | + } |
|
| 1553 | + |
|
| 1554 | + /** |
|
| 1555 | + * Define the locale for this plugin for internationalization. |
|
| 1556 | + * |
|
| 1557 | + * Uses the Wordlift_i18n class in order to set the domain and to register the hook |
|
| 1558 | + * with WordPress. |
|
| 1559 | + * |
|
| 1560 | + * @since 1.0.0 |
|
| 1561 | + * @access private |
|
| 1562 | + */ |
|
| 1563 | + private function set_locale() { |
|
| 1564 | + |
|
| 1565 | + $plugin_i18n = new Wordlift_i18n(); |
|
| 1566 | + $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1567 | + |
|
| 1568 | + $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1569 | + |
|
| 1570 | + } |
|
| 1571 | + |
|
| 1572 | + /** |
|
| 1573 | + * Register all of the hooks related to the admin area functionality |
|
| 1574 | + * of the plugin. |
|
| 1575 | + * |
|
| 1576 | + * @since 1.0.0 |
|
| 1577 | + * @access private |
|
| 1578 | + */ |
|
| 1579 | + private function define_admin_hooks() { |
|
| 1580 | + |
|
| 1581 | + $plugin_admin = new Wordlift_Admin( |
|
| 1582 | + $this->get_plugin_name(), |
|
| 1583 | + $this->get_version(), |
|
| 1584 | + $this->configuration_service, |
|
| 1585 | + $this->notice_service, |
|
| 1586 | + $this->user_service |
|
| 1587 | + ); |
|
| 1588 | + |
|
| 1589 | + $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1590 | + $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 ); |
|
| 1591 | + |
|
| 1592 | + // Hook the init action to taxonomy services. |
|
| 1593 | + $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1594 | + $this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 ); |
|
| 1595 | + |
|
| 1596 | + // Hook the deleted_post_meta action to the Thumbnail service. |
|
| 1597 | + $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1598 | + |
|
| 1599 | + // Hook the added_post_meta action to the Thumbnail service. |
|
| 1600 | + $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1601 | + |
|
| 1602 | + // Hook the updated_post_meta action to the Thumbnail service. |
|
| 1603 | + $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1604 | + |
|
| 1605 | + // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1606 | + $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1607 | + |
|
| 1608 | + // Register custom allowed redirect hosts. |
|
| 1609 | + $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1610 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1611 | + $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1612 | + |
|
| 1613 | + /* |
|
| 1614 | 1614 | * The old dashboard is replaced with dashboard v2. |
| 1615 | 1615 | * |
| 1616 | 1616 | * The old dashboard service is still loaded because its functions are used. |
@@ -1619,392 +1619,392 @@ discard block |
||
| 1619 | 1619 | * |
| 1620 | 1620 | * @since 3.20.0 |
| 1621 | 1621 | */ |
| 1622 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1623 | - // $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' ); |
|
| 1624 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1625 | - // $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' ); |
|
| 1626 | - |
|
| 1627 | - // Hook save_post to the entity service to update custom fields (such as alternate labels). |
|
| 1628 | - // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
|
| 1629 | - $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1630 | - $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1631 | - |
|
| 1632 | - $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1633 | - $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1634 | - |
|
| 1635 | - // Entity listing customization (wp-admin/edit.php) |
|
| 1636 | - // Add custom columns. |
|
| 1637 | - $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1638 | - // no explicit entity as it prevents handling of other post types. |
|
| 1639 | - $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1640 | - // Add 4W selection. |
|
| 1641 | - $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1642 | - $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1643 | - $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' ); |
|
| 1644 | - $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' ); |
|
| 1645 | - |
|
| 1646 | - /* |
|
| 1622 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1623 | + // $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' ); |
|
| 1624 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1625 | + // $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' ); |
|
| 1626 | + |
|
| 1627 | + // Hook save_post to the entity service to update custom fields (such as alternate labels). |
|
| 1628 | + // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
|
| 1629 | + $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1630 | + $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1631 | + |
|
| 1632 | + $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1633 | + $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1634 | + |
|
| 1635 | + // Entity listing customization (wp-admin/edit.php) |
|
| 1636 | + // Add custom columns. |
|
| 1637 | + $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1638 | + // no explicit entity as it prevents handling of other post types. |
|
| 1639 | + $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1640 | + // Add 4W selection. |
|
| 1641 | + $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1642 | + $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1643 | + $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' ); |
|
| 1644 | + $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' ); |
|
| 1645 | + |
|
| 1646 | + /* |
|
| 1647 | 1647 | * If `All Entity Types` is disable, use the radio button Walker. |
| 1648 | 1648 | * |
| 1649 | 1649 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1650 | 1650 | */ |
| 1651 | - if ( ! WL_ALL_ENTITY_TYPES ) { |
|
| 1652 | - $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1653 | - } |
|
| 1654 | - |
|
| 1655 | - // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
|
| 1656 | - // entities. |
|
| 1657 | - $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1658 | - |
|
| 1659 | - // Filter imported post meta. |
|
| 1660 | - $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1661 | - |
|
| 1662 | - // Notify the import service when an import starts and ends. |
|
| 1663 | - $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1664 | - $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1665 | - |
|
| 1666 | - // Hook the AJAX wl_rebuild action to the Rebuild Service. |
|
| 1667 | - $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1668 | - $this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' ); |
|
| 1669 | - |
|
| 1670 | - /** |
|
| 1671 | - * Filter: wl_feature__enable__screens. |
|
| 1672 | - * |
|
| 1673 | - * @param bool whether the screens needed to be registered, defaults to true. |
|
| 1674 | - * |
|
| 1675 | - * @return bool |
|
| 1676 | - * @since 3.27.6 |
|
| 1677 | - */ |
|
| 1678 | - if ( apply_filters( 'wl_feature__enable__screens', true ) ) { |
|
| 1679 | - // Hook the menu to the Download Your Data page. |
|
| 1680 | - $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 ); |
|
| 1681 | - $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 ); |
|
| 1682 | - $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 ); |
|
| 1683 | - } |
|
| 1684 | - // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
|
| 1685 | - $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1686 | - |
|
| 1687 | - // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1688 | - $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1689 | - $this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1690 | - $this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1691 | - |
|
| 1692 | - // Hook the AJAX wl_validate_key action to the Key Validation service. |
|
| 1693 | - $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1694 | - |
|
| 1695 | - // Hook the AJAX wl_update_country_options action to the countries. |
|
| 1696 | - $this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' ); |
|
| 1697 | - |
|
| 1698 | - // Hook the `admin_init` function to the Admin Setup. |
|
| 1699 | - $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1700 | - |
|
| 1701 | - // Hook the admin_init to the settings page. |
|
| 1702 | - $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1703 | - $this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' ); |
|
| 1704 | - |
|
| 1705 | - $this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' ); |
|
| 1706 | - |
|
| 1707 | - // Hook the menu creation on the general wordlift menu creation. |
|
| 1708 | - /** |
|
| 1709 | - * Filter: wl_feature__enable__screens. |
|
| 1710 | - * |
|
| 1711 | - * @param bool whether the screens needed to be registered, defaults to true. |
|
| 1712 | - * |
|
| 1713 | - * @return bool |
|
| 1714 | - * @since 3.27.6 |
|
| 1715 | - */ |
|
| 1716 | - if ( apply_filters( 'wl_feature__enable__screens', true ) ) { |
|
| 1717 | - $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 ); |
|
| 1718 | - } |
|
| 1719 | - /* |
|
| 1651 | + if ( ! WL_ALL_ENTITY_TYPES ) { |
|
| 1652 | + $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1653 | + } |
|
| 1654 | + |
|
| 1655 | + // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
|
| 1656 | + // entities. |
|
| 1657 | + $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1658 | + |
|
| 1659 | + // Filter imported post meta. |
|
| 1660 | + $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1661 | + |
|
| 1662 | + // Notify the import service when an import starts and ends. |
|
| 1663 | + $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1664 | + $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1665 | + |
|
| 1666 | + // Hook the AJAX wl_rebuild action to the Rebuild Service. |
|
| 1667 | + $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1668 | + $this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' ); |
|
| 1669 | + |
|
| 1670 | + /** |
|
| 1671 | + * Filter: wl_feature__enable__screens. |
|
| 1672 | + * |
|
| 1673 | + * @param bool whether the screens needed to be registered, defaults to true. |
|
| 1674 | + * |
|
| 1675 | + * @return bool |
|
| 1676 | + * @since 3.27.6 |
|
| 1677 | + */ |
|
| 1678 | + if ( apply_filters( 'wl_feature__enable__screens', true ) ) { |
|
| 1679 | + // Hook the menu to the Download Your Data page. |
|
| 1680 | + $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 ); |
|
| 1681 | + $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 ); |
|
| 1682 | + $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 ); |
|
| 1683 | + } |
|
| 1684 | + // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
|
| 1685 | + $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1686 | + |
|
| 1687 | + // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1688 | + $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1689 | + $this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1690 | + $this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1691 | + |
|
| 1692 | + // Hook the AJAX wl_validate_key action to the Key Validation service. |
|
| 1693 | + $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1694 | + |
|
| 1695 | + // Hook the AJAX wl_update_country_options action to the countries. |
|
| 1696 | + $this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' ); |
|
| 1697 | + |
|
| 1698 | + // Hook the `admin_init` function to the Admin Setup. |
|
| 1699 | + $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1700 | + |
|
| 1701 | + // Hook the admin_init to the settings page. |
|
| 1702 | + $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1703 | + $this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' ); |
|
| 1704 | + |
|
| 1705 | + $this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' ); |
|
| 1706 | + |
|
| 1707 | + // Hook the menu creation on the general wordlift menu creation. |
|
| 1708 | + /** |
|
| 1709 | + * Filter: wl_feature__enable__screens. |
|
| 1710 | + * |
|
| 1711 | + * @param bool whether the screens needed to be registered, defaults to true. |
|
| 1712 | + * |
|
| 1713 | + * @return bool |
|
| 1714 | + * @since 3.27.6 |
|
| 1715 | + */ |
|
| 1716 | + if ( apply_filters( 'wl_feature__enable__screens', true ) ) { |
|
| 1717 | + $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 ); |
|
| 1718 | + } |
|
| 1719 | + /* |
|
| 1720 | 1720 | * Display the `Wordlift_Admin_Search_Rankings_Page` page. |
| 1721 | 1721 | * |
| 1722 | 1722 | * @link https://github.com/insideout10/wordlift-plugin/issues/761 |
| 1723 | 1723 | * |
| 1724 | 1724 | * @since 3.20.0 |
| 1725 | 1725 | */ |
| 1726 | - if ( in_array( $this->configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) { |
|
| 1727 | - /** |
|
| 1728 | - * Filter: wl_feature__enable__screens. |
|
| 1729 | - * |
|
| 1730 | - * @param bool whether the screens needed to be registered, defaults to true. |
|
| 1731 | - * |
|
| 1732 | - * @return bool |
|
| 1733 | - * @since 3.27.6 |
|
| 1734 | - */ |
|
| 1735 | - if ( apply_filters( 'wl_feature__enable__screens', true ) ) { |
|
| 1736 | - $admin_search_rankings_page = new Wordlift_Admin_Search_Rankings_Page(); |
|
| 1737 | - $this->loader->add_action( 'wl_admin_menu', $admin_search_rankings_page, 'admin_menu' ); |
|
| 1738 | - } |
|
| 1739 | - } |
|
| 1740 | - |
|
| 1741 | - // Hook key update. |
|
| 1742 | - $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1743 | - $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1744 | - |
|
| 1745 | - // Add additional action links to the WordLift plugin in the plugins page. |
|
| 1746 | - $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1747 | - |
|
| 1748 | - /* |
|
| 1726 | + if ( in_array( $this->configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) { |
|
| 1727 | + /** |
|
| 1728 | + * Filter: wl_feature__enable__screens. |
|
| 1729 | + * |
|
| 1730 | + * @param bool whether the screens needed to be registered, defaults to true. |
|
| 1731 | + * |
|
| 1732 | + * @return bool |
|
| 1733 | + * @since 3.27.6 |
|
| 1734 | + */ |
|
| 1735 | + if ( apply_filters( 'wl_feature__enable__screens', true ) ) { |
|
| 1736 | + $admin_search_rankings_page = new Wordlift_Admin_Search_Rankings_Page(); |
|
| 1737 | + $this->loader->add_action( 'wl_admin_menu', $admin_search_rankings_page, 'admin_menu' ); |
|
| 1738 | + } |
|
| 1739 | + } |
|
| 1740 | + |
|
| 1741 | + // Hook key update. |
|
| 1742 | + $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1743 | + $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1744 | + |
|
| 1745 | + // Add additional action links to the WordLift plugin in the plugins page. |
|
| 1746 | + $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1747 | + |
|
| 1748 | + /* |
|
| 1749 | 1749 | * Remove the Analytics Settings link from the plugin page. |
| 1750 | 1750 | * |
| 1751 | 1751 | * @see https://github.com/insideout10/wordlift-plugin/issues/932 |
| 1752 | 1752 | * @since 3.21.1 |
| 1753 | 1753 | */ |
| 1754 | - // $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1755 | - |
|
| 1756 | - // Hook the AJAX `wl_publisher` action name. |
|
| 1757 | - $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1758 | - |
|
| 1759 | - // Hook row actions for the entity type list admin. |
|
| 1760 | - $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1761 | - |
|
| 1762 | - /** Ajax actions. */ |
|
| 1763 | - $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' ); |
|
| 1764 | - |
|
| 1765 | - // Hook capabilities manipulation to allow access to entity type admin |
|
| 1766 | - // page on WordPress versions before 4.7. |
|
| 1767 | - global $wp_version; |
|
| 1768 | - if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1769 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1770 | - } |
|
| 1771 | - |
|
| 1772 | - $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1773 | - |
|
| 1774 | - /** Adapters. */ |
|
| 1775 | - $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1776 | - /** |
|
| 1777 | - * Disabling Faq temporarily. |
|
| 1778 | - * Load the tinymce editor button on the tool bar. |
|
| 1779 | - * @since 3.26.0 |
|
| 1780 | - */ |
|
| 1781 | - //$this->loader->add_filter( 'tiny_mce_before_init', $this->faq_tinymce_adapter, 'register_custom_tags' ); |
|
| 1782 | - //$this->loader->add_filter( 'mce_buttons', $this->faq_tinymce_adapter, 'register_faq_toolbar_button', 10, 1 ); |
|
| 1783 | - //$this->loader->add_filter( 'mce_external_plugins', $this->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 ); |
|
| 1784 | - |
|
| 1785 | - |
|
| 1786 | - $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' ); |
|
| 1787 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' ); |
|
| 1788 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' ); |
|
| 1789 | - /** |
|
| 1790 | - * @since 3.26.0 |
|
| 1791 | - * Post excerpt meta box would be only loaded when the language is set |
|
| 1792 | - * to english |
|
| 1793 | - */ |
|
| 1794 | - if ( $this->configuration_service->get_language_code() === 'en' && |
|
| 1795 | - apply_filters( 'wl_feature__enable__post_excerpt', true ) ) { |
|
| 1796 | - $excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter(); |
|
| 1797 | - $this->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' ); |
|
| 1798 | - // Adding Rest route for the post excerpt |
|
| 1799 | - Post_Excerpt_Rest_Controller::register_routes(); |
|
| 1800 | - } |
|
| 1801 | - |
|
| 1802 | - $this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 ); |
|
| 1803 | - $this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 ); |
|
| 1804 | - |
|
| 1805 | - // Handle the autocomplete request. |
|
| 1806 | - add_action( 'wp_ajax_wl_autocomplete', array( |
|
| 1807 | - $this->autocomplete_adapter, |
|
| 1808 | - 'wl_autocomplete', |
|
| 1809 | - ) ); |
|
| 1810 | - add_action( 'wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1811 | - $this->autocomplete_adapter, |
|
| 1812 | - 'wl_autocomplete', |
|
| 1813 | - ) ); |
|
| 1814 | - |
|
| 1815 | - // Hooks to restrict multisite super admin from manipulating entity types. |
|
| 1816 | - if ( is_multisite() ) { |
|
| 1817 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1818 | - } |
|
| 1819 | - |
|
| 1820 | - $deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service ); |
|
| 1821 | - |
|
| 1822 | - add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) ); |
|
| 1823 | - add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) ); |
|
| 1824 | - add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) ); |
|
| 1825 | - |
|
| 1826 | - /** |
|
| 1827 | - * Always allow the `wordlift/classification` block. |
|
| 1828 | - * |
|
| 1829 | - * @since 3.23.0 |
|
| 1830 | - */ |
|
| 1831 | - add_filter( 'allowed_block_types', function ( $value ) { |
|
| 1832 | - |
|
| 1833 | - if ( true === $value ) { |
|
| 1834 | - return $value; |
|
| 1835 | - } |
|
| 1836 | - |
|
| 1837 | - return array_merge( (array) $value, array( 'wordlift/classification' ) ); |
|
| 1838 | - }, PHP_INT_MAX ); |
|
| 1839 | - |
|
| 1840 | - /** |
|
| 1841 | - * @since 3.27.7 |
|
| 1842 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
| 1843 | - */ |
|
| 1844 | - new Top_Entities(); |
|
| 1845 | - } |
|
| 1846 | - |
|
| 1847 | - /** |
|
| 1848 | - * Register all of the hooks related to the public-facing functionality |
|
| 1849 | - * of the plugin. |
|
| 1850 | - * |
|
| 1851 | - * @since 1.0.0 |
|
| 1852 | - * @access private |
|
| 1853 | - */ |
|
| 1854 | - private function define_public_hooks() { |
|
| 1855 | - |
|
| 1856 | - $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1857 | - |
|
| 1858 | - // Register the entity post type. |
|
| 1859 | - $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1860 | - |
|
| 1861 | - // Bind the link generation and handling hooks to the entity link service. |
|
| 1862 | - $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1863 | - $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1864 | - $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 ); |
|
| 1865 | - $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 ); |
|
| 1866 | - |
|
| 1867 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1868 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1869 | - $this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' ); |
|
| 1870 | - |
|
| 1871 | - // Registering Faq_Content_Filter service used for removing faq question and answer tags from the html. |
|
| 1872 | - $this->loader->add_filter( 'the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' ); |
|
| 1873 | - // Hook the content filter service to add entity links. |
|
| 1874 | - if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) { |
|
| 1875 | - $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1876 | - } |
|
| 1877 | - |
|
| 1878 | - // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1879 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1880 | - |
|
| 1881 | - // Hook the ShareThis service. |
|
| 1882 | - $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1883 | - $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1884 | - |
|
| 1885 | - // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1886 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1887 | - |
|
| 1888 | - // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
|
| 1889 | - // in order to tweak WP's `WP_Query` to include entities in queries related |
|
| 1890 | - // to categories. |
|
| 1891 | - $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1892 | - |
|
| 1893 | - /* |
|
| 1754 | + // $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1755 | + |
|
| 1756 | + // Hook the AJAX `wl_publisher` action name. |
|
| 1757 | + $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1758 | + |
|
| 1759 | + // Hook row actions for the entity type list admin. |
|
| 1760 | + $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1761 | + |
|
| 1762 | + /** Ajax actions. */ |
|
| 1763 | + $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' ); |
|
| 1764 | + |
|
| 1765 | + // Hook capabilities manipulation to allow access to entity type admin |
|
| 1766 | + // page on WordPress versions before 4.7. |
|
| 1767 | + global $wp_version; |
|
| 1768 | + if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1769 | + $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1770 | + } |
|
| 1771 | + |
|
| 1772 | + $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1773 | + |
|
| 1774 | + /** Adapters. */ |
|
| 1775 | + $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1776 | + /** |
|
| 1777 | + * Disabling Faq temporarily. |
|
| 1778 | + * Load the tinymce editor button on the tool bar. |
|
| 1779 | + * @since 3.26.0 |
|
| 1780 | + */ |
|
| 1781 | + //$this->loader->add_filter( 'tiny_mce_before_init', $this->faq_tinymce_adapter, 'register_custom_tags' ); |
|
| 1782 | + //$this->loader->add_filter( 'mce_buttons', $this->faq_tinymce_adapter, 'register_faq_toolbar_button', 10, 1 ); |
|
| 1783 | + //$this->loader->add_filter( 'mce_external_plugins', $this->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 ); |
|
| 1784 | + |
|
| 1785 | + |
|
| 1786 | + $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' ); |
|
| 1787 | + $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' ); |
|
| 1788 | + $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' ); |
|
| 1789 | + /** |
|
| 1790 | + * @since 3.26.0 |
|
| 1791 | + * Post excerpt meta box would be only loaded when the language is set |
|
| 1792 | + * to english |
|
| 1793 | + */ |
|
| 1794 | + if ( $this->configuration_service->get_language_code() === 'en' && |
|
| 1795 | + apply_filters( 'wl_feature__enable__post_excerpt', true ) ) { |
|
| 1796 | + $excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter(); |
|
| 1797 | + $this->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' ); |
|
| 1798 | + // Adding Rest route for the post excerpt |
|
| 1799 | + Post_Excerpt_Rest_Controller::register_routes(); |
|
| 1800 | + } |
|
| 1801 | + |
|
| 1802 | + $this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 ); |
|
| 1803 | + $this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 ); |
|
| 1804 | + |
|
| 1805 | + // Handle the autocomplete request. |
|
| 1806 | + add_action( 'wp_ajax_wl_autocomplete', array( |
|
| 1807 | + $this->autocomplete_adapter, |
|
| 1808 | + 'wl_autocomplete', |
|
| 1809 | + ) ); |
|
| 1810 | + add_action( 'wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1811 | + $this->autocomplete_adapter, |
|
| 1812 | + 'wl_autocomplete', |
|
| 1813 | + ) ); |
|
| 1814 | + |
|
| 1815 | + // Hooks to restrict multisite super admin from manipulating entity types. |
|
| 1816 | + if ( is_multisite() ) { |
|
| 1817 | + $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1818 | + } |
|
| 1819 | + |
|
| 1820 | + $deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service ); |
|
| 1821 | + |
|
| 1822 | + add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) ); |
|
| 1823 | + add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) ); |
|
| 1824 | + add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) ); |
|
| 1825 | + |
|
| 1826 | + /** |
|
| 1827 | + * Always allow the `wordlift/classification` block. |
|
| 1828 | + * |
|
| 1829 | + * @since 3.23.0 |
|
| 1830 | + */ |
|
| 1831 | + add_filter( 'allowed_block_types', function ( $value ) { |
|
| 1832 | + |
|
| 1833 | + if ( true === $value ) { |
|
| 1834 | + return $value; |
|
| 1835 | + } |
|
| 1836 | + |
|
| 1837 | + return array_merge( (array) $value, array( 'wordlift/classification' ) ); |
|
| 1838 | + }, PHP_INT_MAX ); |
|
| 1839 | + |
|
| 1840 | + /** |
|
| 1841 | + * @since 3.27.7 |
|
| 1842 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
| 1843 | + */ |
|
| 1844 | + new Top_Entities(); |
|
| 1845 | + } |
|
| 1846 | + |
|
| 1847 | + /** |
|
| 1848 | + * Register all of the hooks related to the public-facing functionality |
|
| 1849 | + * of the plugin. |
|
| 1850 | + * |
|
| 1851 | + * @since 1.0.0 |
|
| 1852 | + * @access private |
|
| 1853 | + */ |
|
| 1854 | + private function define_public_hooks() { |
|
| 1855 | + |
|
| 1856 | + $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1857 | + |
|
| 1858 | + // Register the entity post type. |
|
| 1859 | + $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1860 | + |
|
| 1861 | + // Bind the link generation and handling hooks to the entity link service. |
|
| 1862 | + $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1863 | + $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1864 | + $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 ); |
|
| 1865 | + $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 ); |
|
| 1866 | + |
|
| 1867 | + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1868 | + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1869 | + $this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' ); |
|
| 1870 | + |
|
| 1871 | + // Registering Faq_Content_Filter service used for removing faq question and answer tags from the html. |
|
| 1872 | + $this->loader->add_filter( 'the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' ); |
|
| 1873 | + // Hook the content filter service to add entity links. |
|
| 1874 | + if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) { |
|
| 1875 | + $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1876 | + } |
|
| 1877 | + |
|
| 1878 | + // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1879 | + $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1880 | + |
|
| 1881 | + // Hook the ShareThis service. |
|
| 1882 | + $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1883 | + $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1884 | + |
|
| 1885 | + // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1886 | + $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1887 | + |
|
| 1888 | + // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
|
| 1889 | + // in order to tweak WP's `WP_Query` to include entities in queries related |
|
| 1890 | + // to categories. |
|
| 1891 | + $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1892 | + |
|
| 1893 | + /* |
|
| 1894 | 1894 | * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service` |
| 1895 | 1895 | * in order to tweak WP's `WP_Query` to show event related entities in reverse |
| 1896 | 1896 | * order of start time. |
| 1897 | 1897 | */ |
| 1898 | - $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1899 | - |
|
| 1900 | - $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1901 | - |
|
| 1902 | - // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
|
| 1903 | - $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1904 | - |
|
| 1905 | - // Analytics Script Frontend. |
|
| 1906 | - if ( $this->configuration_service->is_analytics_enable() ) { |
|
| 1907 | - $this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 ); |
|
| 1908 | - } |
|
| 1909 | - |
|
| 1910 | - } |
|
| 1911 | - |
|
| 1912 | - /** |
|
| 1913 | - * Run the loader to execute all of the hooks with WordPress. |
|
| 1914 | - * |
|
| 1915 | - * @since 1.0.0 |
|
| 1916 | - */ |
|
| 1917 | - public function run() { |
|
| 1918 | - $this->loader->run(); |
|
| 1919 | - } |
|
| 1920 | - |
|
| 1921 | - /** |
|
| 1922 | - * The name of the plugin used to uniquely identify it within the context of |
|
| 1923 | - * WordPress and to define internationalization functionality. |
|
| 1924 | - * |
|
| 1925 | - * @return string The name of the plugin. |
|
| 1926 | - * @since 1.0.0 |
|
| 1927 | - */ |
|
| 1928 | - public function get_plugin_name() { |
|
| 1929 | - return $this->plugin_name; |
|
| 1930 | - } |
|
| 1931 | - |
|
| 1932 | - /** |
|
| 1933 | - * The reference to the class that orchestrates the hooks with the plugin. |
|
| 1934 | - * |
|
| 1935 | - * @return Wordlift_Loader Orchestrates the hooks of the plugin. |
|
| 1936 | - * @since 1.0.0 |
|
| 1937 | - */ |
|
| 1938 | - public function get_loader() { |
|
| 1939 | - return $this->loader; |
|
| 1940 | - } |
|
| 1941 | - |
|
| 1942 | - /** |
|
| 1943 | - * Retrieve the version number of the plugin. |
|
| 1944 | - * |
|
| 1945 | - * @return string The version number of the plugin. |
|
| 1946 | - * @since 1.0.0 |
|
| 1947 | - */ |
|
| 1948 | - public function get_version() { |
|
| 1949 | - return $this->version; |
|
| 1950 | - } |
|
| 1951 | - |
|
| 1952 | - /** |
|
| 1953 | - * Load dependencies for WP-CLI. |
|
| 1954 | - * |
|
| 1955 | - * @throws Exception |
|
| 1956 | - * @since 3.18.0 |
|
| 1957 | - */ |
|
| 1958 | - private function load_cli_dependencies() { |
|
| 1959 | - |
|
| 1960 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php'; |
|
| 1961 | - |
|
| 1962 | - $push_reference_data_command = new Wordlift_Push_Reference_Data_Command( $this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service ); |
|
| 1963 | - |
|
| 1964 | - WP_CLI::add_command( 'wl references push', $push_reference_data_command ); |
|
| 1965 | - |
|
| 1966 | - } |
|
| 1967 | - |
|
| 1968 | - /** |
|
| 1969 | - * Get the {@link \Wordlift_Dashboard_Service} to allow others to use its functions. |
|
| 1970 | - * |
|
| 1971 | - * @return \Wordlift_Dashboard_Service The {@link \Wordlift_Dashboard_Service} instance. |
|
| 1972 | - * @since 3.20.0 |
|
| 1973 | - */ |
|
| 1974 | - public function get_dashboard_service() { |
|
| 1975 | - |
|
| 1976 | - return $this->dashboard_service; |
|
| 1977 | - } |
|
| 1978 | - |
|
| 1979 | - public function add_wl_enabled_blocks() { |
|
| 1980 | - /** |
|
| 1981 | - * Filter: wl_feature__enable__blocks. |
|
| 1982 | - * |
|
| 1983 | - * @param bool whether the blocks needed to be registered, defaults to true. |
|
| 1984 | - * |
|
| 1985 | - * @return bool |
|
| 1986 | - * @since 3.27.6 |
|
| 1987 | - */ |
|
| 1988 | - |
|
| 1989 | - wp_register_script( 'wl_enabled_blocks', false ); |
|
| 1990 | - |
|
| 1991 | - $enabled_blocks = array( 'wordlift/products-navigator' ); |
|
| 1992 | - |
|
| 1993 | - if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 1994 | - // To intimate JS |
|
| 1995 | - $enabled_blocks = array_merge($enabled_blocks, array( |
|
| 1996 | - 'wordlift/navigator', |
|
| 1997 | - 'wordlift/chord', |
|
| 1998 | - 'wordlift/geomap', |
|
| 1999 | - 'wordlift/timeline', |
|
| 2000 | - 'wordlift/cloud', |
|
| 2001 | - 'wordlift/vocabulary', |
|
| 2002 | - 'wordlift/faceted-search' |
|
| 2003 | - )); |
|
| 2004 | - } |
|
| 2005 | - |
|
| 2006 | - wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks ); |
|
| 2007 | - wp_enqueue_script( 'wl_enabled_blocks' ); |
|
| 2008 | - } |
|
| 1898 | + $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1899 | + |
|
| 1900 | + $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1901 | + |
|
| 1902 | + // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
|
| 1903 | + $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1904 | + |
|
| 1905 | + // Analytics Script Frontend. |
|
| 1906 | + if ( $this->configuration_service->is_analytics_enable() ) { |
|
| 1907 | + $this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 ); |
|
| 1908 | + } |
|
| 1909 | + |
|
| 1910 | + } |
|
| 1911 | + |
|
| 1912 | + /** |
|
| 1913 | + * Run the loader to execute all of the hooks with WordPress. |
|
| 1914 | + * |
|
| 1915 | + * @since 1.0.0 |
|
| 1916 | + */ |
|
| 1917 | + public function run() { |
|
| 1918 | + $this->loader->run(); |
|
| 1919 | + } |
|
| 1920 | + |
|
| 1921 | + /** |
|
| 1922 | + * The name of the plugin used to uniquely identify it within the context of |
|
| 1923 | + * WordPress and to define internationalization functionality. |
|
| 1924 | + * |
|
| 1925 | + * @return string The name of the plugin. |
|
| 1926 | + * @since 1.0.0 |
|
| 1927 | + */ |
|
| 1928 | + public function get_plugin_name() { |
|
| 1929 | + return $this->plugin_name; |
|
| 1930 | + } |
|
| 1931 | + |
|
| 1932 | + /** |
|
| 1933 | + * The reference to the class that orchestrates the hooks with the plugin. |
|
| 1934 | + * |
|
| 1935 | + * @return Wordlift_Loader Orchestrates the hooks of the plugin. |
|
| 1936 | + * @since 1.0.0 |
|
| 1937 | + */ |
|
| 1938 | + public function get_loader() { |
|
| 1939 | + return $this->loader; |
|
| 1940 | + } |
|
| 1941 | + |
|
| 1942 | + /** |
|
| 1943 | + * Retrieve the version number of the plugin. |
|
| 1944 | + * |
|
| 1945 | + * @return string The version number of the plugin. |
|
| 1946 | + * @since 1.0.0 |
|
| 1947 | + */ |
|
| 1948 | + public function get_version() { |
|
| 1949 | + return $this->version; |
|
| 1950 | + } |
|
| 1951 | + |
|
| 1952 | + /** |
|
| 1953 | + * Load dependencies for WP-CLI. |
|
| 1954 | + * |
|
| 1955 | + * @throws Exception |
|
| 1956 | + * @since 3.18.0 |
|
| 1957 | + */ |
|
| 1958 | + private function load_cli_dependencies() { |
|
| 1959 | + |
|
| 1960 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php'; |
|
| 1961 | + |
|
| 1962 | + $push_reference_data_command = new Wordlift_Push_Reference_Data_Command( $this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service ); |
|
| 1963 | + |
|
| 1964 | + WP_CLI::add_command( 'wl references push', $push_reference_data_command ); |
|
| 1965 | + |
|
| 1966 | + } |
|
| 1967 | + |
|
| 1968 | + /** |
|
| 1969 | + * Get the {@link \Wordlift_Dashboard_Service} to allow others to use its functions. |
|
| 1970 | + * |
|
| 1971 | + * @return \Wordlift_Dashboard_Service The {@link \Wordlift_Dashboard_Service} instance. |
|
| 1972 | + * @since 3.20.0 |
|
| 1973 | + */ |
|
| 1974 | + public function get_dashboard_service() { |
|
| 1975 | + |
|
| 1976 | + return $this->dashboard_service; |
|
| 1977 | + } |
|
| 1978 | + |
|
| 1979 | + public function add_wl_enabled_blocks() { |
|
| 1980 | + /** |
|
| 1981 | + * Filter: wl_feature__enable__blocks. |
|
| 1982 | + * |
|
| 1983 | + * @param bool whether the blocks needed to be registered, defaults to true. |
|
| 1984 | + * |
|
| 1985 | + * @return bool |
|
| 1986 | + * @since 3.27.6 |
|
| 1987 | + */ |
|
| 1988 | + |
|
| 1989 | + wp_register_script( 'wl_enabled_blocks', false ); |
|
| 1990 | + |
|
| 1991 | + $enabled_blocks = array( 'wordlift/products-navigator' ); |
|
| 1992 | + |
|
| 1993 | + if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 1994 | + // To intimate JS |
|
| 1995 | + $enabled_blocks = array_merge($enabled_blocks, array( |
|
| 1996 | + 'wordlift/navigator', |
|
| 1997 | + 'wordlift/chord', |
|
| 1998 | + 'wordlift/geomap', |
|
| 1999 | + 'wordlift/timeline', |
|
| 2000 | + 'wordlift/cloud', |
|
| 2001 | + 'wordlift/vocabulary', |
|
| 2002 | + 'wordlift/faceted-search' |
|
| 2003 | + )); |
|
| 2004 | + } |
|
| 2005 | + |
|
| 2006 | + wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks ); |
|
| 2007 | + wp_enqueue_script( 'wl_enabled_blocks' ); |
|
| 2008 | + } |
|
| 2009 | 2009 | |
| 2010 | 2010 | } |
@@ -755,7 +755,7 @@ discard block |
||
| 755 | 755 | $this->define_public_hooks(); |
| 756 | 756 | |
| 757 | 757 | // If we're in `WP_CLI` load the related files. |
| 758 | - if ( class_exists( 'WP_CLI' ) ) { |
|
| 758 | + if (class_exists('WP_CLI')) { |
|
| 759 | 759 | $this->load_cli_dependencies(); |
| 760 | 760 | } |
| 761 | 761 | |
@@ -796,381 +796,381 @@ discard block |
||
| 796 | 796 | * The class responsible for orchestrating the actions and filters of the |
| 797 | 797 | * core plugin. |
| 798 | 798 | */ |
| 799 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 799 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-loader.php'; |
|
| 800 | 800 | |
| 801 | 801 | // The class responsible for plugin uninstall. |
| 802 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
|
| 802 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-deactivator-feedback.php'; |
|
| 803 | 803 | |
| 804 | 804 | /** |
| 805 | 805 | * The class responsible for defining internationalization functionality |
| 806 | 806 | * of the plugin. |
| 807 | 807 | */ |
| 808 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 808 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-i18n.php'; |
|
| 809 | 809 | |
| 810 | 810 | /** |
| 811 | 811 | * WordLift's supported languages. |
| 812 | 812 | */ |
| 813 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 813 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-languages.php'; |
|
| 814 | 814 | |
| 815 | 815 | /** |
| 816 | 816 | * WordLift's supported countries. |
| 817 | 817 | */ |
| 818 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php'; |
|
| 818 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-countries.php'; |
|
| 819 | 819 | |
| 820 | 820 | /** |
| 821 | 821 | * Provide support functions to sanitize data. |
| 822 | 822 | */ |
| 823 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 823 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sanitizer.php'; |
|
| 824 | 824 | |
| 825 | 825 | /** Services. */ |
| 826 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 827 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
|
| 828 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 829 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 830 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 831 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 832 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 833 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
|
| 834 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 835 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php'; |
|
| 826 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-log-service.php'; |
|
| 827 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-http-api.php'; |
|
| 828 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-redirect-service.php'; |
|
| 829 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-configuration-service.php'; |
|
| 830 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-type-service.php'; |
|
| 831 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-service.php'; |
|
| 832 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-link-service.php'; |
|
| 833 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-linked-data-service.php'; |
|
| 834 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-relation-service.php'; |
|
| 835 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-image-service.php'; |
|
| 836 | 836 | |
| 837 | 837 | /** |
| 838 | 838 | * The Query builder. |
| 839 | 839 | */ |
| 840 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 840 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-query-builder.php'; |
|
| 841 | 841 | |
| 842 | 842 | /** |
| 843 | 843 | * The Schema service. |
| 844 | 844 | */ |
| 845 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 845 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-service.php'; |
|
| 846 | 846 | |
| 847 | 847 | /** |
| 848 | 848 | * The schema:url property service. |
| 849 | 849 | */ |
| 850 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 851 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 850 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-service.php'; |
|
| 851 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-url-property-service.php'; |
|
| 852 | 852 | |
| 853 | 853 | /** |
| 854 | 854 | * The UI service. |
| 855 | 855 | */ |
| 856 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 856 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-ui-service.php'; |
|
| 857 | 857 | |
| 858 | 858 | /** |
| 859 | 859 | * The Thumbnail service. |
| 860 | 860 | */ |
| 861 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 861 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-thumbnail-service.php'; |
|
| 862 | 862 | |
| 863 | 863 | /** |
| 864 | 864 | * The Entity Types Taxonomy service. |
| 865 | 865 | */ |
| 866 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 866 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 867 | 867 | |
| 868 | 868 | /** |
| 869 | 869 | * The Entity service. |
| 870 | 870 | */ |
| 871 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
|
| 872 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 871 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-uri-service.php'; |
|
| 872 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-service.php'; |
|
| 873 | 873 | |
| 874 | 874 | // Add the entity rating service. |
| 875 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 875 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rating-service.php'; |
|
| 876 | 876 | |
| 877 | 877 | /** |
| 878 | 878 | * The User service. |
| 879 | 879 | */ |
| 880 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 880 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-user-service.php'; |
|
| 881 | 881 | |
| 882 | 882 | /** |
| 883 | 883 | * The Timeline service. |
| 884 | 884 | */ |
| 885 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 885 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-timeline-service.php'; |
|
| 886 | 886 | |
| 887 | 887 | /** |
| 888 | 888 | * The Topic Taxonomy service. |
| 889 | 889 | */ |
| 890 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 890 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 891 | 891 | |
| 892 | 892 | /** |
| 893 | 893 | * The SPARQL service. |
| 894 | 894 | */ |
| 895 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 895 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sparql-service.php'; |
|
| 896 | 896 | |
| 897 | 897 | /** |
| 898 | 898 | * The WordLift import service. |
| 899 | 899 | */ |
| 900 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 900 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-import-service.php'; |
|
| 901 | 901 | |
| 902 | 902 | /** |
| 903 | 903 | * The WordLift URI service. |
| 904 | 904 | */ |
| 905 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 906 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 907 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 905 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-uri-service.php'; |
|
| 906 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-factory.php'; |
|
| 907 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-service.php'; |
|
| 908 | 908 | |
| 909 | 909 | /** |
| 910 | 910 | * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
| 911 | 911 | */ |
| 912 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php'; |
|
| 913 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php'; |
|
| 914 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php'; |
|
| 915 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php'; |
|
| 916 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php'; |
|
| 912 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-listable.php'; |
|
| 913 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-rebuild-service.php'; |
|
| 914 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-reference-rebuild-service.php'; |
|
| 915 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-relation-rebuild-service.php'; |
|
| 916 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-relation-rebuild-adapter.php'; |
|
| 917 | 917 | |
| 918 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 919 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 918 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 919 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-attachment-service.php'; |
|
| 920 | 920 | |
| 921 | 921 | /** |
| 922 | 922 | * Load the converters. |
| 923 | 923 | */ |
| 924 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 925 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 926 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 927 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 928 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 929 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 924 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/intf-wordlift-post-converter.php'; |
|
| 925 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 926 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 927 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 928 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 929 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 930 | 930 | |
| 931 | 931 | /** |
| 932 | 932 | * Load cache-related files. |
| 933 | 933 | */ |
| 934 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
|
| 934 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/cache/require.php'; |
|
| 935 | 935 | |
| 936 | 936 | /** |
| 937 | 937 | * Load the content filter. |
| 938 | 938 | */ |
| 939 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 939 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-content-filter-service.php'; |
|
| 940 | 940 | |
| 941 | 941 | /* |
| 942 | 942 | * Load the excerpt helper. |
| 943 | 943 | */ |
| 944 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 944 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 945 | 945 | |
| 946 | 946 | /** |
| 947 | 947 | * Load the JSON-LD service to publish entities using JSON-LD.s |
| 948 | 948 | * |
| 949 | 949 | * @since 3.8.0 |
| 950 | 950 | */ |
| 951 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 951 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-service.php'; |
|
| 952 | 952 | |
| 953 | 953 | // The Publisher Service and the AJAX adapter. |
| 954 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 955 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 954 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-service.php'; |
|
| 955 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 956 | 956 | |
| 957 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 957 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-adapter.php'; |
|
| 958 | 958 | |
| 959 | 959 | /** |
| 960 | 960 | * Load the WordLift key validation service. |
| 961 | 961 | */ |
| 962 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 962 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-key-validation-service.php'; |
|
| 963 | 963 | |
| 964 | 964 | // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
| 965 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 965 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 966 | 966 | |
| 967 | 967 | // Load the `Wordlift_Entity_Page_Service` class definition. |
| 968 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
| 968 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-page-service.php'; |
|
| 969 | 969 | |
| 970 | 970 | /** Linked Data. */ |
| 971 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 972 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 973 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 974 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 975 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 976 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 977 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 978 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 979 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 980 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 981 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 971 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 972 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 973 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 974 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 975 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 976 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 977 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 978 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 979 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 980 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 981 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 982 | 982 | |
| 983 | 983 | /** Linked Data Rendition. */ |
| 984 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php'; |
|
| 985 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php'; |
|
| 986 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php'; |
|
| 987 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 984 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php'; |
|
| 985 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php'; |
|
| 986 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php'; |
|
| 987 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 988 | 988 | |
| 989 | 989 | /** Services. */ |
| 990 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 991 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php'; |
|
| 990 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 991 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-api-service.php'; |
|
| 992 | 992 | |
| 993 | 993 | /** Adapters. */ |
| 994 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 995 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 996 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 997 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 998 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php'; |
|
| 994 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-tinymce-adapter.php'; |
|
| 995 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-newrelic-adapter.php'; |
|
| 996 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 997 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-adapter.php'; |
|
| 998 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-wprocket-adapter.php'; |
|
| 999 | 999 | |
| 1000 | 1000 | /** Async Tasks. */ |
| 1001 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php'; |
|
| 1002 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 1003 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php'; |
|
| 1001 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-async-task.php'; |
|
| 1002 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 1003 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-push-references-async-task.php'; |
|
| 1004 | 1004 | |
| 1005 | 1005 | /** Autocomplete. */ |
| 1006 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 1006 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 1007 | 1007 | |
| 1008 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
|
| 1008 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-remote-image-service.php'; |
|
| 1009 | 1009 | |
| 1010 | 1010 | /** Analytics */ |
| 1011 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 1011 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 1012 | 1012 | |
| 1013 | 1013 | /** |
| 1014 | 1014 | * The class responsible for defining all actions that occur in the admin area. |
| 1015 | 1015 | */ |
| 1016 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 1016 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin.php'; |
|
| 1017 | 1017 | |
| 1018 | 1018 | /** |
| 1019 | 1019 | * The class to customize the entity list admin page. |
| 1020 | 1020 | */ |
| 1021 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 1021 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-list.php'; |
|
| 1022 | 1022 | |
| 1023 | 1023 | /** |
| 1024 | 1024 | * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
| 1025 | 1025 | */ |
| 1026 | 1026 | global $wp_version; |
| 1027 | - if ( version_compare( $wp_version, '5.3', '<' ) ) { |
|
| 1028 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 1027 | + if (version_compare($wp_version, '5.3', '<')) { |
|
| 1028 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 1029 | 1029 | } else { |
| 1030 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
| 1030 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
| 1031 | 1031 | } |
| 1032 | 1032 | |
| 1033 | 1033 | /** |
| 1034 | 1034 | * The Notice service. |
| 1035 | 1035 | */ |
| 1036 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 1036 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-notice-service.php'; |
|
| 1037 | 1037 | |
| 1038 | 1038 | /** |
| 1039 | 1039 | * The PrimaShop adapter. |
| 1040 | 1040 | */ |
| 1041 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 1041 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-primashop-adapter.php'; |
|
| 1042 | 1042 | |
| 1043 | 1043 | /** |
| 1044 | 1044 | * The WordLift Dashboard service. |
| 1045 | 1045 | */ |
| 1046 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 1046 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard.php'; |
|
| 1047 | 1047 | |
| 1048 | 1048 | /** |
| 1049 | 1049 | * The admin 'Install wizard' page. |
| 1050 | 1050 | */ |
| 1051 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 1051 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-setup.php'; |
|
| 1052 | 1052 | |
| 1053 | 1053 | /** |
| 1054 | 1054 | * The WordLift entity type list admin page controller. |
| 1055 | 1055 | */ |
| 1056 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 1056 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 1057 | 1057 | |
| 1058 | 1058 | /** |
| 1059 | 1059 | * The WordLift entity type settings admin page controller. |
| 1060 | 1060 | */ |
| 1061 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 1061 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-settings.php'; |
|
| 1062 | 1062 | |
| 1063 | 1063 | /** |
| 1064 | 1064 | * The admin 'Download Your Data' page. |
| 1065 | 1065 | */ |
| 1066 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 1066 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-download-your-data-page.php'; |
|
| 1067 | 1067 | |
| 1068 | 1068 | /** |
| 1069 | 1069 | * The admin 'WordLift Settings' page. |
| 1070 | 1070 | */ |
| 1071 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php'; |
|
| 1072 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 1073 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 1074 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 1075 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 1076 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 1077 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 1078 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 1079 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 1080 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 1081 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 1082 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 1083 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
| 1084 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 1085 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
| 1071 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/intf-wordlift-admin-element.php'; |
|
| 1072 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 1073 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 1074 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 1075 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 1076 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 1077 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 1078 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 1079 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 1080 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 1081 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-page.php'; |
|
| 1082 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page.php'; |
|
| 1083 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
| 1084 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 1085 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
| 1086 | 1086 | |
| 1087 | 1087 | /** Admin Pages */ |
| 1088 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 1089 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 1090 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-page.php'; |
|
| 1091 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 1088 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 1089 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-status-page.php'; |
|
| 1090 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-search-rankings-page.php'; |
|
| 1091 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 1092 | 1092 | |
| 1093 | 1093 | /** |
| 1094 | 1094 | * The class responsible for defining all actions that occur in the public-facing |
| 1095 | 1095 | * side of the site. |
| 1096 | 1096 | */ |
| 1097 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 1097 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-public.php'; |
|
| 1098 | 1098 | |
| 1099 | 1099 | /** |
| 1100 | 1100 | * The shortcode abstract class. |
| 1101 | 1101 | */ |
| 1102 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 1102 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-shortcode.php'; |
|
| 1103 | 1103 | |
| 1104 | 1104 | /** |
| 1105 | 1105 | * The Timeline shortcode. |
| 1106 | 1106 | */ |
| 1107 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 1107 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-timeline-shortcode.php'; |
|
| 1108 | 1108 | |
| 1109 | 1109 | /** |
| 1110 | 1110 | * The Navigator shortcode. |
| 1111 | 1111 | */ |
| 1112 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 1112 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-navigator-shortcode.php'; |
|
| 1113 | 1113 | |
| 1114 | 1114 | /** |
| 1115 | 1115 | * The Products Navigator shortcode. |
| 1116 | 1116 | */ |
| 1117 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php'; |
|
| 1117 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-products-navigator-shortcode.php'; |
|
| 1118 | 1118 | |
| 1119 | 1119 | /** |
| 1120 | 1120 | * The chord shortcode. |
| 1121 | 1121 | */ |
| 1122 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 1122 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-chord-shortcode.php'; |
|
| 1123 | 1123 | |
| 1124 | 1124 | /** |
| 1125 | 1125 | * The geomap shortcode. |
| 1126 | 1126 | */ |
| 1127 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 1127 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-geomap-shortcode.php'; |
|
| 1128 | 1128 | |
| 1129 | 1129 | /** |
| 1130 | 1130 | * The entity cloud shortcode. |
| 1131 | 1131 | */ |
| 1132 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 1132 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 1133 | 1133 | |
| 1134 | 1134 | /** |
| 1135 | 1135 | * The entity glossary shortcode. |
| 1136 | 1136 | */ |
| 1137 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
|
| 1138 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 1137 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-alphabet-service.php'; |
|
| 1138 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 1139 | 1139 | |
| 1140 | 1140 | /** |
| 1141 | 1141 | * Faceted Search shortcode. |
| 1142 | 1142 | */ |
| 1143 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 1143 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 1144 | 1144 | |
| 1145 | 1145 | /** |
| 1146 | 1146 | * The ShareThis service. |
| 1147 | 1147 | */ |
| 1148 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 1148 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-sharethis-service.php'; |
|
| 1149 | 1149 | |
| 1150 | 1150 | /** |
| 1151 | 1151 | * The SEO service. |
| 1152 | 1152 | */ |
| 1153 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 1153 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-seo-service.php'; |
|
| 1154 | 1154 | |
| 1155 | 1155 | /** |
| 1156 | 1156 | * The AMP service. |
| 1157 | 1157 | */ |
| 1158 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1158 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-amp-service.php'; |
|
| 1159 | 1159 | |
| 1160 | 1160 | /** Widgets */ |
| 1161 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1162 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1163 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php'; |
|
| 1161 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-widget.php'; |
|
| 1162 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1163 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-context-cards.php'; |
|
| 1164 | 1164 | |
| 1165 | 1165 | /* |
| 1166 | 1166 | * Schema.org Services. |
| 1167 | 1167 | * |
| 1168 | 1168 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1169 | 1169 | */ |
| 1170 | - if ( WL_ALL_ENTITY_TYPES ) { |
|
| 1171 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1172 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1173 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1170 | + if (WL_ALL_ENTITY_TYPES) { |
|
| 1171 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1172 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1173 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1174 | 1174 | new Wordlift_Schemaorg_Sync_Service(); |
| 1175 | 1175 | $schemaorg_property_service = new Wordlift_Schemaorg_Property_Service(); |
| 1176 | 1176 | new Wordlift_Schemaorg_Class_Service(); |
@@ -1182,25 +1182,25 @@ discard block |
||
| 1182 | 1182 | |
| 1183 | 1183 | // Instantiate a global logger. |
| 1184 | 1184 | global $wl_logger; |
| 1185 | - $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1185 | + $wl_logger = Wordlift_Log_Service::get_logger('WordLift'); |
|
| 1186 | 1186 | |
| 1187 | 1187 | // Load the `wl-api` end-point. |
| 1188 | 1188 | new Wordlift_Http_Api(); |
| 1189 | 1189 | |
| 1190 | 1190 | // Load the Install Service. |
| 1191 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
|
| 1191 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-service.php'; |
|
| 1192 | 1192 | $this->install_service = new Wordlift_Install_Service(); |
| 1193 | 1193 | |
| 1194 | 1194 | /** Services. */ |
| 1195 | 1195 | // Create the configuration service. |
| 1196 | 1196 | $this->configuration_service = new Wordlift_Configuration_Service(); |
| 1197 | - $api_service = new Wordlift_Api_Service( $this->configuration_service ); |
|
| 1197 | + $api_service = new Wordlift_Api_Service($this->configuration_service); |
|
| 1198 | 1198 | |
| 1199 | 1199 | // Create an entity type service instance. It'll be later bound to the init action. |
| 1200 | - $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 1200 | + $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service(Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path()); |
|
| 1201 | 1201 | |
| 1202 | 1202 | // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
| 1203 | - $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 1203 | + $this->entity_link_service = new Wordlift_Entity_Link_Service($this->entity_post_type_service, $this->configuration_service->get_entity_base_path()); |
|
| 1204 | 1204 | |
| 1205 | 1205 | // Create an instance of the UI service. |
| 1206 | 1206 | $this->ui_service = new Wordlift_UI_Service(); |
@@ -1209,34 +1209,34 @@ discard block |
||
| 1209 | 1209 | $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
| 1210 | 1210 | |
| 1211 | 1211 | $this->sparql_service = new Wordlift_Sparql_Service(); |
| 1212 | - $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 1212 | + $schema_url_property_service = new Wordlift_Schema_Url_Property_Service($this->sparql_service); |
|
| 1213 | 1213 | $this->notice_service = new Wordlift_Notice_Service(); |
| 1214 | 1214 | $this->relation_service = new Wordlift_Relation_Service(); |
| 1215 | 1215 | |
| 1216 | - $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' ); |
|
| 1217 | - $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service ); |
|
| 1218 | - $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service ); |
|
| 1219 | - $this->user_service = new Wordlift_User_Service( $this->sparql_service, $this->entity_service ); |
|
| 1216 | + $entity_uri_cache_service = new Wordlift_File_Cache_Service(WL_TEMP_DIR.'entity_uri/'); |
|
| 1217 | + $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service($this->configuration_service, $entity_uri_cache_service); |
|
| 1218 | + $this->entity_service = new Wordlift_Entity_Service($this->ui_service, $this->relation_service, $this->entity_uri_service); |
|
| 1219 | + $this->user_service = new Wordlift_User_Service($this->sparql_service, $this->entity_service); |
|
| 1220 | 1220 | |
| 1221 | 1221 | // Instantiate the JSON-LD service. |
| 1222 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1222 | + $property_getter = Wordlift_Property_Getter_Factory::create($this->entity_service); |
|
| 1223 | 1223 | |
| 1224 | 1224 | /** Linked Data. */ |
| 1225 | - $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
|
| 1226 | - $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
|
| 1225 | + $this->storage_factory = new Wordlift_Storage_Factory($this->entity_service, $this->user_service, $property_getter); |
|
| 1226 | + $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory($this->entity_service); |
|
| 1227 | 1227 | |
| 1228 | - $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
|
| 1228 | + $this->schema_service = new Wordlift_Schema_Service($this->storage_factory, $this->rendition_factory, $this->configuration_service); |
|
| 1229 | 1229 | |
| 1230 | 1230 | // Create a new instance of the Redirect service. |
| 1231 | - $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_uri_service ); |
|
| 1232 | - $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 1231 | + $this->redirect_service = new Wordlift_Redirect_Service($this->entity_uri_service); |
|
| 1232 | + $this->entity_type_service = new Wordlift_Entity_Type_Service($this->schema_service); |
|
| 1233 | 1233 | |
| 1234 | - if ( ! apply_filters( 'wl_feature__enable__dataset-ng', false ) ) { |
|
| 1235 | - new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service ); |
|
| 1234 | + if ( ! apply_filters('wl_feature__enable__dataset-ng', false)) { |
|
| 1235 | + new Wordlift_Linked_Data_Service($this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service); |
|
| 1236 | 1236 | } |
| 1237 | 1237 | |
| 1238 | 1238 | // Create a new instance of the Timeline service and Timeline shortcode. |
| 1239 | - $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
|
| 1239 | + $this->timeline_service = new Wordlift_Timeline_Service($this->entity_service, $this->entity_type_service); |
|
| 1240 | 1240 | |
| 1241 | 1241 | $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
| 1242 | 1242 | |
@@ -1250,36 +1250,36 @@ discard block |
||
| 1250 | 1250 | $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
| 1251 | 1251 | |
| 1252 | 1252 | // Create an import service instance to hook later to WP's import function. |
| 1253 | - $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() ); |
|
| 1253 | + $this->import_service = new Wordlift_Import_Service($this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri()); |
|
| 1254 | 1254 | |
| 1255 | - $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1255 | + $uri_service = new Wordlift_Uri_Service($GLOBALS['wpdb']); |
|
| 1256 | 1256 | |
| 1257 | 1257 | // Create the entity rating service. |
| 1258 | - $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 1258 | + $this->rating_service = new Wordlift_Rating_Service($this->entity_service, $this->entity_type_service, $this->notice_service); |
|
| 1259 | 1259 | |
| 1260 | 1260 | // Create entity list customization (wp-admin/edit.php). |
| 1261 | - $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 1261 | + $this->entity_list_service = new Wordlift_Entity_List_Service($this->rating_service); |
|
| 1262 | 1262 | |
| 1263 | 1263 | // Create a new instance of the Redirect service. |
| 1264 | - $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
|
| 1264 | + $this->dashboard_service = new Wordlift_Dashboard_Service($this->rating_service, $this->entity_service); |
|
| 1265 | 1265 | |
| 1266 | 1266 | // Create an instance of the Publisher Service and the AJAX Adapter. |
| 1267 | - $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service ); |
|
| 1268 | - $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1269 | - $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1267 | + $this->publisher_service = new Wordlift_Publisher_Service($this->configuration_service); |
|
| 1268 | + $this->property_factory = new Wordlift_Property_Factory($schema_url_property_service); |
|
| 1269 | + $this->property_factory->register(Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service); |
|
| 1270 | 1270 | |
| 1271 | 1271 | $attachment_service = new Wordlift_Attachment_Service(); |
| 1272 | 1272 | |
| 1273 | 1273 | // Instantiate the JSON-LD service. |
| 1274 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1275 | - $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 ); |
|
| 1276 | - $this->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $this->post_to_jsonld_converter ); |
|
| 1277 | - $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 ); |
|
| 1278 | - $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
|
| 1274 | + $property_getter = Wordlift_Property_Getter_Factory::create($this->entity_service); |
|
| 1275 | + $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); |
|
| 1276 | + $this->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $this->post_to_jsonld_converter); |
|
| 1277 | + $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); |
|
| 1278 | + $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service); |
|
| 1279 | 1279 | |
| 1280 | - $jsonld_cache = new Ttl_Cache( 'jsonld', 86400 ); |
|
| 1281 | - $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache ); |
|
| 1282 | - $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter ); |
|
| 1280 | + $jsonld_cache = new Ttl_Cache('jsonld', 86400); |
|
| 1281 | + $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter($this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache); |
|
| 1282 | + $this->jsonld_service = new Wordlift_Jsonld_Service($this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter); |
|
| 1283 | 1283 | |
| 1284 | 1284 | /* |
| 1285 | 1285 | * Load the `Wordlift_Term_JsonLd_Adapter`. |
@@ -1288,26 +1288,26 @@ discard block |
||
| 1288 | 1288 | * |
| 1289 | 1289 | * @since 3.20.0 |
| 1290 | 1290 | */ |
| 1291 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1292 | - $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->jsonld_service ); |
|
| 1293 | - $jsonld_service = new Jsonld_Service( $this->jsonld_service, $term_jsonld_adapter ); |
|
| 1294 | - new Jsonld_Endpoint( $jsonld_service, $this->entity_uri_service ); |
|
| 1291 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1292 | + $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter($this->entity_uri_service, $this->jsonld_service); |
|
| 1293 | + $jsonld_service = new Jsonld_Service($this->jsonld_service, $term_jsonld_adapter); |
|
| 1294 | + new Jsonld_Endpoint($jsonld_service, $this->entity_uri_service); |
|
| 1295 | 1295 | |
| 1296 | 1296 | // Prints the JSON-LD in the head. |
| 1297 | - new Jsonld_Adapter( $this->jsonld_service ); |
|
| 1297 | + new Jsonld_Adapter($this->jsonld_service); |
|
| 1298 | 1298 | |
| 1299 | - new Jsonld_By_Id_Endpoint( $this->jsonld_service, $this->entity_uri_service ); |
|
| 1299 | + new Jsonld_By_Id_Endpoint($this->jsonld_service, $this->entity_uri_service); |
|
| 1300 | 1300 | |
| 1301 | - $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
|
| 1302 | - $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service ); |
|
| 1301 | + $this->key_validation_service = new Wordlift_Key_Validation_Service($this->configuration_service); |
|
| 1302 | + $this->content_filter_service = new Wordlift_Content_Filter_Service($this->entity_service, $this->configuration_service, $this->entity_uri_service); |
|
| 1303 | 1303 | // Creating Faq Content filter service. |
| 1304 | 1304 | $this->faq_content_filter_service = new Faq_Content_Filter(); |
| 1305 | - $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
|
| 1306 | - $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service ); |
|
| 1307 | - $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
|
| 1308 | - $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->entity_service ); |
|
| 1305 | + $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service($this->content_filter_service, $this->entity_service); |
|
| 1306 | + $this->sample_data_service = new Wordlift_Sample_Data_Service($this->entity_type_service, $this->configuration_service, $this->user_service); |
|
| 1307 | + $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter($this->sample_data_service); |
|
| 1308 | + $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service($this->entity_service); |
|
| 1309 | 1309 | |
| 1310 | - $this->loader->add_action( 'enqueue_block_editor_assets', $this, 'add_wl_enabled_blocks' ); |
|
| 1310 | + $this->loader->add_action('enqueue_block_editor_assets', $this, 'add_wl_enabled_blocks'); |
|
| 1311 | 1311 | |
| 1312 | 1312 | /** |
| 1313 | 1313 | * Filter: wl_feature__enable__blocks. |
@@ -1318,14 +1318,14 @@ discard block |
||
| 1318 | 1318 | * @since 3.27.6 |
| 1319 | 1319 | */ |
| 1320 | 1320 | |
| 1321 | - if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 1321 | + if (apply_filters('wl_feature__enable__blocks', true)) { |
|
| 1322 | 1322 | // Initialize the short-codes. |
| 1323 | 1323 | new Wordlift_Navigator_Shortcode(); |
| 1324 | 1324 | new Wordlift_Chord_Shortcode(); |
| 1325 | 1325 | new Wordlift_Geomap_Shortcode(); |
| 1326 | 1326 | new Wordlift_Timeline_Shortcode(); |
| 1327 | - new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
|
| 1328 | - new Wordlift_Vocabulary_Shortcode( $this->configuration_service ); |
|
| 1327 | + new Wordlift_Related_Entities_Cloud_Shortcode($this->relation_service); |
|
| 1328 | + new Wordlift_Vocabulary_Shortcode($this->configuration_service); |
|
| 1329 | 1329 | new Wordlift_Faceted_Search_Shortcode(); |
| 1330 | 1330 | } |
| 1331 | 1331 | |
@@ -1339,18 +1339,18 @@ discard block |
||
| 1339 | 1339 | new Wordlift_Seo_Service(); |
| 1340 | 1340 | |
| 1341 | 1341 | // Initialize the AMP service. |
| 1342 | - new Wordlift_AMP_Service( $this->jsonld_service ); |
|
| 1342 | + new Wordlift_AMP_Service($this->jsonld_service); |
|
| 1343 | 1343 | |
| 1344 | 1344 | /** Services. */ |
| 1345 | 1345 | $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
| 1346 | 1346 | new Wordlift_Image_Service(); |
| 1347 | 1347 | |
| 1348 | 1348 | /** Adapters. */ |
| 1349 | - $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
|
| 1350 | - $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service ); |
|
| 1351 | - $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 1349 | + $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter($this->entity_type_service); |
|
| 1350 | + $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter($this->publisher_service); |
|
| 1351 | + $this->tinymce_adapter = new Wordlift_Tinymce_Adapter($this); |
|
| 1352 | 1352 | //$this->faq_tinymce_adapter = new Faq_Tinymce_Adapter(); |
| 1353 | - $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
|
| 1353 | + $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter($this->relation_rebuild_service); |
|
| 1354 | 1354 | |
| 1355 | 1355 | /* |
| 1356 | 1356 | * Exclude our public js from WP-Rocket. |
@@ -1380,14 +1380,14 @@ discard block |
||
| 1380 | 1380 | $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
| 1381 | 1381 | $this->country_select_element = new Wordlift_Admin_Country_Select_Element(); |
| 1382 | 1382 | $tabs_element = new Wordlift_Admin_Tabs_Element(); |
| 1383 | - $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element ); |
|
| 1384 | - $this->author_element = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element ); |
|
| 1383 | + $this->publisher_element = new Wordlift_Admin_Publisher_Element($this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element); |
|
| 1384 | + $this->author_element = new Wordlift_Admin_Author_Element($this->publisher_service, $this->select2_element); |
|
| 1385 | 1385 | |
| 1386 | - $this->settings_page = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->country_select_element, $this->publisher_element, $this->radio_input_element ); |
|
| 1387 | - $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 1386 | + $this->settings_page = new Wordlift_Admin_Settings_Page($this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->country_select_element, $this->publisher_element, $this->radio_input_element); |
|
| 1387 | + $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link($this->settings_page); |
|
| 1388 | 1388 | |
| 1389 | - $this->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element ); |
|
| 1390 | - $this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page ); |
|
| 1389 | + $this->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page($this->configuration_service, $this->input_element, $this->radio_input_element); |
|
| 1390 | + $this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link($this->analytics_settings_page); |
|
| 1391 | 1391 | $this->analytics_connect = new Wordlift_Analytics_Connect(); |
| 1392 | 1392 | |
| 1393 | 1393 | // Pages. |
@@ -1398,9 +1398,9 @@ discard block |
||
| 1398 | 1398 | * |
| 1399 | 1399 | * @see https://github.com/insideout10/wordlift-plugin/issues/914 |
| 1400 | 1400 | */ |
| 1401 | - if ( apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 1402 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1403 | - new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 1401 | + if (apply_filters('wl_can_see_classification_box', true)) { |
|
| 1402 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1403 | + new Wordlift_Admin_Post_Edit_Page($this); |
|
| 1404 | 1404 | } |
| 1405 | 1405 | new Wordlift_Entity_Type_Admin_Service(); |
| 1406 | 1406 | |
@@ -1414,23 +1414,23 @@ discard block |
||
| 1414 | 1414 | $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
| 1415 | 1415 | |
| 1416 | 1416 | /* WordPress Admin. */ |
| 1417 | - $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 1418 | - $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 1417 | + $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page($this->configuration_service); |
|
| 1418 | + $this->status_page = new Wordlift_Admin_Status_Page($this->entity_service, $this->sparql_service); |
|
| 1419 | 1419 | |
| 1420 | 1420 | // Create an instance of the install wizard. |
| 1421 | - $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service, $this->language_select_element, $this->country_select_element ); |
|
| 1421 | + $this->admin_setup = new Wordlift_Admin_Setup($this->configuration_service, $this->key_validation_service, $this->entity_service, $this->language_select_element, $this->country_select_element); |
|
| 1422 | 1422 | |
| 1423 | - $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1423 | + $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service($this->entity_post_type_service); |
|
| 1424 | 1424 | |
| 1425 | 1425 | // User Profile. |
| 1426 | - new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1426 | + new Wordlift_Admin_User_Profile_Page($this->author_element, $this->user_service); |
|
| 1427 | 1427 | |
| 1428 | 1428 | $this->entity_page_service = new Wordlift_Entity_Page_Service(); |
| 1429 | 1429 | |
| 1430 | 1430 | // Load the debug service if WP is in debug mode. |
| 1431 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1432 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1433 | - new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1431 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
| 1432 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-debug-service.php'; |
|
| 1433 | + new Wordlift_Debug_Service($this->entity_service, $uri_service); |
|
| 1434 | 1434 | } |
| 1435 | 1435 | |
| 1436 | 1436 | // Remote Image Service. |
@@ -1443,12 +1443,12 @@ discard block |
||
| 1443 | 1443 | * |
| 1444 | 1444 | * @see https://github.com/insideout10/wordlift-plugin/issues/852. |
| 1445 | 1445 | */ |
| 1446 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php'; |
|
| 1447 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1448 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1446 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-batch-action.php'; |
|
| 1447 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1448 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1449 | 1449 | |
| 1450 | 1450 | // Create an instance of the Mapping Service and assign it to the Ajax Adapter. |
| 1451 | - new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) ); |
|
| 1451 | + new Wordlift_Mapping_Ajax_Adapter(new Wordlift_Mapping_Service(Wordlift_Entity_Type_Service::get_instance())); |
|
| 1452 | 1452 | |
| 1453 | 1453 | /* |
| 1454 | 1454 | * Batch Operations. They're similar to Batch Actions but do not require working on post types. |
@@ -1457,8 +1457,8 @@ discard block |
||
| 1457 | 1457 | * |
| 1458 | 1458 | * @since 3.20.0 |
| 1459 | 1459 | */ |
| 1460 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1461 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1460 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1461 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1462 | 1462 | |
| 1463 | 1463 | /* |
| 1464 | 1464 | * Add the Search Keywords taxonomy to manage the Search Keywords on WLS. |
@@ -1467,8 +1467,8 @@ discard block |
||
| 1467 | 1467 | * |
| 1468 | 1468 | * @since 3.20.0 |
| 1469 | 1469 | */ |
| 1470 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php'; |
|
| 1471 | - new Wordlift_Search_Keyword_Taxonomy( $api_service ); |
|
| 1470 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php'; |
|
| 1471 | + new Wordlift_Search_Keyword_Taxonomy($api_service); |
|
| 1472 | 1472 | |
| 1473 | 1473 | /* |
| 1474 | 1474 | * Load the Mappings JSON-LD post processing. |
@@ -1481,11 +1481,11 @@ discard block |
||
| 1481 | 1481 | new Post_Type_Rule_Validator(); |
| 1482 | 1482 | // Taxonomy term rule validator for validating rules for term pages. |
| 1483 | 1483 | new Taxonomy_Term_Rule_Validator(); |
| 1484 | - $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator ); |
|
| 1485 | - $rule_groups_validator = new Rule_Groups_Validator( $rule_validators_registry ); |
|
| 1486 | - $mappings_validator = new Mappings_Validator( $mappings_dbo, $rule_groups_validator ); |
|
| 1484 | + $rule_validators_registry = new Rule_Validators_Registry($default_rule_validator); |
|
| 1485 | + $rule_groups_validator = new Rule_Groups_Validator($rule_validators_registry); |
|
| 1486 | + $mappings_validator = new Mappings_Validator($mappings_dbo, $rule_groups_validator); |
|
| 1487 | 1487 | |
| 1488 | - new Url_To_Entity_Transform_Function( $this->entity_uri_service ); |
|
| 1488 | + new Url_To_Entity_Transform_Function($this->entity_uri_service); |
|
| 1489 | 1489 | new Taxonomy_To_Terms_Transform_Function(); |
| 1490 | 1490 | new Post_Id_To_Entity_Transform_Function(); |
| 1491 | 1491 | $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry(); |
@@ -1495,7 +1495,7 @@ discard block |
||
| 1495 | 1495 | * Intiailize the acf group data formatter. |
| 1496 | 1496 | */ |
| 1497 | 1497 | new Acf_Group_Formatter(); |
| 1498 | - new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry ); |
|
| 1498 | + new Jsonld_Converter($mappings_validator, $mappings_transform_functions_registry); |
|
| 1499 | 1499 | |
| 1500 | 1500 | /** |
| 1501 | 1501 | * @since 3.26.0 |
@@ -1516,7 +1516,7 @@ discard block |
||
| 1516 | 1516 | /* |
| 1517 | 1517 | * Create a singleton for the Analysis_Response_Ops_Factory. |
| 1518 | 1518 | */ |
| 1519 | - $entity_helper = new Entity_Helper( $this->entity_uri_service, $this->entity_service ); |
|
| 1519 | + $entity_helper = new Entity_Helper($this->entity_uri_service, $this->entity_service); |
|
| 1520 | 1520 | new Analysis_Response_Ops_Factory( |
| 1521 | 1521 | $this->entity_uri_service, |
| 1522 | 1522 | $this->entity_service, |
@@ -1526,11 +1526,11 @@ discard block |
||
| 1526 | 1526 | ); |
| 1527 | 1527 | |
| 1528 | 1528 | /** WL Autocomplete. */ |
| 1529 | - $autocomplete_service = new All_Autocomplete_Service( array( |
|
| 1529 | + $autocomplete_service = new All_Autocomplete_Service(array( |
|
| 1530 | 1530 | new Local_Autocomplete_Service(), |
| 1531 | - new Linked_Data_Autocomplete_Service( $this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service ), |
|
| 1532 | - ) ); |
|
| 1533 | - $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service ); |
|
| 1531 | + new Linked_Data_Autocomplete_Service($this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service), |
|
| 1532 | + )); |
|
| 1533 | + $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter($autocomplete_service); |
|
| 1534 | 1534 | |
| 1535 | 1535 | /** |
| 1536 | 1536 | * @since 3.27.2 |
@@ -1539,10 +1539,10 @@ discard block |
||
| 1539 | 1539 | */ |
| 1540 | 1540 | new Recipe_Maker_Post_Type_Hook(); |
| 1541 | 1541 | $recipe_maker_validation_service = new Recipe_Maker_Validation_Service(); |
| 1542 | - new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service ); |
|
| 1543 | - new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service ); |
|
| 1544 | - new Recipe_Maker_Warning( $recipe_maker_validation_service ); |
|
| 1545 | - new Yoast_Jsonld( $recipe_maker_validation_service ); |
|
| 1542 | + new Recipe_Maker_Jsonld_Hook($attachment_service, $recipe_maker_validation_service); |
|
| 1543 | + new Recipe_Maker_After_Get_Jsonld_Hook($recipe_maker_validation_service); |
|
| 1544 | + new Recipe_Maker_Warning($recipe_maker_validation_service); |
|
| 1545 | + new Yoast_Jsonld($recipe_maker_validation_service); |
|
| 1546 | 1546 | |
| 1547 | 1547 | /** |
| 1548 | 1548 | * @since 3.27.4 |
@@ -1563,9 +1563,9 @@ discard block |
||
| 1563 | 1563 | private function set_locale() { |
| 1564 | 1564 | |
| 1565 | 1565 | $plugin_i18n = new Wordlift_i18n(); |
| 1566 | - $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1566 | + $plugin_i18n->set_domain($this->get_plugin_name()); |
|
| 1567 | 1567 | |
| 1568 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1568 | + $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain'); |
|
| 1569 | 1569 | |
| 1570 | 1570 | } |
| 1571 | 1571 | |
@@ -1586,29 +1586,29 @@ discard block |
||
| 1586 | 1586 | $this->user_service |
| 1587 | 1587 | ); |
| 1588 | 1588 | |
| 1589 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1590 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 ); |
|
| 1589 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles'); |
|
| 1590 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11); |
|
| 1591 | 1591 | |
| 1592 | 1592 | // Hook the init action to taxonomy services. |
| 1593 | - $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1594 | - $this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 ); |
|
| 1593 | + $this->loader->add_action('init', $this->topic_taxonomy_service, 'init', 0); |
|
| 1594 | + $this->loader->add_action('init', $this->entity_types_taxonomy_service, 'init', 0); |
|
| 1595 | 1595 | |
| 1596 | 1596 | // Hook the deleted_post_meta action to the Thumbnail service. |
| 1597 | - $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1597 | + $this->loader->add_action('deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4); |
|
| 1598 | 1598 | |
| 1599 | 1599 | // Hook the added_post_meta action to the Thumbnail service. |
| 1600 | - $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1600 | + $this->loader->add_action('added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4); |
|
| 1601 | 1601 | |
| 1602 | 1602 | // Hook the updated_post_meta action to the Thumbnail service. |
| 1603 | - $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1603 | + $this->loader->add_action('updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4); |
|
| 1604 | 1604 | |
| 1605 | 1605 | // Hook the AJAX wl_timeline action to the Timeline service. |
| 1606 | - $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1606 | + $this->loader->add_action('wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline'); |
|
| 1607 | 1607 | |
| 1608 | 1608 | // Register custom allowed redirect hosts. |
| 1609 | - $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1609 | + $this->loader->add_filter('allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts'); |
|
| 1610 | 1610 | // Hook the AJAX wordlift_redirect action to the Redirect service. |
| 1611 | - $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1611 | + $this->loader->add_action('wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect'); |
|
| 1612 | 1612 | |
| 1613 | 1613 | /* |
| 1614 | 1614 | * The old dashboard is replaced with dashboard v2. |
@@ -1626,46 +1626,46 @@ discard block |
||
| 1626 | 1626 | |
| 1627 | 1627 | // Hook save_post to the entity service to update custom fields (such as alternate labels). |
| 1628 | 1628 | // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
| 1629 | - $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1630 | - $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1629 | + $this->loader->add_action('save_post', $this->entity_service, 'save_post', 9, 3); |
|
| 1630 | + $this->loader->add_action('save_post', $this->rating_service, 'set_rating_for', 20, 1); |
|
| 1631 | 1631 | |
| 1632 | - $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1633 | - $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1632 | + $this->loader->add_action('edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1); |
|
| 1633 | + $this->loader->add_action('in_admin_header', $this->rating_service, 'in_admin_header'); |
|
| 1634 | 1634 | |
| 1635 | 1635 | // Entity listing customization (wp-admin/edit.php) |
| 1636 | 1636 | // Add custom columns. |
| 1637 | - $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1637 | + $this->loader->add_filter('manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns'); |
|
| 1638 | 1638 | // no explicit entity as it prevents handling of other post types. |
| 1639 | - $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1639 | + $this->loader->add_filter('manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2); |
|
| 1640 | 1640 | // Add 4W selection. |
| 1641 | - $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1642 | - $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1643 | - $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' ); |
|
| 1644 | - $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' ); |
|
| 1641 | + $this->loader->add_action('restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope'); |
|
| 1642 | + $this->loader->add_filter('posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope'); |
|
| 1643 | + $this->loader->add_action('pre_get_posts', $this->entity_list_service, 'pre_get_posts'); |
|
| 1644 | + $this->loader->add_action('load-edit.php', $this->entity_list_service, 'load_edit'); |
|
| 1645 | 1645 | |
| 1646 | 1646 | /* |
| 1647 | 1647 | * If `All Entity Types` is disable, use the radio button Walker. |
| 1648 | 1648 | * |
| 1649 | 1649 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1650 | 1650 | */ |
| 1651 | - if ( ! WL_ALL_ENTITY_TYPES ) { |
|
| 1652 | - $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1651 | + if ( ! WL_ALL_ENTITY_TYPES) { |
|
| 1652 | + $this->loader->add_filter('wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args'); |
|
| 1653 | 1653 | } |
| 1654 | 1654 | |
| 1655 | 1655 | // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
| 1656 | 1656 | // entities. |
| 1657 | - $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1657 | + $this->loader->add_filter('prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2); |
|
| 1658 | 1658 | |
| 1659 | 1659 | // Filter imported post meta. |
| 1660 | - $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1660 | + $this->loader->add_filter('wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3); |
|
| 1661 | 1661 | |
| 1662 | 1662 | // Notify the import service when an import starts and ends. |
| 1663 | - $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1664 | - $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1663 | + $this->loader->add_action('import_start', $this->import_service, 'import_start', 10, 0); |
|
| 1664 | + $this->loader->add_action('import_end', $this->import_service, 'import_end', 10, 0); |
|
| 1665 | 1665 | |
| 1666 | 1666 | // Hook the AJAX wl_rebuild action to the Rebuild Service. |
| 1667 | - $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1668 | - $this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' ); |
|
| 1667 | + $this->loader->add_action('wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild'); |
|
| 1668 | + $this->loader->add_action('wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild'); |
|
| 1669 | 1669 | |
| 1670 | 1670 | /** |
| 1671 | 1671 | * Filter: wl_feature__enable__screens. |
@@ -1675,34 +1675,34 @@ discard block |
||
| 1675 | 1675 | * @return bool |
| 1676 | 1676 | * @since 3.27.6 |
| 1677 | 1677 | */ |
| 1678 | - if ( apply_filters( 'wl_feature__enable__screens', true ) ) { |
|
| 1678 | + if (apply_filters('wl_feature__enable__screens', true)) { |
|
| 1679 | 1679 | // Hook the menu to the Download Your Data page. |
| 1680 | - $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 ); |
|
| 1681 | - $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 ); |
|
| 1682 | - $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 ); |
|
| 1680 | + $this->loader->add_action('admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0); |
|
| 1681 | + $this->loader->add_action('admin_menu', $this->status_page, 'admin_menu', 100, 0); |
|
| 1682 | + $this->loader->add_action('admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0); |
|
| 1683 | 1683 | } |
| 1684 | 1684 | // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
| 1685 | - $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1685 | + $this->loader->add_action('wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10); |
|
| 1686 | 1686 | |
| 1687 | 1687 | // Hook the AJAX wl_jsonld action to the JSON-LD service. |
| 1688 | - $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1689 | - $this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1690 | - $this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1688 | + $this->loader->add_action('wp_ajax_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1689 | + $this->loader->add_action('admin_post_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1690 | + $this->loader->add_action('admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1691 | 1691 | |
| 1692 | 1692 | // Hook the AJAX wl_validate_key action to the Key Validation service. |
| 1693 | - $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1693 | + $this->loader->add_action('wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key'); |
|
| 1694 | 1694 | |
| 1695 | 1695 | // Hook the AJAX wl_update_country_options action to the countries. |
| 1696 | - $this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' ); |
|
| 1696 | + $this->loader->add_action('wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html'); |
|
| 1697 | 1697 | |
| 1698 | 1698 | // Hook the `admin_init` function to the Admin Setup. |
| 1699 | - $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1699 | + $this->loader->add_action('admin_init', $this->admin_setup, 'admin_init'); |
|
| 1700 | 1700 | |
| 1701 | 1701 | // Hook the admin_init to the settings page. |
| 1702 | - $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1703 | - $this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' ); |
|
| 1702 | + $this->loader->add_action('admin_init', $this->settings_page, 'admin_init'); |
|
| 1703 | + $this->loader->add_action('admin_init', $this->analytics_settings_page, 'admin_init'); |
|
| 1704 | 1704 | |
| 1705 | - $this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' ); |
|
| 1705 | + $this->loader->add_filter('admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction'); |
|
| 1706 | 1706 | |
| 1707 | 1707 | // Hook the menu creation on the general wordlift menu creation. |
| 1708 | 1708 | /** |
@@ -1713,8 +1713,8 @@ discard block |
||
| 1713 | 1713 | * @return bool |
| 1714 | 1714 | * @since 3.27.6 |
| 1715 | 1715 | */ |
| 1716 | - if ( apply_filters( 'wl_feature__enable__screens', true ) ) { |
|
| 1717 | - $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 ); |
|
| 1716 | + if (apply_filters('wl_feature__enable__screens', true)) { |
|
| 1717 | + $this->loader->add_action('wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2); |
|
| 1718 | 1718 | } |
| 1719 | 1719 | /* |
| 1720 | 1720 | * Display the `Wordlift_Admin_Search_Rankings_Page` page. |
@@ -1723,7 +1723,7 @@ discard block |
||
| 1723 | 1723 | * |
| 1724 | 1724 | * @since 3.20.0 |
| 1725 | 1725 | */ |
| 1726 | - if ( in_array( $this->configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) { |
|
| 1726 | + if (in_array($this->configuration_service->get_package_type(), array('editorial', 'business'))) { |
|
| 1727 | 1727 | /** |
| 1728 | 1728 | * Filter: wl_feature__enable__screens. |
| 1729 | 1729 | * |
@@ -1732,18 +1732,18 @@ discard block |
||
| 1732 | 1732 | * @return bool |
| 1733 | 1733 | * @since 3.27.6 |
| 1734 | 1734 | */ |
| 1735 | - if ( apply_filters( 'wl_feature__enable__screens', true ) ) { |
|
| 1735 | + if (apply_filters('wl_feature__enable__screens', true)) { |
|
| 1736 | 1736 | $admin_search_rankings_page = new Wordlift_Admin_Search_Rankings_Page(); |
| 1737 | - $this->loader->add_action( 'wl_admin_menu', $admin_search_rankings_page, 'admin_menu' ); |
|
| 1737 | + $this->loader->add_action('wl_admin_menu', $admin_search_rankings_page, 'admin_menu'); |
|
| 1738 | 1738 | } |
| 1739 | 1739 | } |
| 1740 | 1740 | |
| 1741 | 1741 | // Hook key update. |
| 1742 | - $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1743 | - $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1742 | + $this->loader->add_action('pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2); |
|
| 1743 | + $this->loader->add_action('update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2); |
|
| 1744 | 1744 | |
| 1745 | 1745 | // Add additional action links to the WordLift plugin in the plugins page. |
| 1746 | - $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1746 | + $this->loader->add_filter('plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1); |
|
| 1747 | 1747 | |
| 1748 | 1748 | /* |
| 1749 | 1749 | * Remove the Analytics Settings link from the plugin page. |
@@ -1754,25 +1754,25 @@ discard block |
||
| 1754 | 1754 | // $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 ); |
| 1755 | 1755 | |
| 1756 | 1756 | // Hook the AJAX `wl_publisher` action name. |
| 1757 | - $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1757 | + $this->loader->add_action('wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher'); |
|
| 1758 | 1758 | |
| 1759 | 1759 | // Hook row actions for the entity type list admin. |
| 1760 | - $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1760 | + $this->loader->add_filter('wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2); |
|
| 1761 | 1761 | |
| 1762 | 1762 | /** Ajax actions. */ |
| 1763 | - $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' ); |
|
| 1763 | + $this->loader->add_action('wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export'); |
|
| 1764 | 1764 | |
| 1765 | 1765 | // Hook capabilities manipulation to allow access to entity type admin |
| 1766 | 1766 | // page on WordPress versions before 4.7. |
| 1767 | 1767 | global $wp_version; |
| 1768 | - if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1769 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1768 | + if (version_compare($wp_version, '4.7', '<')) { |
|
| 1769 | + $this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4); |
|
| 1770 | 1770 | } |
| 1771 | 1771 | |
| 1772 | - $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1772 | + $this->loader->add_action('wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1); |
|
| 1773 | 1773 | |
| 1774 | 1774 | /** Adapters. */ |
| 1775 | - $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1775 | + $this->loader->add_filter('mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1); |
|
| 1776 | 1776 | /** |
| 1777 | 1777 | * Disabling Faq temporarily. |
| 1778 | 1778 | * Load the tinymce editor button on the tool bar. |
@@ -1783,59 +1783,59 @@ discard block |
||
| 1783 | 1783 | //$this->loader->add_filter( 'mce_external_plugins', $this->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 ); |
| 1784 | 1784 | |
| 1785 | 1785 | |
| 1786 | - $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' ); |
|
| 1787 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' ); |
|
| 1788 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' ); |
|
| 1786 | + $this->loader->add_action('wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all'); |
|
| 1787 | + $this->loader->add_action('wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create'); |
|
| 1788 | + $this->loader->add_action('wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete'); |
|
| 1789 | 1789 | /** |
| 1790 | 1790 | * @since 3.26.0 |
| 1791 | 1791 | * Post excerpt meta box would be only loaded when the language is set |
| 1792 | 1792 | * to english |
| 1793 | 1793 | */ |
| 1794 | - if ( $this->configuration_service->get_language_code() === 'en' && |
|
| 1795 | - apply_filters( 'wl_feature__enable__post_excerpt', true ) ) { |
|
| 1794 | + if ($this->configuration_service->get_language_code() === 'en' && |
|
| 1795 | + apply_filters('wl_feature__enable__post_excerpt', true)) { |
|
| 1796 | 1796 | $excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter(); |
| 1797 | - $this->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' ); |
|
| 1797 | + $this->loader->add_action('do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box'); |
|
| 1798 | 1798 | // Adding Rest route for the post excerpt |
| 1799 | 1799 | Post_Excerpt_Rest_Controller::register_routes(); |
| 1800 | 1800 | } |
| 1801 | 1801 | |
| 1802 | - $this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 ); |
|
| 1803 | - $this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 ); |
|
| 1802 | + $this->loader->add_action('update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5); |
|
| 1803 | + $this->loader->add_action('delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5); |
|
| 1804 | 1804 | |
| 1805 | 1805 | // Handle the autocomplete request. |
| 1806 | - add_action( 'wp_ajax_wl_autocomplete', array( |
|
| 1806 | + add_action('wp_ajax_wl_autocomplete', array( |
|
| 1807 | 1807 | $this->autocomplete_adapter, |
| 1808 | 1808 | 'wl_autocomplete', |
| 1809 | - ) ); |
|
| 1810 | - add_action( 'wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1809 | + )); |
|
| 1810 | + add_action('wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1811 | 1811 | $this->autocomplete_adapter, |
| 1812 | 1812 | 'wl_autocomplete', |
| 1813 | - ) ); |
|
| 1813 | + )); |
|
| 1814 | 1814 | |
| 1815 | 1815 | // Hooks to restrict multisite super admin from manipulating entity types. |
| 1816 | - if ( is_multisite() ) { |
|
| 1817 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1816 | + if (is_multisite()) { |
|
| 1817 | + $this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4); |
|
| 1818 | 1818 | } |
| 1819 | 1819 | |
| 1820 | - $deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service ); |
|
| 1820 | + $deactivator_feedback = new Wordlift_Deactivator_Feedback($this->configuration_service); |
|
| 1821 | 1821 | |
| 1822 | - add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) ); |
|
| 1823 | - add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) ); |
|
| 1824 | - add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) ); |
|
| 1822 | + add_action('admin_footer', array($deactivator_feedback, 'render_feedback_popup')); |
|
| 1823 | + add_action('admin_enqueue_scripts', array($deactivator_feedback, 'enqueue_popup_scripts')); |
|
| 1824 | + add_action('wp_ajax_wl_deactivation_feedback', array($deactivator_feedback, 'wl_deactivation_feedback')); |
|
| 1825 | 1825 | |
| 1826 | 1826 | /** |
| 1827 | 1827 | * Always allow the `wordlift/classification` block. |
| 1828 | 1828 | * |
| 1829 | 1829 | * @since 3.23.0 |
| 1830 | 1830 | */ |
| 1831 | - add_filter( 'allowed_block_types', function ( $value ) { |
|
| 1831 | + add_filter('allowed_block_types', function($value) { |
|
| 1832 | 1832 | |
| 1833 | - if ( true === $value ) { |
|
| 1833 | + if (true === $value) { |
|
| 1834 | 1834 | return $value; |
| 1835 | 1835 | } |
| 1836 | 1836 | |
| 1837 | - return array_merge( (array) $value, array( 'wordlift/classification' ) ); |
|
| 1838 | - }, PHP_INT_MAX ); |
|
| 1837 | + return array_merge((array) $value, array('wordlift/classification')); |
|
| 1838 | + }, PHP_INT_MAX); |
|
| 1839 | 1839 | |
| 1840 | 1840 | /** |
| 1841 | 1841 | * @since 3.27.7 |
@@ -1853,58 +1853,58 @@ discard block |
||
| 1853 | 1853 | */ |
| 1854 | 1854 | private function define_public_hooks() { |
| 1855 | 1855 | |
| 1856 | - $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1856 | + $plugin_public = new Wordlift_Public($this->get_plugin_name(), $this->get_version()); |
|
| 1857 | 1857 | |
| 1858 | 1858 | // Register the entity post type. |
| 1859 | - $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1859 | + $this->loader->add_action('init', $this->entity_post_type_service, 'register'); |
|
| 1860 | 1860 | |
| 1861 | 1861 | // Bind the link generation and handling hooks to the entity link service. |
| 1862 | - $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1863 | - $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1864 | - $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 ); |
|
| 1865 | - $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 ); |
|
| 1862 | + $this->loader->add_filter('post_type_link', $this->entity_link_service, 'post_type_link', 10, 4); |
|
| 1863 | + $this->loader->add_action('pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1); |
|
| 1864 | + $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); |
|
| 1865 | + $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); |
|
| 1866 | 1866 | |
| 1867 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1868 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1869 | - $this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' ); |
|
| 1867 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles'); |
|
| 1868 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts'); |
|
| 1869 | + $this->loader->add_action('wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts'); |
|
| 1870 | 1870 | |
| 1871 | 1871 | // Registering Faq_Content_Filter service used for removing faq question and answer tags from the html. |
| 1872 | - $this->loader->add_filter( 'the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' ); |
|
| 1872 | + $this->loader->add_filter('the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags'); |
|
| 1873 | 1873 | // Hook the content filter service to add entity links. |
| 1874 | - if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) { |
|
| 1875 | - $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1874 | + if ( ! defined('WL_DISABLE_CONTENT_FILTER') || ! WL_DISABLE_CONTENT_FILTER) { |
|
| 1875 | + $this->loader->add_filter('the_content', $this->content_filter_service, 'the_content'); |
|
| 1876 | 1876 | } |
| 1877 | 1877 | |
| 1878 | 1878 | // Hook the AJAX wl_timeline action to the Timeline service. |
| 1879 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1879 | + $this->loader->add_action('wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline'); |
|
| 1880 | 1880 | |
| 1881 | 1881 | // Hook the ShareThis service. |
| 1882 | - $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1883 | - $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1882 | + $this->loader->add_filter('the_content', $this->sharethis_service, 'the_content', 99); |
|
| 1883 | + $this->loader->add_filter('the_excerpt', $this->sharethis_service, 'the_excerpt', 99); |
|
| 1884 | 1884 | |
| 1885 | 1885 | // Hook the AJAX wl_jsonld action to the JSON-LD service. |
| 1886 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1886 | + $this->loader->add_action('wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1887 | 1887 | |
| 1888 | 1888 | // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
| 1889 | 1889 | // in order to tweak WP's `WP_Query` to include entities in queries related |
| 1890 | 1890 | // to categories. |
| 1891 | - $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1891 | + $this->loader->add_action('pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1); |
|
| 1892 | 1892 | |
| 1893 | 1893 | /* |
| 1894 | 1894 | * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service` |
| 1895 | 1895 | * in order to tweak WP's `WP_Query` to show event related entities in reverse |
| 1896 | 1896 | * order of start time. |
| 1897 | 1897 | */ |
| 1898 | - $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1898 | + $this->loader->add_action('pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1); |
|
| 1899 | 1899 | |
| 1900 | - $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1900 | + $this->loader->add_action('wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1); |
|
| 1901 | 1901 | |
| 1902 | 1902 | // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
| 1903 | - $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1903 | + $this->loader->add_action('save_post', $this->entity_type_adapter, 'save_post', 9, 3); |
|
| 1904 | 1904 | |
| 1905 | 1905 | // Analytics Script Frontend. |
| 1906 | - if ( $this->configuration_service->is_analytics_enable() ) { |
|
| 1907 | - $this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 ); |
|
| 1906 | + if ($this->configuration_service->is_analytics_enable()) { |
|
| 1907 | + $this->loader->add_action('wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10); |
|
| 1908 | 1908 | } |
| 1909 | 1909 | |
| 1910 | 1910 | } |
@@ -1957,11 +1957,11 @@ discard block |
||
| 1957 | 1957 | */ |
| 1958 | 1958 | private function load_cli_dependencies() { |
| 1959 | 1959 | |
| 1960 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php'; |
|
| 1960 | + require_once plugin_dir_path(dirname(__FILE__)).'cli/class-wordlift-push-reference-data-command.php'; |
|
| 1961 | 1961 | |
| 1962 | - $push_reference_data_command = new Wordlift_Push_Reference_Data_Command( $this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service ); |
|
| 1962 | + $push_reference_data_command = new Wordlift_Push_Reference_Data_Command($this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service); |
|
| 1963 | 1963 | |
| 1964 | - WP_CLI::add_command( 'wl references push', $push_reference_data_command ); |
|
| 1964 | + WP_CLI::add_command('wl references push', $push_reference_data_command); |
|
| 1965 | 1965 | |
| 1966 | 1966 | } |
| 1967 | 1967 | |
@@ -1986,11 +1986,11 @@ discard block |
||
| 1986 | 1986 | * @since 3.27.6 |
| 1987 | 1987 | */ |
| 1988 | 1988 | |
| 1989 | - wp_register_script( 'wl_enabled_blocks', false ); |
|
| 1989 | + wp_register_script('wl_enabled_blocks', false); |
|
| 1990 | 1990 | |
| 1991 | - $enabled_blocks = array( 'wordlift/products-navigator' ); |
|
| 1991 | + $enabled_blocks = array('wordlift/products-navigator'); |
|
| 1992 | 1992 | |
| 1993 | - if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
| 1993 | + if (apply_filters('wl_feature__enable__blocks', true)) { |
|
| 1994 | 1994 | // To intimate JS |
| 1995 | 1995 | $enabled_blocks = array_merge($enabled_blocks, array( |
| 1996 | 1996 | 'wordlift/navigator', |
@@ -2003,8 +2003,8 @@ discard block |
||
| 2003 | 2003 | )); |
| 2004 | 2004 | } |
| 2005 | 2005 | |
| 2006 | - wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks ); |
|
| 2007 | - wp_enqueue_script( 'wl_enabled_blocks' ); |
|
| 2006 | + wp_localize_script('wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks); |
|
| 2007 | + wp_enqueue_script('wl_enabled_blocks'); |
|
| 2008 | 2008 | } |
| 2009 | 2009 | |
| 2010 | 2010 | } |
@@ -7,24 +7,24 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | class Top_Entities { |
| 9 | 9 | |
| 10 | - const CRON_ACTION = 'wl_admin_dashboard_top_entities'; |
|
| 10 | + const CRON_ACTION = 'wl_admin_dashboard_top_entities'; |
|
| 11 | 11 | |
| 12 | - /** |
|
| 13 | - * Option key where the top entities data is stored. |
|
| 14 | - */ |
|
| 15 | - const OPTION_KEY = 'wl_admin_dashboard_top_entities_option'; |
|
| 12 | + /** |
|
| 13 | + * Option key where the top entities data is stored. |
|
| 14 | + */ |
|
| 15 | + const OPTION_KEY = 'wl_admin_dashboard_top_entities_option'; |
|
| 16 | 16 | |
| 17 | 17 | |
| 18 | - public function __construct() { |
|
| 19 | - add_action( self::CRON_ACTION, array( $this, 'save_top_entities' ) ); |
|
| 20 | - } |
|
| 18 | + public function __construct() { |
|
| 19 | + add_action( self::CRON_ACTION, array( $this, 'save_top_entities' ) ); |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | 22 | |
| 23 | - public function save_top_entities() { |
|
| 23 | + public function save_top_entities() { |
|
| 24 | 24 | |
| 25 | - global $wpdb; |
|
| 25 | + global $wpdb; |
|
| 26 | 26 | |
| 27 | - $query = <<<EOF |
|
| 27 | + $query = <<<EOF |
|
| 28 | 28 | SELECT p.ID |
| 29 | 29 | , p.post_title |
| 30 | 30 | , coalesce(sum(case when obj_t.slug is null then 1 end), 0) entities |
@@ -54,21 +54,21 @@ discard block |
||
| 54 | 54 | LIMIT 20; |
| 55 | 55 | EOF; |
| 56 | 56 | |
| 57 | - $results = $wpdb->get_results( $query ); |
|
| 57 | + $results = $wpdb->get_results( $query ); |
|
| 58 | 58 | |
| 59 | - update_option( self::OPTION_KEY, $results ); |
|
| 60 | - } |
|
| 59 | + update_option( self::OPTION_KEY, $results ); |
|
| 60 | + } |
|
| 61 | 61 | |
| 62 | 62 | |
| 63 | - public static function activate() { |
|
| 64 | - if ( ! wp_next_scheduled( self::CRON_ACTION ) ) { |
|
| 65 | - wp_schedule_event( time(), 'hourly', self::CRON_ACTION ); |
|
| 66 | - } |
|
| 67 | - } |
|
| 63 | + public static function activate() { |
|
| 64 | + if ( ! wp_next_scheduled( self::CRON_ACTION ) ) { |
|
| 65 | + wp_schedule_event( time(), 'hourly', self::CRON_ACTION ); |
|
| 66 | + } |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - public static function deactivate() { |
|
| 70 | - $timestamp = wp_next_scheduled( self::CRON_ACTION ); |
|
| 71 | - wp_unschedule_event( $timestamp, self::CRON_ACTION ); |
|
| 72 | - } |
|
| 69 | + public static function deactivate() { |
|
| 70 | + $timestamp = wp_next_scheduled( self::CRON_ACTION ); |
|
| 71 | + wp_unschedule_event( $timestamp, self::CRON_ACTION ); |
|
| 72 | + } |
|
| 73 | 73 | |
| 74 | 74 | } |
| 75 | 75 | \ No newline at end of file |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | public function __construct() { |
| 19 | - add_action( self::CRON_ACTION, array( $this, 'save_top_entities' ) ); |
|
| 19 | + add_action(self::CRON_ACTION, array($this, 'save_top_entities')); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | |
@@ -54,21 +54,21 @@ discard block |
||
| 54 | 54 | LIMIT 20; |
| 55 | 55 | EOF; |
| 56 | 56 | |
| 57 | - $results = $wpdb->get_results( $query ); |
|
| 57 | + $results = $wpdb->get_results($query); |
|
| 58 | 58 | |
| 59 | - update_option( self::OPTION_KEY, $results ); |
|
| 59 | + update_option(self::OPTION_KEY, $results); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
| 63 | 63 | public static function activate() { |
| 64 | - if ( ! wp_next_scheduled( self::CRON_ACTION ) ) { |
|
| 65 | - wp_schedule_event( time(), 'hourly', self::CRON_ACTION ); |
|
| 64 | + if ( ! wp_next_scheduled(self::CRON_ACTION)) { |
|
| 65 | + wp_schedule_event(time(), 'hourly', self::CRON_ACTION); |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | public static function deactivate() { |
| 70 | - $timestamp = wp_next_scheduled( self::CRON_ACTION ); |
|
| 71 | - wp_unschedule_event( $timestamp, self::CRON_ACTION ); |
|
| 70 | + $timestamp = wp_next_scheduled(self::CRON_ACTION); |
|
| 71 | + wp_unschedule_event($timestamp, self::CRON_ACTION); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | } |
| 75 | 75 | \ No newline at end of file |