@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <p> |
| 2 | - <input type="radio" id="wl_exclude_include_urls_settings_include_exclude_include" name="wl_exclude_include_urls_settings[include_exclude]" value="exclude" <?php checked( $options['include_exclude'], 'exclude', true ); // phpcs:ignore ?>> |
|
| 3 | - <label for="wl_exclude_include_urls_settings_include_exclude_include"><?php echo esc_html__( 'Exclude', 'wordlift' ); ?></label> |
|
| 2 | + <input type="radio" id="wl_exclude_include_urls_settings_include_exclude_include" name="wl_exclude_include_urls_settings[include_exclude]" value="exclude" <?php checked($options['include_exclude'], 'exclude', true); // phpcs:ignore ?>> |
|
| 3 | + <label for="wl_exclude_include_urls_settings_include_exclude_include"><?php echo esc_html__('Exclude', 'wordlift'); ?></label> |
|
| 4 | 4 | </p> |
| 5 | 5 | <p> |
| 6 | - <input type="radio" id="wl_exclude_include_urls_settings_include_exclude_exclude" name="wl_exclude_include_urls_settings[include_exclude]" value="include" <?php checked( $options['include_exclude'], 'include', true ); // phpcs:ignore ?>> |
|
| 7 | - <label for="wl_exclude_include_urls_settings_include_exclude_exclude"><?php echo esc_html__( 'Include', 'wordlift' ); ?></label> |
|
| 6 | + <input type="radio" id="wl_exclude_include_urls_settings_include_exclude_exclude" name="wl_exclude_include_urls_settings[include_exclude]" value="include" <?php checked($options['include_exclude'], 'include', true); // phpcs:ignore ?>> |
|
| 7 | + <label for="wl_exclude_include_urls_settings_include_exclude_exclude"><?php echo esc_html__('Include', 'wordlift'); ?></label> |
|
| 8 | 8 | </p> |
@@ -2,9 +2,9 @@ |
||
| 2 | 2 | <h2><?php echo esc_html__( 'Exclude / Include URLs', 'wordlift' ); ?></h2> |
| 3 | 3 | <form action='options.php' method='post'> |
| 4 | 4 | <?php |
| 5 | - settings_fields( 'wl_exclude_include_urls_settings_group' ); |
|
| 6 | - do_settings_sections( 'wl_exclude_include_urls_settings_page' ); |
|
| 7 | - submit_button(); |
|
| 8 | - ?> |
|
| 5 | + settings_fields( 'wl_exclude_include_urls_settings_group' ); |
|
| 6 | + do_settings_sections( 'wl_exclude_include_urls_settings_page' ); |
|
| 7 | + submit_button(); |
|
| 8 | + ?> |
|
| 9 | 9 | </form> |
| 10 | 10 | </div> |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <div class="wrap" id="wl-settings-page"> |
| 2 | - <h2><?php echo esc_html__( 'Exclude / Include URLs', 'wordlift' ); ?></h2> |
|
| 2 | + <h2><?php echo esc_html__('Exclude / Include URLs', 'wordlift'); ?></h2> |
|
| 3 | 3 | <form action='options.php' method='post'> |
| 4 | 4 | <?php |
| 5 | - settings_fields( 'wl_exclude_include_urls_settings_group' ); |
|
| 6 | - do_settings_sections( 'wl_exclude_include_urls_settings_page' ); |
|
| 5 | + settings_fields('wl_exclude_include_urls_settings_group'); |
|
| 6 | + do_settings_sections('wl_exclude_include_urls_settings_page'); |
|
| 7 | 7 | submit_button(); |
| 8 | 8 | ?> |
| 9 | 9 | </form> |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <p> |
| 2 | 2 | <label for="wl_exclude_include_urls_settings_urls"> |
| 3 | 3 | <?php |
| 4 | - echo sprintf( |
|
| 5 | - '%s <code>%s</code>', |
|
| 6 | - esc_html__( 'One relative or absolute URL per line. Relative URLs will be converted to absolute in context of', 'wordlift' ), |
|
| 7 | - esc_url( site_url() ) |
|
| 8 | - ); |
|
| 9 | - ?> |
|
| 4 | + echo sprintf( |
|
| 5 | + '%s <code>%s</code>', |
|
| 6 | + esc_html__( 'One relative or absolute URL per line. Relative URLs will be converted to absolute in context of', 'wordlift' ), |
|
| 7 | + esc_url( site_url() ) |
|
| 8 | + ); |
|
| 9 | + ?> |
|
| 10 | 10 | </label> |
| 11 | 11 | </p> |
| 12 | 12 | <p> |
@@ -3,12 +3,12 @@ |
||
| 3 | 3 | <?php |
| 4 | 4 | echo sprintf( |
| 5 | 5 | '%s <code>%s</code>', |
| 6 | - esc_html__( 'One relative or absolute URL per line. Relative URLs will be converted to absolute in context of', 'wordlift' ), |
|
| 7 | - esc_url( site_url() ) |
|
| 6 | + esc_html__('One relative or absolute URL per line. Relative URLs will be converted to absolute in context of', 'wordlift'), |
|
| 7 | + esc_url(site_url()) |
|
| 8 | 8 | ); |
| 9 | 9 | ?> |
| 10 | 10 | </label> |
| 11 | 11 | </p> |
| 12 | 12 | <p> |
| 13 | - <textarea id="wl_exclude_include_urls_settings_urls" name='wl_exclude_include_urls_settings[urls]' class="large-text code" rows="10"><?php echo esc_textarea( $options['urls'] ); // phpcs:ignore ?></textarea> |
|
| 13 | + <textarea id="wl_exclude_include_urls_settings_urls" name='wl_exclude_include_urls_settings[urls]' class="large-text code" rows="10"><?php echo esc_textarea($options['urls']); // phpcs:ignore ?></textarea> |
|
| 14 | 14 | </p> |
@@ -32,24 +32,24 @@ 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.39.0-dev' ); |
|
| 40 | -require_once __DIR__ . '/modules/common/load.php'; |
|
| 41 | -require_once __DIR__ . '/modules/include-exclude/load.php'; |
|
| 39 | +define('WORDLIFT_VERSION', '3.39.0-dev'); |
|
| 40 | +require_once __DIR__.'/modules/common/load.php'; |
|
| 41 | +require_once __DIR__.'/modules/include-exclude/load.php'; |
|
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * Filter to disable WLP on any request, defaults to true. |
| 45 | 45 | * |
| 46 | 46 | * @since 3.33.6 |
| 47 | 47 | */ |
| 48 | -if ( ! apply_filters( 'wl_is_enabled', true ) ) { |
|
| 48 | +if ( ! apply_filters('wl_is_enabled', true)) { |
|
| 49 | 49 | return; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | -require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php'; |
|
| 52 | +require_once plugin_dir_path(__FILE__).'vendor/autoload.php'; |
|
| 53 | 53 | |
| 54 | 54 | /* |
| 55 | 55 | * We introduce the WordLift autoloader, since we start using classes in namespaces, i.e. Wordlift\Http. |
@@ -59,15 +59,15 @@ discard block |
||
| 59 | 59 | wordlift_plugin_autoload_register(); |
| 60 | 60 | |
| 61 | 61 | // Include WordLift constants. |
| 62 | -require_once plugin_dir_path( __FILE__ ) . 'wordlift-constants.php'; |
|
| 62 | +require_once plugin_dir_path(__FILE__).'wordlift-constants.php'; |
|
| 63 | 63 | |
| 64 | 64 | // Load modules. |
| 65 | -require_once plugin_dir_path( __FILE__ ) . 'modules/core/wordlift-core.php'; |
|
| 65 | +require_once plugin_dir_path(__FILE__).'modules/core/wordlift-core.php'; |
|
| 66 | 66 | |
| 67 | -require_once plugin_dir_path( __FILE__ ) . 'deprecations.php'; |
|
| 67 | +require_once plugin_dir_path(__FILE__).'deprecations.php'; |
|
| 68 | 68 | |
| 69 | 69 | // Load early to enable/disable features. |
| 70 | -require_once plugin_dir_path( __FILE__ ) . 'wordlift/features/index.php'; |
|
| 70 | +require_once plugin_dir_path(__FILE__).'wordlift/features/index.php'; |
|
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | 73 | * The code that runs during plugin activation. |
@@ -75,11 +75,11 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | function activate_wordlift() { |
| 77 | 77 | |
| 78 | - $log = Wordlift_Log_Service::get_logger( 'activate_wordlift' ); |
|
| 78 | + $log = Wordlift_Log_Service::get_logger('activate_wordlift'); |
|
| 79 | 79 | |
| 80 | - $log->info( 'Activating WordLift...' ); |
|
| 80 | + $log->info('Activating WordLift...'); |
|
| 81 | 81 | |
| 82 | - require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-activator.php'; |
|
| 82 | + require_once plugin_dir_path(__FILE__).'includes/class-wordlift-activator.php'; |
|
| 83 | 83 | Wordlift_Activator::activate(); |
| 84 | 84 | |
| 85 | 85 | /** |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | function deactivate_wordlift() { |
| 108 | 108 | |
| 109 | - require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-deactivator.php'; |
|
| 109 | + require_once plugin_dir_path(__FILE__).'includes/class-wordlift-deactivator.php'; |
|
| 110 | 110 | Wordlift_Deactivator::deactivate(); |
| 111 | 111 | Wordlift_Http_Api::deactivate(); |
| 112 | 112 | Ttl_Cache_Cleaner::deactivate(); |
@@ -124,14 +124,14 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | -register_activation_hook( __FILE__, 'activate_wordlift' ); |
|
| 128 | -register_deactivation_hook( __FILE__, 'deactivate_wordlift' ); |
|
| 127 | +register_activation_hook(__FILE__, 'activate_wordlift'); |
|
| 128 | +register_deactivation_hook(__FILE__, 'deactivate_wordlift'); |
|
| 129 | 129 | |
| 130 | 130 | /** |
| 131 | 131 | * The core plugin class that is used to define internationalization, |
| 132 | 132 | * admin-specific hooks, and public-facing site hooks. |
| 133 | 133 | */ |
| 134 | -require plugin_dir_path( __FILE__ ) . 'includes/class-wordlift.php'; |
|
| 134 | +require plugin_dir_path(__FILE__).'includes/class-wordlift.php'; |
|
| 135 | 135 | |
| 136 | 136 | /** |
| 137 | 137 | * Begins execution of the plugin. |
@@ -151,12 +151,12 @@ discard block |
||
| 151 | 151 | * @return bool |
| 152 | 152 | * @since 3.27.6 |
| 153 | 153 | */ |
| 154 | - if ( apply_filters( 'wl_feature__enable__widgets', true ) ) { |
|
| 155 | - add_action( 'widgets_init', 'wl_register_chord_widget' ); |
|
| 156 | - add_action( 'widgets_init', 'wl_register_geo_widget' ); |
|
| 157 | - add_action( 'widgets_init', 'wl_register_timeline_widget' ); |
|
| 154 | + if (apply_filters('wl_feature__enable__widgets', true)) { |
|
| 155 | + add_action('widgets_init', 'wl_register_chord_widget'); |
|
| 156 | + add_action('widgets_init', 'wl_register_geo_widget'); |
|
| 157 | + add_action('widgets_init', 'wl_register_timeline_widget'); |
|
| 158 | 158 | } |
| 159 | - add_filter( 'widget_text', 'do_shortcode' ); |
|
| 159 | + add_filter('widget_text', 'do_shortcode'); |
|
| 160 | 160 | |
| 161 | 161 | /** |
| 162 | 162 | * Filter: wl_feature__enable__analysis |
@@ -166,10 +166,10 @@ discard block |
||
| 166 | 166 | * @return bool |
| 167 | 167 | * @since 3.27.6 |
| 168 | 168 | */ |
| 169 | - if ( apply_filters( 'wl_feature__enable__analysis', true ) ) { |
|
| 170 | - add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_action' ); |
|
| 169 | + if (apply_filters('wl_feature__enable__analysis', true)) { |
|
| 170 | + add_action('wp_ajax_wl_analyze', 'wl_ajax_analyze_action'); |
|
| 171 | 171 | } else { |
| 172 | - add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_disabled_action' ); |
|
| 172 | + add_action('wp_ajax_wl_analyze', 'wl_ajax_analyze_disabled_action'); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | $plugin = new Wordlift(); |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | add_action( |
| 188 | 188 | 'plugins_loaded', |
| 189 | - function () { |
|
| 189 | + function() { |
|
| 190 | 190 | // All features from registry should be initialized here. |
| 191 | 191 | $features_registry = Features_Registry::get_instance(); |
| 192 | 192 | $features_registry->initialize_all_features(); |
@@ -197,27 +197,27 @@ discard block |
||
| 197 | 197 | add_action( |
| 198 | 198 | 'plugins_loaded', |
| 199 | 199 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
| 200 | - function () use ( $plugin ) { |
|
| 200 | + function() use ($plugin) { |
|
| 201 | 201 | |
| 202 | 202 | new Wordlift_Products_Navigator_Shortcode_REST(); |
| 203 | 203 | |
| 204 | 204 | // Register the Dataset module, requires `$api_service`. |
| 205 | - require_once plugin_dir_path( __FILE__ ) . 'wordlift/dataset/index.php'; |
|
| 206 | - require_once plugin_dir_path( __FILE__ ) . 'wordlift/shipping-data/index.php'; |
|
| 205 | + require_once plugin_dir_path(__FILE__).'wordlift/dataset/index.php'; |
|
| 206 | + require_once plugin_dir_path(__FILE__).'wordlift/shipping-data/index.php'; |
|
| 207 | 207 | |
| 208 | 208 | /* |
| 209 | 209 | * Require the Entity annotation cleanup module. |
| 210 | 210 | * |
| 211 | 211 | * @since 3.34.6 |
| 212 | 212 | */ |
| 213 | - require_once plugin_dir_path( __FILE__ ) . 'wordlift/cleanup/index.php'; |
|
| 213 | + require_once plugin_dir_path(__FILE__).'wordlift/cleanup/index.php'; |
|
| 214 | 214 | |
| 215 | 215 | /* |
| 216 | 216 | * Import LOD entities. |
| 217 | 217 | * |
| 218 | 218 | * @since 3.35.0 |
| 219 | 219 | */ |
| 220 | - require_once plugin_dir_path( __FILE__ ) . 'wordlift/lod-import/index.php'; |
|
| 220 | + require_once plugin_dir_path(__FILE__).'wordlift/lod-import/index.php'; |
|
| 221 | 221 | |
| 222 | 222 | } |
| 223 | 223 | ); |
@@ -235,23 +235,23 @@ discard block |
||
| 235 | 235 | function wordlift_plugin_autoload_register() { |
| 236 | 236 | |
| 237 | 237 | spl_autoload_register( |
| 238 | - function ( $class_name ) { |
|
| 238 | + function($class_name) { |
|
| 239 | 239 | |
| 240 | 240 | // Bail out if these are not our classes. |
| 241 | - if ( 0 !== strpos( $class_name, 'Wordlift\\' ) ) { |
|
| 241 | + if (0 !== strpos($class_name, 'Wordlift\\')) { |
|
| 242 | 242 | return false; |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | - $class_name_lc = strtolower( str_replace( '_', '-', $class_name ) ); |
|
| 245 | + $class_name_lc = strtolower(str_replace('_', '-', $class_name)); |
|
| 246 | 246 | |
| 247 | - preg_match( '|^(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches ); |
|
| 247 | + preg_match('|^(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches); |
|
| 248 | 248 | |
| 249 | - $path = str_replace( '\\', DIRECTORY_SEPARATOR, $matches[1] ); |
|
| 250 | - $file = 'class-' . $matches[2] . '.php'; |
|
| 249 | + $path = str_replace('\\', DIRECTORY_SEPARATOR, $matches[1]); |
|
| 250 | + $file = 'class-'.$matches[2].'.php'; |
|
| 251 | 251 | |
| 252 | - $full_path = plugin_dir_path( __FILE__ ) . $path . DIRECTORY_SEPARATOR . $file; |
|
| 252 | + $full_path = plugin_dir_path(__FILE__).$path.DIRECTORY_SEPARATOR.$file; |
|
| 253 | 253 | |
| 254 | - if ( ! file_exists( $full_path ) ) { |
|
| 254 | + if ( ! file_exists($full_path)) { |
|
| 255 | 255 | return false; |
| 256 | 256 | } |
| 257 | 257 | |
@@ -263,13 +263,13 @@ discard block |
||
| 263 | 263 | |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | -function wl_block_categories( $categories ) { |
|
| 266 | +function wl_block_categories($categories) { |
|
| 267 | 267 | return array_merge( |
| 268 | 268 | $categories, |
| 269 | 269 | array( |
| 270 | 270 | array( |
| 271 | 271 | 'slug' => 'wordlift', |
| 272 | - 'title' => __( 'WordLift', 'wordlift' ), |
|
| 272 | + 'title' => __('WordLift', 'wordlift'), |
|
| 273 | 273 | ), |
| 274 | 274 | ) |
| 275 | 275 | ); |
@@ -279,22 +279,22 @@ discard block |
||
| 279 | 279 | * This function is created temporarily to handle the legacy library, |
| 280 | 280 | * this has to be removed when removing the legacy fields from the ui. |
| 281 | 281 | */ |
| 282 | -function wl_enqueue_leaflet( $in_footer = false ) { |
|
| 282 | +function wl_enqueue_leaflet($in_footer = false) { |
|
| 283 | 283 | // Leaflet. |
| 284 | - wp_enqueue_style( 'wl-leaflet', plugin_dir_url( __FILE__ ) . 'js/leaflet/leaflet.css', array(), '1.6.0' ); |
|
| 285 | - wp_enqueue_script( 'wl-leaflet', plugin_dir_url( __FILE__ ) . 'js/leaflet/leaflet.js', array(), '1.6.0', $in_footer ); |
|
| 284 | + wp_enqueue_style('wl-leaflet', plugin_dir_url(__FILE__).'js/leaflet/leaflet.css', array(), '1.6.0'); |
|
| 285 | + wp_enqueue_script('wl-leaflet', plugin_dir_url(__FILE__).'js/leaflet/leaflet.js', array(), '1.6.0', $in_footer); |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | -add_filter( 'block_categories', 'wl_block_categories', 10 ); |
|
| 288 | +add_filter('block_categories', 'wl_block_categories', 10); |
|
| 289 | 289 | |
| 290 | 290 | // Temporary fix for a typo in WooCommerce Extension. |
| 291 | 291 | add_filter( |
| 292 | 292 | 'wl_feature__enable__dataset', |
| 293 | - function ( $value ) { |
|
| 294 | - return apply_filters( 'wl_features__enable__dataset', $value ); |
|
| 293 | + function($value) { |
|
| 294 | + return apply_filters('wl_features__enable__dataset', $value); |
|
| 295 | 295 | } |
| 296 | 296 | ); |
| 297 | 297 | |
| 298 | -require_once __DIR__ . '/modules/food-kg/load.php'; |
|
| 299 | -require_once __DIR__ . '/modules/acf4so/load.php'; |
|
| 300 | -require_once __DIR__ . '/modules/pods/load.php'; |
|
| 298 | +require_once __DIR__.'/modules/food-kg/load.php'; |
|
| 299 | +require_once __DIR__.'/modules/acf4so/load.php'; |
|
| 300 | +require_once __DIR__.'/modules/pods/load.php'; |
|
@@ -14,89 +14,89 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class Settings { |
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * Register hooks. |
|
| 19 | - */ |
|
| 20 | - public function register_hooks() { |
|
| 21 | - if ( is_admin() ) { |
|
| 22 | - add_action( |
|
| 23 | - 'plugins_loaded', |
|
| 24 | - function () { |
|
| 25 | - add_action( 'admin_menu', array( $this, 'register_sub_menu' ) ); |
|
| 26 | - add_action( 'admin_init', array( $this, 'register_setting' ) ); |
|
| 27 | - } |
|
| 28 | - ); |
|
| 29 | - } |
|
| 30 | - } |
|
| 17 | + /** |
|
| 18 | + * Register hooks. |
|
| 19 | + */ |
|
| 20 | + public function register_hooks() { |
|
| 21 | + if ( is_admin() ) { |
|
| 22 | + add_action( |
|
| 23 | + 'plugins_loaded', |
|
| 24 | + function () { |
|
| 25 | + add_action( 'admin_menu', array( $this, 'register_sub_menu' ) ); |
|
| 26 | + add_action( 'admin_init', array( $this, 'register_setting' ) ); |
|
| 27 | + } |
|
| 28 | + ); |
|
| 29 | + } |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * Register submenu. |
|
| 34 | - */ |
|
| 35 | - public function register_sub_menu() { |
|
| 36 | - add_submenu_page( |
|
| 37 | - 'wl_admin_menu', |
|
| 38 | - __( 'Exclude Include URLs', 'wordlift' ), |
|
| 39 | - __( 'Exclude Include URLs', 'wordlift' ), |
|
| 40 | - 'manage_options', |
|
| 41 | - 'wl_exclude_include_urls_menu', |
|
| 42 | - array( $this, 'submenu_page_callback' ) |
|
| 43 | - ); |
|
| 44 | - } |
|
| 32 | + /** |
|
| 33 | + * Register submenu. |
|
| 34 | + */ |
|
| 35 | + public function register_sub_menu() { |
|
| 36 | + add_submenu_page( |
|
| 37 | + 'wl_admin_menu', |
|
| 38 | + __( 'Exclude Include URLs', 'wordlift' ), |
|
| 39 | + __( 'Exclude Include URLs', 'wordlift' ), |
|
| 40 | + 'manage_options', |
|
| 41 | + 'wl_exclude_include_urls_menu', |
|
| 42 | + array( $this, 'submenu_page_callback' ) |
|
| 43 | + ); |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * Register settings. |
|
| 48 | - */ |
|
| 49 | - public function register_setting() { |
|
| 50 | - register_setting( 'wl_exclude_include_urls_settings_group', 'wl_exclude_include_urls_settings' ); |
|
| 51 | - add_settings_section( |
|
| 52 | - 'wl_exclude_include_urls_settings_section_0', |
|
| 53 | - __( 'URL filter type, list of URLs', 'wordlift' ), |
|
| 54 | - array( $this, 'settings_section_callback' ), |
|
| 55 | - 'wl_exclude_include_urls_settings_page' |
|
| 56 | - ); |
|
| 46 | + /** |
|
| 47 | + * Register settings. |
|
| 48 | + */ |
|
| 49 | + public function register_setting() { |
|
| 50 | + register_setting( 'wl_exclude_include_urls_settings_group', 'wl_exclude_include_urls_settings' ); |
|
| 51 | + add_settings_section( |
|
| 52 | + 'wl_exclude_include_urls_settings_section_0', |
|
| 53 | + __( 'URL filter type, list of URLs', 'wordlift' ), |
|
| 54 | + array( $this, 'settings_section_callback' ), |
|
| 55 | + 'wl_exclude_include_urls_settings_page' |
|
| 56 | + ); |
|
| 57 | 57 | |
| 58 | - add_settings_field( |
|
| 59 | - 'wl_exclude_include_urls_field_0', |
|
| 60 | - __( 'URLs filter type', 'wordlift' ), |
|
| 61 | - array( $this, 'settings_field_0_render' ), |
|
| 62 | - 'wl_exclude_include_urls_settings_page', |
|
| 63 | - 'wl_exclude_include_urls_settings_section_0' |
|
| 64 | - ); |
|
| 58 | + add_settings_field( |
|
| 59 | + 'wl_exclude_include_urls_field_0', |
|
| 60 | + __( 'URLs filter type', 'wordlift' ), |
|
| 61 | + array( $this, 'settings_field_0_render' ), |
|
| 62 | + 'wl_exclude_include_urls_settings_page', |
|
| 63 | + 'wl_exclude_include_urls_settings_section_0' |
|
| 64 | + ); |
|
| 65 | 65 | |
| 66 | - add_settings_field( |
|
| 67 | - 'wl_exclude_include_urls_field_1', |
|
| 68 | - __( 'List of URLs', 'wordlift' ), |
|
| 69 | - array( $this, 'settings_field_1_render' ), |
|
| 70 | - 'wl_exclude_include_urls_settings_page', |
|
| 71 | - 'wl_exclude_include_urls_settings_section_0' |
|
| 72 | - ); |
|
| 73 | - } |
|
| 66 | + add_settings_field( |
|
| 67 | + 'wl_exclude_include_urls_field_1', |
|
| 68 | + __( 'List of URLs', 'wordlift' ), |
|
| 69 | + array( $this, 'settings_field_1_render' ), |
|
| 70 | + 'wl_exclude_include_urls_settings_page', |
|
| 71 | + 'wl_exclude_include_urls_settings_section_0' |
|
| 72 | + ); |
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | - public function settings_section_callback() { |
|
| 76 | - echo esc_html__( 'Select a URL filter type, and add list of URLs to selective active from WordLift\'s JSON-LD', 'wordlift' ); |
|
| 77 | - } |
|
| 75 | + public function settings_section_callback() { |
|
| 76 | + echo esc_html__( 'Select a URL filter type, and add list of URLs to selective active from WordLift\'s JSON-LD', 'wordlift' ); |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - /** |
|
| 80 | - * Callback function for settings field rendering. |
|
| 81 | - */ |
|
| 82 | - public function settings_field_0_render() { |
|
| 83 | - $options = get_option( 'wl_exclude_include_urls_settings' ); // phpcs:ignore |
|
| 84 | - include plugin_dir_path( __FILE__ ) . 'partials/field-0.php'; |
|
| 85 | - } |
|
| 79 | + /** |
|
| 80 | + * Callback function for settings field rendering. |
|
| 81 | + */ |
|
| 82 | + public function settings_field_0_render() { |
|
| 83 | + $options = get_option( 'wl_exclude_include_urls_settings' ); // phpcs:ignore |
|
| 84 | + include plugin_dir_path( __FILE__ ) . 'partials/field-0.php'; |
|
| 85 | + } |
|
| 86 | 86 | |
| 87 | - /** |
|
| 88 | - * Callback function for settings field rendering. |
|
| 89 | - */ |
|
| 90 | - public function settings_field_1_render() { |
|
| 91 | - $options = get_option( 'wl_exclude_include_urls_settings' ); // phpcs:ignore |
|
| 92 | - include plugin_dir_path( __FILE__ ) . 'partials/field-1.php'; |
|
| 93 | - } |
|
| 87 | + /** |
|
| 88 | + * Callback function for settings field rendering. |
|
| 89 | + */ |
|
| 90 | + public function settings_field_1_render() { |
|
| 91 | + $options = get_option( 'wl_exclude_include_urls_settings' ); // phpcs:ignore |
|
| 92 | + include plugin_dir_path( __FILE__ ) . 'partials/field-1.php'; |
|
| 93 | + } |
|
| 94 | 94 | |
| 95 | - /** |
|
| 96 | - * Callback function for Exclude Include URLs submenu page. |
|
| 97 | - */ |
|
| 98 | - public function submenu_page_callback() { |
|
| 99 | - include plugin_dir_path( __FILE__ ) . 'partials/exclude-include-urls-page.php'; |
|
| 100 | - } |
|
| 95 | + /** |
|
| 96 | + * Callback function for Exclude Include URLs submenu page. |
|
| 97 | + */ |
|
| 98 | + public function submenu_page_callback() { |
|
| 99 | + include plugin_dir_path( __FILE__ ) . 'partials/exclude-include-urls-page.php'; |
|
| 100 | + } |
|
| 101 | 101 | |
| 102 | 102 | } |
@@ -18,12 +18,12 @@ discard block |
||
| 18 | 18 | * Register hooks. |
| 19 | 19 | */ |
| 20 | 20 | public function register_hooks() { |
| 21 | - if ( is_admin() ) { |
|
| 21 | + if (is_admin()) { |
|
| 22 | 22 | add_action( |
| 23 | 23 | 'plugins_loaded', |
| 24 | - function () { |
|
| 25 | - add_action( 'admin_menu', array( $this, 'register_sub_menu' ) ); |
|
| 26 | - add_action( 'admin_init', array( $this, 'register_setting' ) ); |
|
| 24 | + function() { |
|
| 25 | + add_action('admin_menu', array($this, 'register_sub_menu')); |
|
| 26 | + add_action('admin_init', array($this, 'register_setting')); |
|
| 27 | 27 | } |
| 28 | 28 | ); |
| 29 | 29 | } |
@@ -35,11 +35,11 @@ discard block |
||
| 35 | 35 | public function register_sub_menu() { |
| 36 | 36 | add_submenu_page( |
| 37 | 37 | 'wl_admin_menu', |
| 38 | - __( 'Exclude Include URLs', 'wordlift' ), |
|
| 39 | - __( 'Exclude Include URLs', 'wordlift' ), |
|
| 38 | + __('Exclude Include URLs', 'wordlift'), |
|
| 39 | + __('Exclude Include URLs', 'wordlift'), |
|
| 40 | 40 | 'manage_options', |
| 41 | 41 | 'wl_exclude_include_urls_menu', |
| 42 | - array( $this, 'submenu_page_callback' ) |
|
| 42 | + array($this, 'submenu_page_callback') |
|
| 43 | 43 | ); |
| 44 | 44 | } |
| 45 | 45 | |
@@ -47,56 +47,56 @@ discard block |
||
| 47 | 47 | * Register settings. |
| 48 | 48 | */ |
| 49 | 49 | public function register_setting() { |
| 50 | - register_setting( 'wl_exclude_include_urls_settings_group', 'wl_exclude_include_urls_settings' ); |
|
| 50 | + register_setting('wl_exclude_include_urls_settings_group', 'wl_exclude_include_urls_settings'); |
|
| 51 | 51 | add_settings_section( |
| 52 | 52 | 'wl_exclude_include_urls_settings_section_0', |
| 53 | - __( 'URL filter type, list of URLs', 'wordlift' ), |
|
| 54 | - array( $this, 'settings_section_callback' ), |
|
| 53 | + __('URL filter type, list of URLs', 'wordlift'), |
|
| 54 | + array($this, 'settings_section_callback'), |
|
| 55 | 55 | 'wl_exclude_include_urls_settings_page' |
| 56 | 56 | ); |
| 57 | 57 | |
| 58 | 58 | add_settings_field( |
| 59 | 59 | 'wl_exclude_include_urls_field_0', |
| 60 | - __( 'URLs filter type', 'wordlift' ), |
|
| 61 | - array( $this, 'settings_field_0_render' ), |
|
| 60 | + __('URLs filter type', 'wordlift'), |
|
| 61 | + array($this, 'settings_field_0_render'), |
|
| 62 | 62 | 'wl_exclude_include_urls_settings_page', |
| 63 | 63 | 'wl_exclude_include_urls_settings_section_0' |
| 64 | 64 | ); |
| 65 | 65 | |
| 66 | 66 | add_settings_field( |
| 67 | 67 | 'wl_exclude_include_urls_field_1', |
| 68 | - __( 'List of URLs', 'wordlift' ), |
|
| 69 | - array( $this, 'settings_field_1_render' ), |
|
| 68 | + __('List of URLs', 'wordlift'), |
|
| 69 | + array($this, 'settings_field_1_render'), |
|
| 70 | 70 | 'wl_exclude_include_urls_settings_page', |
| 71 | 71 | 'wl_exclude_include_urls_settings_section_0' |
| 72 | 72 | ); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | public function settings_section_callback() { |
| 76 | - echo esc_html__( 'Select a URL filter type, and add list of URLs to selective active from WordLift\'s JSON-LD', 'wordlift' ); |
|
| 76 | + echo esc_html__('Select a URL filter type, and add list of URLs to selective active from WordLift\'s JSON-LD', 'wordlift'); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |
| 80 | 80 | * Callback function for settings field rendering. |
| 81 | 81 | */ |
| 82 | 82 | public function settings_field_0_render() { |
| 83 | - $options = get_option( 'wl_exclude_include_urls_settings' ); // phpcs:ignore |
|
| 84 | - include plugin_dir_path( __FILE__ ) . 'partials/field-0.php'; |
|
| 83 | + $options = get_option('wl_exclude_include_urls_settings'); // phpcs:ignore |
|
| 84 | + include plugin_dir_path(__FILE__).'partials/field-0.php'; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | 88 | * Callback function for settings field rendering. |
| 89 | 89 | */ |
| 90 | 90 | public function settings_field_1_render() { |
| 91 | - $options = get_option( 'wl_exclude_include_urls_settings' ); // phpcs:ignore |
|
| 92 | - include plugin_dir_path( __FILE__ ) . 'partials/field-1.php'; |
|
| 91 | + $options = get_option('wl_exclude_include_urls_settings'); // phpcs:ignore |
|
| 92 | + include plugin_dir_path(__FILE__).'partials/field-1.php'; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
| 96 | 96 | * Callback function for Exclude Include URLs submenu page. |
| 97 | 97 | */ |
| 98 | 98 | public function submenu_page_callback() { |
| 99 | - include plugin_dir_path( __FILE__ ) . 'partials/exclude-include-urls-page.php'; |
|
| 99 | + include plugin_dir_path(__FILE__).'partials/exclude-include-urls-page.php'; |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | } |
@@ -7,6 +7,6 @@ |
||
| 7 | 7 | exit(1); |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | -require_once __DIR__ . '/composer/autoload_real.php'; |
|
| 10 | +require_once __DIR__.'/composer/autoload_real.php'; |
|
| 11 | 11 | |
| 12 | 12 | return ComposerAutoloaderInitea9f09a268eac98657b6e4638a5b4856::getLoader(); |
@@ -6,5 +6,5 @@ |
||
| 6 | 6 | $baseDir = dirname($vendorDir); |
| 7 | 7 | |
| 8 | 8 | return array( |
| 9 | - 'Wordlift\\Modules\\Include_Exclude\\' => array($baseDir . '/includes'), |
|
| 9 | + 'Wordlift\\Modules\\Include_Exclude\\' => array($baseDir.'/includes'), |
|
| 10 | 10 | ); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | public function getPrefixes() |
| 115 | 115 | { |
| 116 | - if (!empty($this->prefixesPsr0)) { |
|
| 116 | + if ( ! empty($this->prefixesPsr0)) { |
|
| 117 | 117 | return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); |
| 118 | 118 | } |
| 119 | 119 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | */ |
| 184 | 184 | public function add($prefix, $paths, $prepend = false) |
| 185 | 185 | { |
| 186 | - if (!$prefix) { |
|
| 186 | + if ( ! $prefix) { |
|
| 187 | 187 | if ($prepend) { |
| 188 | 188 | $this->fallbackDirsPsr0 = array_merge( |
| 189 | 189 | (array) $paths, |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | $first = $prefix[0]; |
| 203 | - if (!isset($this->prefixesPsr0[$first][$prefix])) { |
|
| 203 | + if ( ! isset($this->prefixesPsr0[$first][$prefix])) { |
|
| 204 | 204 | $this->prefixesPsr0[$first][$prefix] = (array) $paths; |
| 205 | 205 | |
| 206 | 206 | return; |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | */ |
| 233 | 233 | public function addPsr4($prefix, $paths, $prepend = false) |
| 234 | 234 | { |
| 235 | - if (!$prefix) { |
|
| 235 | + if ( ! $prefix) { |
|
| 236 | 236 | // Register directories for the root namespace. |
| 237 | 237 | if ($prepend) { |
| 238 | 238 | $this->fallbackDirsPsr4 = array_merge( |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | (array) $paths |
| 246 | 246 | ); |
| 247 | 247 | } |
| 248 | - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { |
|
| 248 | + } elseif ( ! isset($this->prefixDirsPsr4[$prefix])) { |
|
| 249 | 249 | // Register directories for a new namespace. |
| 250 | 250 | $length = strlen($prefix); |
| 251 | 251 | if ('\\' !== $prefix[$length - 1]) { |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | */ |
| 280 | 280 | public function set($prefix, $paths) |
| 281 | 281 | { |
| 282 | - if (!$prefix) { |
|
| 282 | + if ( ! $prefix) { |
|
| 283 | 283 | $this->fallbackDirsPsr0 = (array) $paths; |
| 284 | 284 | } else { |
| 285 | 285 | $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | */ |
| 300 | 300 | public function setPsr4($prefix, $paths) |
| 301 | 301 | { |
| 302 | - if (!$prefix) { |
|
| 302 | + if ( ! $prefix) { |
|
| 303 | 303 | $this->fallbackDirsPsr4 = (array) $paths; |
| 304 | 304 | } else { |
| 305 | 305 | $length = strlen($prefix); |
@@ -493,18 +493,18 @@ discard block |
||
| 493 | 493 | private function findFileWithExtension($class, $ext) |
| 494 | 494 | { |
| 495 | 495 | // PSR-4 lookup |
| 496 | - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; |
|
| 496 | + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR).$ext; |
|
| 497 | 497 | |
| 498 | 498 | $first = $class[0]; |
| 499 | 499 | if (isset($this->prefixLengthsPsr4[$first])) { |
| 500 | 500 | $subPath = $class; |
| 501 | 501 | while (false !== $lastPos = strrpos($subPath, '\\')) { |
| 502 | 502 | $subPath = substr($subPath, 0, $lastPos); |
| 503 | - $search = $subPath . '\\'; |
|
| 503 | + $search = $subPath.'\\'; |
|
| 504 | 504 | if (isset($this->prefixDirsPsr4[$search])) { |
| 505 | - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); |
|
| 505 | + $pathEnd = DIRECTORY_SEPARATOR.substr($logicalPathPsr4, $lastPos + 1); |
|
| 506 | 506 | foreach ($this->prefixDirsPsr4[$search] as $dir) { |
| 507 | - if (file_exists($file = $dir . $pathEnd)) { |
|
| 507 | + if (file_exists($file = $dir.$pathEnd)) { |
|
| 508 | 508 | return $file; |
| 509 | 509 | } |
| 510 | 510 | } |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | |
| 515 | 515 | // PSR-4 fallback dirs |
| 516 | 516 | foreach ($this->fallbackDirsPsr4 as $dir) { |
| 517 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { |
|
| 517 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr4)) { |
|
| 518 | 518 | return $file; |
| 519 | 519 | } |
| 520 | 520 | } |
@@ -526,14 +526,14 @@ discard block |
||
| 526 | 526 | . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); |
| 527 | 527 | } else { |
| 528 | 528 | // PEAR-like class name |
| 529 | - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; |
|
| 529 | + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR).$ext; |
|
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | if (isset($this->prefixesPsr0[$first])) { |
| 533 | 533 | foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { |
| 534 | 534 | if (0 === strpos($class, $prefix)) { |
| 535 | 535 | foreach ($dirs as $dir) { |
| 536 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
| 536 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
| 537 | 537 | return $file; |
| 538 | 538 | } |
| 539 | 539 | } |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | |
| 544 | 544 | // PSR-0 fallback dirs |
| 545 | 545 | foreach ($this->fallbackDirsPsr0 as $dir) { |
| 546 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
| 546 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
| 547 | 547 | return $file; |
| 548 | 548 | } |
| 549 | 549 | } |
@@ -4,23 +4,23 @@ |
||
| 4 | 4 | |
| 5 | 5 | $issues = array(); |
| 6 | 6 | |
| 7 | -if (!(PHP_VERSION_ID >= 50600)) { |
|
| 8 | - $issues[] = 'Your Composer dependencies require a PHP version ">= 5.6.0". You are running ' . PHP_VERSION . '.'; |
|
| 7 | +if ( ! (PHP_VERSION_ID >= 50600)) { |
|
| 8 | + $issues[] = 'Your Composer dependencies require a PHP version ">= 5.6.0". You are running '.PHP_VERSION.'.'; |
|
| 9 | 9 | } |
| 10 | 10 | |
| 11 | 11 | if ($issues) { |
| 12 | - if (!headers_sent()) { |
|
| 12 | + if ( ! headers_sent()) { |
|
| 13 | 13 | header('HTTP/1.1 500 Internal Server Error'); |
| 14 | 14 | } |
| 15 | - if (!ini_get('display_errors')) { |
|
| 15 | + if ( ! ini_get('display_errors')) { |
|
| 16 | 16 | if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { |
| 17 | - fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); |
|
| 18 | - } elseif (!headers_sent()) { |
|
| 19 | - echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; |
|
| 17 | + fwrite(STDERR, 'Composer detected issues in your platform:'.PHP_EOL.PHP_EOL.implode(PHP_EOL, $issues).PHP_EOL.PHP_EOL); |
|
| 18 | + } elseif ( ! headers_sent()) { |
|
| 19 | + echo 'Composer detected issues in your platform:'.PHP_EOL.PHP_EOL.str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)).PHP_EOL.PHP_EOL; |
|
| 20 | 20 | } |
| 21 | 21 | } |
| 22 | 22 | trigger_error( |
| 23 | - 'Composer detected issues in your platform: ' . implode(' ', $issues), |
|
| 23 | + 'Composer detected issues in your platform: '.implode(' ', $issues), |
|
| 24 | 24 | E_USER_ERROR |
| 25 | 25 | ); |
| 26 | 26 | } |