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