@@ -5,32 +5,32 @@ discard block |
||
5 | 5 | |
6 | 6 | if ( isset( $_POST['wordlift_videoobject_settings_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['wordlift_videoobject_settings_nonce'] ) ), 'wordlift_videoobject_settings' ) ) { |
7 | 7 | |
8 | - if ( isset( $_POST['wordlift_videoobject_youtube_api_key'] ) || isset( $_POST['wordlift_videoobject_vimeo_api_key'] ) ) { |
|
8 | + if ( isset( $_POST['wordlift_videoobject_youtube_api_key'] ) || isset( $_POST['wordlift_videoobject_vimeo_api_key'] ) ) { |
|
9 | 9 | |
10 | - /** |
|
11 | - * @todo: does this fields need to be encrypted before saving ? |
|
12 | - */ |
|
13 | - $youtube_api_key = sanitize_text_field( wp_unslash( (string) $_POST['wordlift_videoobject_youtube_api_key'] ) ); |
|
14 | - $vimeo_api_key = sanitize_text_field( wp_unslash( (string) $_POST['wordlift_videoobject_vimeo_api_key'] ) ); |
|
10 | + /** |
|
11 | + * @todo: does this fields need to be encrypted before saving ? |
|
12 | + */ |
|
13 | + $youtube_api_key = sanitize_text_field( wp_unslash( (string) $_POST['wordlift_videoobject_youtube_api_key'] ) ); |
|
14 | + $vimeo_api_key = sanitize_text_field( wp_unslash( (string) $_POST['wordlift_videoobject_vimeo_api_key'] ) ); |
|
15 | 15 | |
16 | - if ( $youtube_api_key ) { |
|
17 | - update_option( Youtube_Client::get_api_key_option_name(), $youtube_api_key ); |
|
18 | - } |
|
16 | + if ( $youtube_api_key ) { |
|
17 | + update_option( Youtube_Client::get_api_key_option_name(), $youtube_api_key ); |
|
18 | + } |
|
19 | 19 | |
20 | - if ( $vimeo_api_key ) { |
|
21 | - update_option( Vimeo_Client::get_api_key_option_name(), $vimeo_api_key ); |
|
22 | - } |
|
23 | - } |
|
20 | + if ( $vimeo_api_key ) { |
|
21 | + update_option( Vimeo_Client::get_api_key_option_name(), $vimeo_api_key ); |
|
22 | + } |
|
23 | + } |
|
24 | 24 | |
25 | - if ( isset( $_POST['wl_enable_video_sitemap'] ) ) { |
|
26 | - update_option( '_wl_video_sitemap_generation', 1 ); |
|
27 | - // flush the rewrite rules. |
|
28 | - flush_rewrite_rules(); |
|
29 | - } else { |
|
30 | - update_option( '_wl_video_sitemap_generation', 0 ); |
|
31 | - // flush the rewrite rules. |
|
32 | - flush_rewrite_rules(); |
|
33 | - } |
|
25 | + if ( isset( $_POST['wl_enable_video_sitemap'] ) ) { |
|
26 | + update_option( '_wl_video_sitemap_generation', 1 ); |
|
27 | + // flush the rewrite rules. |
|
28 | + flush_rewrite_rules(); |
|
29 | + } else { |
|
30 | + update_option( '_wl_video_sitemap_generation', 0 ); |
|
31 | + // flush the rewrite rules. |
|
32 | + flush_rewrite_rules(); |
|
33 | + } |
|
34 | 34 | } |
35 | 35 | ?> |
36 | 36 | <h1><?php esc_html_e( 'API Settings', 'wordlift' ); ?></h1> |
@@ -43,16 +43,16 @@ discard block |
||
43 | 43 | </td> |
44 | 44 | <td> |
45 | 45 | <?php |
46 | - $element = new Wordlift_Admin_Input_Element(); |
|
47 | - $element->render( |
|
48 | - array( |
|
49 | - 'id' => 'wordlift_videoobject_youtube_api_key', |
|
50 | - 'name' => 'wordlift_videoobject_youtube_api_key', |
|
51 | - 'value' => Youtube_Client::get_api_key(), |
|
52 | - 'data' => array( 'type' => 'youtube' ), |
|
53 | - ) |
|
54 | - ); |
|
55 | - ?> |
|
46 | + $element = new Wordlift_Admin_Input_Element(); |
|
47 | + $element->render( |
|
48 | + array( |
|
49 | + 'id' => 'wordlift_videoobject_youtube_api_key', |
|
50 | + 'name' => 'wordlift_videoobject_youtube_api_key', |
|
51 | + 'value' => Youtube_Client::get_api_key(), |
|
52 | + 'data' => array( 'type' => 'youtube' ), |
|
53 | + ) |
|
54 | + ); |
|
55 | + ?> |
|
56 | 56 | </td> |
57 | 57 | <td> |
58 | 58 | <a href="https://developers.google.com/youtube/registering_an_application"><?php esc_html_e( 'Click here', 'wordlift' ); ?></a> |
@@ -66,16 +66,16 @@ discard block |
||
66 | 66 | </td> |
67 | 67 | <td> |
68 | 68 | <?php |
69 | - $element = new Wordlift_Admin_Input_Element(); |
|
70 | - $element->render( |
|
71 | - array( |
|
72 | - 'id' => 'wordlift_videoobject_vimeo_api_key', |
|
73 | - 'name' => 'wordlift_videoobject_vimeo_api_key', |
|
74 | - 'value' => Vimeo_Client::get_api_key(), |
|
75 | - 'data' => array( 'type' => 'vimeo' ), |
|
76 | - ) |
|
77 | - ); |
|
78 | - ?> |
|
69 | + $element = new Wordlift_Admin_Input_Element(); |
|
70 | + $element->render( |
|
71 | + array( |
|
72 | + 'id' => 'wordlift_videoobject_vimeo_api_key', |
|
73 | + 'name' => 'wordlift_videoobject_vimeo_api_key', |
|
74 | + 'value' => Vimeo_Client::get_api_key(), |
|
75 | + 'data' => array( 'type' => 'vimeo' ), |
|
76 | + ) |
|
77 | + ); |
|
78 | + ?> |
|
79 | 79 | </td> |
80 | 80 | <td> |
81 | 81 | <a href="https://developer.vimeo.com/api/guides/start"><?php esc_html_e( 'Click here', 'wordlift' ); ?></a> |
@@ -94,12 +94,12 @@ discard block |
||
94 | 94 | value="1" <?php echo esc_html( $wl_is_sitemap_enabled ); ?> ></p> |
95 | 95 | <p> |
96 | 96 | <?php |
97 | - if ( $wl_is_sitemap_enabled ) { |
|
98 | - $wl_sitemap_link = esc_attr( get_home_url( null, 'wl-video-sitemap.xml' ) ); |
|
99 | - /* translators: %s: The link to the Video Sitemap. */ |
|
100 | - echo wp_kses( sprintf( __( 'Here is <a href="%s">link</a> to your Video Sitemap. Add it now, to Google Search Console.', 'wordlift' ), $wl_sitemap_link ), array( 'a' => array( 'href' => array() ) ) ); |
|
101 | - } |
|
102 | - ?> |
|
97 | + if ( $wl_is_sitemap_enabled ) { |
|
98 | + $wl_sitemap_link = esc_attr( get_home_url( null, 'wl-video-sitemap.xml' ) ); |
|
99 | + /* translators: %s: The link to the Video Sitemap. */ |
|
100 | + echo wp_kses( sprintf( __( 'Here is <a href="%s">link</a> to your Video Sitemap. Add it now, to Google Search Console.', 'wordlift' ), $wl_sitemap_link ), array( 'a' => array( 'href' => array() ) ) ); |
|
101 | + } |
|
102 | + ?> |
|
103 | 103 | </p> |
104 | 104 | <?php wp_nonce_field( 'wordlift_videoobject_settings', 'wordlift_videoobject_settings_nonce', false ); ?> |
105 | 105 | <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" |
@@ -3,43 +3,43 @@ discard block |
||
3 | 3 | use Wordlift\Videoobject\Provider\Client\Vimeo_Client; |
4 | 4 | use Wordlift\Videoobject\Provider\Client\Youtube_Client; |
5 | 5 | |
6 | -if ( isset( $_POST['wordlift_videoobject_settings_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['wordlift_videoobject_settings_nonce'] ) ), 'wordlift_videoobject_settings' ) ) { |
|
6 | +if (isset($_POST['wordlift_videoobject_settings_nonce']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['wordlift_videoobject_settings_nonce'])), 'wordlift_videoobject_settings')) { |
|
7 | 7 | |
8 | - if ( isset( $_POST['wordlift_videoobject_youtube_api_key'] ) || isset( $_POST['wordlift_videoobject_vimeo_api_key'] ) ) { |
|
8 | + if (isset($_POST['wordlift_videoobject_youtube_api_key']) || isset($_POST['wordlift_videoobject_vimeo_api_key'])) { |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * @todo: does this fields need to be encrypted before saving ? |
12 | 12 | */ |
13 | - $youtube_api_key = sanitize_text_field( wp_unslash( (string) $_POST['wordlift_videoobject_youtube_api_key'] ) ); |
|
14 | - $vimeo_api_key = sanitize_text_field( wp_unslash( (string) $_POST['wordlift_videoobject_vimeo_api_key'] ) ); |
|
13 | + $youtube_api_key = sanitize_text_field(wp_unslash((string) $_POST['wordlift_videoobject_youtube_api_key'])); |
|
14 | + $vimeo_api_key = sanitize_text_field(wp_unslash((string) $_POST['wordlift_videoobject_vimeo_api_key'])); |
|
15 | 15 | |
16 | - if ( $youtube_api_key ) { |
|
17 | - update_option( Youtube_Client::get_api_key_option_name(), $youtube_api_key ); |
|
16 | + if ($youtube_api_key) { |
|
17 | + update_option(Youtube_Client::get_api_key_option_name(), $youtube_api_key); |
|
18 | 18 | } |
19 | 19 | |
20 | - if ( $vimeo_api_key ) { |
|
21 | - update_option( Vimeo_Client::get_api_key_option_name(), $vimeo_api_key ); |
|
20 | + if ($vimeo_api_key) { |
|
21 | + update_option(Vimeo_Client::get_api_key_option_name(), $vimeo_api_key); |
|
22 | 22 | } |
23 | 23 | } |
24 | 24 | |
25 | - if ( isset( $_POST['wl_enable_video_sitemap'] ) ) { |
|
26 | - update_option( '_wl_video_sitemap_generation', 1 ); |
|
25 | + if (isset($_POST['wl_enable_video_sitemap'])) { |
|
26 | + update_option('_wl_video_sitemap_generation', 1); |
|
27 | 27 | // flush the rewrite rules. |
28 | 28 | flush_rewrite_rules(); |
29 | 29 | } else { |
30 | - update_option( '_wl_video_sitemap_generation', 0 ); |
|
30 | + update_option('_wl_video_sitemap_generation', 0); |
|
31 | 31 | // flush the rewrite rules. |
32 | 32 | flush_rewrite_rules(); |
33 | 33 | } |
34 | 34 | } |
35 | 35 | ?> |
36 | -<h1><?php esc_html_e( 'API Settings', 'wordlift' ); ?></h1> |
|
37 | -<p><?php esc_html_e( 'To let WordLift access metadata from YouTube or Vimeo you will need to add here your API Key.', 'wordlift' ); ?></p> |
|
36 | +<h1><?php esc_html_e('API Settings', 'wordlift'); ?></h1> |
|
37 | +<p><?php esc_html_e('To let WordLift access metadata from YouTube or Vimeo you will need to add here your API Key.', 'wordlift'); ?></p> |
|
38 | 38 | <form method="post"> |
39 | 39 | <table id="wl-settings-page__video-api"> |
40 | 40 | <tr> |
41 | 41 | <td> |
42 | - <?php esc_html_e( 'YouTube API Key', 'wordlift' ); ?> |
|
42 | + <?php esc_html_e('YouTube API Key', 'wordlift'); ?> |
|
43 | 43 | </td> |
44 | 44 | <td> |
45 | 45 | <?php |
@@ -49,20 +49,20 @@ discard block |
||
49 | 49 | 'id' => 'wordlift_videoobject_youtube_api_key', |
50 | 50 | 'name' => 'wordlift_videoobject_youtube_api_key', |
51 | 51 | 'value' => Youtube_Client::get_api_key(), |
52 | - 'data' => array( 'type' => 'youtube' ), |
|
52 | + 'data' => array('type' => 'youtube'), |
|
53 | 53 | ) |
54 | 54 | ); |
55 | 55 | ?> |
56 | 56 | </td> |
57 | 57 | <td> |
58 | - <a href="https://developers.google.com/youtube/registering_an_application"><?php esc_html_e( 'Click here', 'wordlift' ); ?></a> |
|
59 | - <?php esc_html_e( ' for instructions on getting your YouTube API Key', 'wordlift' ); ?> |
|
58 | + <a href="https://developers.google.com/youtube/registering_an_application"><?php esc_html_e('Click here', 'wordlift'); ?></a> |
|
59 | + <?php esc_html_e(' for instructions on getting your YouTube API Key', 'wordlift'); ?> |
|
60 | 60 | </td> |
61 | 61 | </tr> |
62 | 62 | |
63 | 63 | <tr> |
64 | 64 | <td> |
65 | - <?php esc_html_e( 'Vimeo API Key', 'wordlift' ); ?> |
|
65 | + <?php esc_html_e('Vimeo API Key', 'wordlift'); ?> |
|
66 | 66 | </td> |
67 | 67 | <td> |
68 | 68 | <?php |
@@ -72,36 +72,36 @@ discard block |
||
72 | 72 | 'id' => 'wordlift_videoobject_vimeo_api_key', |
73 | 73 | 'name' => 'wordlift_videoobject_vimeo_api_key', |
74 | 74 | 'value' => Vimeo_Client::get_api_key(), |
75 | - 'data' => array( 'type' => 'vimeo' ), |
|
75 | + 'data' => array('type' => 'vimeo'), |
|
76 | 76 | ) |
77 | 77 | ); |
78 | 78 | ?> |
79 | 79 | </td> |
80 | 80 | <td> |
81 | - <a href="https://developer.vimeo.com/api/guides/start"><?php esc_html_e( 'Click here', 'wordlift' ); ?></a> |
|
82 | - <?php esc_html_e( ' for instructions on getting your Vimeo API Key', 'wordlift' ); ?> |
|
81 | + <a href="https://developer.vimeo.com/api/guides/start"><?php esc_html_e('Click here', 'wordlift'); ?></a> |
|
82 | + <?php esc_html_e(' for instructions on getting your Vimeo API Key', 'wordlift'); ?> |
|
83 | 83 | </td> |
84 | 84 | </tr> |
85 | 85 | |
86 | 86 | </table> |
87 | - <h1><?php esc_html_e( 'Video Sitemap', 'wordlift' ); ?></h1> |
|
87 | + <h1><?php esc_html_e('Video Sitemap', 'wordlift'); ?></h1> |
|
88 | 88 | <p> |
89 | - <?php esc_html_e( 'The Video Sitemap works like any other XML Sitemap. Search engines will use it to display rich snippets in result pages.', 'wordlift' ); ?> |
|
89 | + <?php esc_html_e('The Video Sitemap works like any other XML Sitemap. Search engines will use it to display rich snippets in result pages.', 'wordlift'); ?> |
|
90 | 90 | </p> |
91 | - <?php $wl_is_sitemap_enabled = esc_attr( get_option( '_wl_video_sitemap_generation', false ) ? 'checked' : '' ); ?> |
|
92 | - <p> <?php esc_html_e( 'Enable Video Sitemap', 'wordlift' ); ?> |
|
91 | + <?php $wl_is_sitemap_enabled = esc_attr(get_option('_wl_video_sitemap_generation', false) ? 'checked' : ''); ?> |
|
92 | + <p> <?php esc_html_e('Enable Video Sitemap', 'wordlift'); ?> |
|
93 | 93 | <input type="checkbox" name="wl_enable_video_sitemap" |
94 | - value="1" <?php echo esc_html( $wl_is_sitemap_enabled ); ?> ></p> |
|
94 | + value="1" <?php echo esc_html($wl_is_sitemap_enabled); ?> ></p> |
|
95 | 95 | <p> |
96 | 96 | <?php |
97 | - if ( $wl_is_sitemap_enabled ) { |
|
98 | - $wl_sitemap_link = esc_attr( get_home_url( null, 'wl-video-sitemap.xml' ) ); |
|
97 | + if ($wl_is_sitemap_enabled) { |
|
98 | + $wl_sitemap_link = esc_attr(get_home_url(null, 'wl-video-sitemap.xml')); |
|
99 | 99 | /* translators: %s: The link to the Video Sitemap. */ |
100 | - echo wp_kses( sprintf( __( 'Here is <a href="%s">link</a> to your Video Sitemap. Add it now, to Google Search Console.', 'wordlift' ), $wl_sitemap_link ), array( 'a' => array( 'href' => array() ) ) ); |
|
100 | + echo wp_kses(sprintf(__('Here is <a href="%s">link</a> to your Video Sitemap. Add it now, to Google Search Console.', 'wordlift'), $wl_sitemap_link), array('a' => array('href' => array()))); |
|
101 | 101 | } |
102 | 102 | ?> |
103 | 103 | </p> |
104 | - <?php wp_nonce_field( 'wordlift_videoobject_settings', 'wordlift_videoobject_settings_nonce', false ); ?> |
|
104 | + <?php wp_nonce_field('wordlift_videoobject_settings', 'wordlift_videoobject_settings_nonce', false); ?> |
|
105 | 105 | <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" |
106 | 106 | value="Save Changes"> |
107 | 107 | </p> |
@@ -9,18 +9,18 @@ |
||
9 | 9 | */ |
10 | 10 | class Wordlift_Install_3_40_2 extends Wordlift_Install { |
11 | 11 | |
12 | - /** |
|
13 | - * {@inheritdoc} |
|
14 | - */ |
|
15 | - protected static $version = '3.40.2'; |
|
12 | + /** |
|
13 | + * {@inheritdoc} |
|
14 | + */ |
|
15 | + protected static $version = '3.40.2'; |
|
16 | 16 | |
17 | - public function install() { |
|
18 | - if ( ! wp_next_scheduled( 'wl_daily_cron' ) ) { |
|
19 | - wp_schedule_event( time(), 'daily', 'wl_daily_cron' ); |
|
20 | - } |
|
17 | + public function install() { |
|
18 | + if ( ! wp_next_scheduled( 'wl_daily_cron' ) ) { |
|
19 | + wp_schedule_event( time(), 'daily', 'wl_daily_cron' ); |
|
20 | + } |
|
21 | 21 | |
22 | - do_action( 'update_option_wl_exclude_include_urls_settings' ); |
|
22 | + do_action( 'update_option_wl_exclude_include_urls_settings' ); |
|
23 | 23 | |
24 | - Ttl_Cache::flush_all(); |
|
25 | - } |
|
24 | + Ttl_Cache::flush_all(); |
|
25 | + } |
|
26 | 26 | } |
@@ -15,11 +15,11 @@ |
||
15 | 15 | protected static $version = '3.40.2'; |
16 | 16 | |
17 | 17 | public function install() { |
18 | - if ( ! wp_next_scheduled( 'wl_daily_cron' ) ) { |
|
19 | - wp_schedule_event( time(), 'daily', 'wl_daily_cron' ); |
|
18 | + if ( ! wp_next_scheduled('wl_daily_cron')) { |
|
19 | + wp_schedule_event(time(), 'daily', 'wl_daily_cron'); |
|
20 | 20 | } |
21 | 21 | |
22 | - do_action( 'update_option_wl_exclude_include_urls_settings' ); |
|
22 | + do_action('update_option_wl_exclude_include_urls_settings'); |
|
23 | 23 | |
24 | 24 | Ttl_Cache::flush_all(); |
25 | 25 | } |
@@ -6,77 +6,77 @@ discard block |
||
6 | 6 | |
7 | 7 | class Notices { |
8 | 8 | |
9 | - /** |
|
10 | - * @var Plugin |
|
11 | - */ |
|
12 | - private $acf4so_plugin; |
|
13 | - |
|
14 | - public function __construct( Plugin $plugin ) { |
|
15 | - $this->acf4so_plugin = $plugin; |
|
16 | - } |
|
17 | - |
|
18 | - public function register_hooks() { |
|
19 | - add_action( 'admin_notices', array( $this, 'admin_notices' ) ); |
|
20 | - } |
|
21 | - |
|
22 | - public function admin_notices() { |
|
23 | - |
|
24 | - $is_package_type_supported = $this->is_package_type_supported(); |
|
25 | - |
|
26 | - $is_woocommerce_plugin_installed = defined( 'WL_WOO_VERSION' ); |
|
27 | - |
|
28 | - if ( ! $is_package_type_supported && ! $is_woocommerce_plugin_installed ) { |
|
29 | - // Dont display notice. |
|
30 | - return; |
|
31 | - } |
|
32 | - |
|
33 | - /** |
|
34 | - * 1. When package type is supported and acf4so not installed or activated then the notice should appear. |
|
35 | - * 2. When woocommerce plugin installed and acf4so not installed or activated then the notice should appear. |
|
36 | - */ |
|
37 | - if ( ! $this->acf4so_plugin->is_plugin_installed() ) { |
|
38 | - $this->display_notice( |
|
39 | - __( "WordLift detected that <b>Advanced Custom Fields for Schema.org</b> is not installed and, you're losing out on full Schema.org support.", 'wordlift' ), |
|
40 | - __( 'Reinstall & Activate', 'wordlift' ) |
|
41 | - ); |
|
42 | - |
|
43 | - // Dont display notice. |
|
44 | - return; |
|
45 | - } |
|
46 | - |
|
47 | - if ( ! $this->acf4so_plugin->is_plugin_activated() ) { |
|
48 | - $this->display_notice( |
|
49 | - __( "WordLift detected that <b>Advanced Custom Fields for Schema.org</b> is deactivated and, you're losing out on full Schema.org support.", 'wordlift' ), |
|
50 | - __( 'Reactivate', 'wordlift' ) |
|
51 | - ); |
|
52 | - |
|
53 | - return; |
|
54 | - } |
|
55 | - |
|
56 | - } |
|
57 | - |
|
58 | - private function display_notice( $message, $button_text ) { |
|
59 | - |
|
60 | - $kses_options = array( |
|
61 | - 'p' => array(), |
|
62 | - 'b' => array(), |
|
63 | - 'button' => array( |
|
64 | - 'class' => array(), |
|
65 | - 'onclick' => array(), |
|
66 | - ), |
|
67 | - ); |
|
68 | - $installation_success_message = __( |
|
69 | - '</p>WordLift: <b>Advanced Custom Fields for Schema.org</b> plugin installed and activated.</p>', |
|
70 | - 'wordlift' |
|
71 | - ); |
|
72 | - |
|
73 | - $installing_message = __( 'Installing', 'wordlift' ) . ' <span class="spinner is-active"></span>'; |
|
74 | - $installation_failed_message = '<p>' . |
|
75 | - __( 'Wordlift: Advanced Custom Fields for Schema.org installation failed, please retry or contact [email protected]', 'wordlift' ) |
|
76 | - . '</p><button class="button action" onclick="wordliftInstallAcf4so(this)">' |
|
77 | - . __( 'Retry', 'wordlift' ) |
|
78 | - . '</button>'; |
|
79 | - ?> |
|
9 | + /** |
|
10 | + * @var Plugin |
|
11 | + */ |
|
12 | + private $acf4so_plugin; |
|
13 | + |
|
14 | + public function __construct( Plugin $plugin ) { |
|
15 | + $this->acf4so_plugin = $plugin; |
|
16 | + } |
|
17 | + |
|
18 | + public function register_hooks() { |
|
19 | + add_action( 'admin_notices', array( $this, 'admin_notices' ) ); |
|
20 | + } |
|
21 | + |
|
22 | + public function admin_notices() { |
|
23 | + |
|
24 | + $is_package_type_supported = $this->is_package_type_supported(); |
|
25 | + |
|
26 | + $is_woocommerce_plugin_installed = defined( 'WL_WOO_VERSION' ); |
|
27 | + |
|
28 | + if ( ! $is_package_type_supported && ! $is_woocommerce_plugin_installed ) { |
|
29 | + // Dont display notice. |
|
30 | + return; |
|
31 | + } |
|
32 | + |
|
33 | + /** |
|
34 | + * 1. When package type is supported and acf4so not installed or activated then the notice should appear. |
|
35 | + * 2. When woocommerce plugin installed and acf4so not installed or activated then the notice should appear. |
|
36 | + */ |
|
37 | + if ( ! $this->acf4so_plugin->is_plugin_installed() ) { |
|
38 | + $this->display_notice( |
|
39 | + __( "WordLift detected that <b>Advanced Custom Fields for Schema.org</b> is not installed and, you're losing out on full Schema.org support.", 'wordlift' ), |
|
40 | + __( 'Reinstall & Activate', 'wordlift' ) |
|
41 | + ); |
|
42 | + |
|
43 | + // Dont display notice. |
|
44 | + return; |
|
45 | + } |
|
46 | + |
|
47 | + if ( ! $this->acf4so_plugin->is_plugin_activated() ) { |
|
48 | + $this->display_notice( |
|
49 | + __( "WordLift detected that <b>Advanced Custom Fields for Schema.org</b> is deactivated and, you're losing out on full Schema.org support.", 'wordlift' ), |
|
50 | + __( 'Reactivate', 'wordlift' ) |
|
51 | + ); |
|
52 | + |
|
53 | + return; |
|
54 | + } |
|
55 | + |
|
56 | + } |
|
57 | + |
|
58 | + private function display_notice( $message, $button_text ) { |
|
59 | + |
|
60 | + $kses_options = array( |
|
61 | + 'p' => array(), |
|
62 | + 'b' => array(), |
|
63 | + 'button' => array( |
|
64 | + 'class' => array(), |
|
65 | + 'onclick' => array(), |
|
66 | + ), |
|
67 | + ); |
|
68 | + $installation_success_message = __( |
|
69 | + '</p>WordLift: <b>Advanced Custom Fields for Schema.org</b> plugin installed and activated.</p>', |
|
70 | + 'wordlift' |
|
71 | + ); |
|
72 | + |
|
73 | + $installing_message = __( 'Installing', 'wordlift' ) . ' <span class="spinner is-active"></span>'; |
|
74 | + $installation_failed_message = '<p>' . |
|
75 | + __( 'Wordlift: Advanced Custom Fields for Schema.org installation failed, please retry or contact [email protected]', 'wordlift' ) |
|
76 | + . '</p><button class="button action" onclick="wordliftInstallAcf4so(this)">' |
|
77 | + . __( 'Retry', 'wordlift' ) |
|
78 | + . '</button>'; |
|
79 | + ?> |
|
80 | 80 | |
81 | 81 | <script> |
82 | 82 | window.addEventListener("load", function () { |
@@ -111,16 +111,16 @@ discard block |
||
111 | 111 | <br/> |
112 | 112 | </div> |
113 | 113 | <?php |
114 | - } |
|
115 | - |
|
116 | - /** |
|
117 | - * @return bool |
|
118 | - */ |
|
119 | - private function is_package_type_supported() { |
|
120 | - // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
|
121 | - return apply_filters( 'wl_feature__enable__entity-types-professional', false ) || |
|
122 | - // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
|
123 | - apply_filters( 'wl_feature__enable__entity-types-business', false ); |
|
124 | - } |
|
114 | + } |
|
115 | + |
|
116 | + /** |
|
117 | + * @return bool |
|
118 | + */ |
|
119 | + private function is_package_type_supported() { |
|
120 | + // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
|
121 | + return apply_filters( 'wl_feature__enable__entity-types-professional', false ) || |
|
122 | + // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
|
123 | + apply_filters( 'wl_feature__enable__entity-types-business', false ); |
|
124 | + } |
|
125 | 125 | |
126 | 126 | } |
@@ -11,21 +11,21 @@ discard block |
||
11 | 11 | */ |
12 | 12 | private $acf4so_plugin; |
13 | 13 | |
14 | - public function __construct( Plugin $plugin ) { |
|
14 | + public function __construct(Plugin $plugin) { |
|
15 | 15 | $this->acf4so_plugin = $plugin; |
16 | 16 | } |
17 | 17 | |
18 | 18 | public function register_hooks() { |
19 | - add_action( 'admin_notices', array( $this, 'admin_notices' ) ); |
|
19 | + add_action('admin_notices', array($this, 'admin_notices')); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | public function admin_notices() { |
23 | 23 | |
24 | 24 | $is_package_type_supported = $this->is_package_type_supported(); |
25 | 25 | |
26 | - $is_woocommerce_plugin_installed = defined( 'WL_WOO_VERSION' ); |
|
26 | + $is_woocommerce_plugin_installed = defined('WL_WOO_VERSION'); |
|
27 | 27 | |
28 | - if ( ! $is_package_type_supported && ! $is_woocommerce_plugin_installed ) { |
|
28 | + if ( ! $is_package_type_supported && ! $is_woocommerce_plugin_installed) { |
|
29 | 29 | // Dont display notice. |
30 | 30 | return; |
31 | 31 | } |
@@ -34,20 +34,20 @@ discard block |
||
34 | 34 | * 1. When package type is supported and acf4so not installed or activated then the notice should appear. |
35 | 35 | * 2. When woocommerce plugin installed and acf4so not installed or activated then the notice should appear. |
36 | 36 | */ |
37 | - if ( ! $this->acf4so_plugin->is_plugin_installed() ) { |
|
37 | + if ( ! $this->acf4so_plugin->is_plugin_installed()) { |
|
38 | 38 | $this->display_notice( |
39 | - __( "WordLift detected that <b>Advanced Custom Fields for Schema.org</b> is not installed and, you're losing out on full Schema.org support.", 'wordlift' ), |
|
40 | - __( 'Reinstall & Activate', 'wordlift' ) |
|
39 | + __("WordLift detected that <b>Advanced Custom Fields for Schema.org</b> is not installed and, you're losing out on full Schema.org support.", 'wordlift'), |
|
40 | + __('Reinstall & Activate', 'wordlift') |
|
41 | 41 | ); |
42 | 42 | |
43 | 43 | // Dont display notice. |
44 | 44 | return; |
45 | 45 | } |
46 | 46 | |
47 | - if ( ! $this->acf4so_plugin->is_plugin_activated() ) { |
|
47 | + if ( ! $this->acf4so_plugin->is_plugin_activated()) { |
|
48 | 48 | $this->display_notice( |
49 | - __( "WordLift detected that <b>Advanced Custom Fields for Schema.org</b> is deactivated and, you're losing out on full Schema.org support.", 'wordlift' ), |
|
50 | - __( 'Reactivate', 'wordlift' ) |
|
49 | + __("WordLift detected that <b>Advanced Custom Fields for Schema.org</b> is deactivated and, you're losing out on full Schema.org support.", 'wordlift'), |
|
50 | + __('Reactivate', 'wordlift') |
|
51 | 51 | ); |
52 | 52 | |
53 | 53 | return; |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | |
56 | 56 | } |
57 | 57 | |
58 | - private function display_notice( $message, $button_text ) { |
|
58 | + private function display_notice($message, $button_text) { |
|
59 | 59 | |
60 | - $kses_options = array( |
|
60 | + $kses_options = array( |
|
61 | 61 | 'p' => array(), |
62 | 62 | 'b' => array(), |
63 | 63 | 'button' => array( |
@@ -70,11 +70,11 @@ discard block |
||
70 | 70 | 'wordlift' |
71 | 71 | ); |
72 | 72 | |
73 | - $installing_message = __( 'Installing', 'wordlift' ) . ' <span class="spinner is-active"></span>'; |
|
74 | - $installation_failed_message = '<p>' . |
|
75 | - __( 'Wordlift: Advanced Custom Fields for Schema.org installation failed, please retry or contact [email protected]', 'wordlift' ) |
|
73 | + $installing_message = __('Installing', 'wordlift').' <span class="spinner is-active"></span>'; |
|
74 | + $installation_failed_message = '<p>'. |
|
75 | + __('Wordlift: Advanced Custom Fields for Schema.org installation failed, please retry or contact [email protected]', 'wordlift') |
|
76 | 76 | . '</p><button class="button action" onclick="wordliftInstallAcf4so(this)">' |
77 | - . __( 'Retry', 'wordlift' ) |
|
77 | + . __('Retry', 'wordlift') |
|
78 | 78 | . '</button>'; |
79 | 79 | ?> |
80 | 80 | |
@@ -83,15 +83,15 @@ discard block |
||
83 | 83 | const pluginInstallationNotice = document.getElementById("wordlift_acf4so_plugin_installation_notice") |
84 | 84 | const installPlugin = (ajaxUrl) => fetch(`${ajaxUrl}?action=wl_install_and_activate_advanced-custom-fields-for-schema-org`) |
85 | 85 | .then(response => response.ok ? response.json() : Promise.reject()) |
86 | - const ajaxUrl = "<?php echo esc_html( wp_parse_url( admin_url( 'admin-ajax.php' ), PHP_URL_PATH ) ); ?>" |
|
86 | + const ajaxUrl = "<?php echo esc_html(wp_parse_url(admin_url('admin-ajax.php'), PHP_URL_PATH)); ?>" |
|
87 | 87 | window.wordliftInstallAcf4so = function (installBtn) { |
88 | - installBtn.innerHTML = `<?php echo wp_kses( $installing_message, array( 'span' => array( 'class' => array() ) ) ); ?>` |
|
88 | + installBtn.innerHTML = `<?php echo wp_kses($installing_message, array('span' => array('class' => array()))); ?>` |
|
89 | 89 | installPlugin(ajaxUrl) |
90 | 90 | .catch(e => { |
91 | - pluginInstallationNotice.innerHTML = `<?php echo wp_kses( $installation_failed_message, $kses_options ); ?>` |
|
91 | + pluginInstallationNotice.innerHTML = `<?php echo wp_kses($installation_failed_message, $kses_options); ?>` |
|
92 | 92 | }) |
93 | 93 | .then(() => { |
94 | - pluginInstallationNotice.innerHTML = `<?php echo wp_kses( $installation_success_message, $kses_options ); ?>` |
|
94 | + pluginInstallationNotice.innerHTML = `<?php echo wp_kses($installation_success_message, $kses_options); ?>` |
|
95 | 95 | pluginInstallationNotice.classList.remove('notice-error') |
96 | 96 | pluginInstallationNotice.classList.add('notice-success') |
97 | 97 | }) |
@@ -103,9 +103,9 @@ discard block |
||
103 | 103 | |
104 | 104 | <div class="notice notice-error" id="wordlift_acf4so_plugin_installation_notice"> |
105 | 105 | <p> |
106 | - <?php echo wp_kses( $message, array( 'b' => array() ) ); ?> |
|
106 | + <?php echo wp_kses($message, array('b' => array())); ?> |
|
107 | 107 | <button class="button action right" onclick="wordliftInstallAcf4so(this)"> |
108 | - <?php echo esc_html( $button_text ); ?> |
|
108 | + <?php echo esc_html($button_text); ?> |
|
109 | 109 | </button> |
110 | 110 | </p> |
111 | 111 | <br/> |
@@ -118,9 +118,9 @@ discard block |
||
118 | 118 | */ |
119 | 119 | private function is_package_type_supported() { |
120 | 120 | // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
121 | - return apply_filters( 'wl_feature__enable__entity-types-professional', false ) || |
|
121 | + return apply_filters('wl_feature__enable__entity-types-professional', false) || |
|
122 | 122 | // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
123 | - apply_filters( 'wl_feature__enable__entity-types-business', false ); |
|
123 | + apply_filters('wl_feature__enable__entity-types-business', false); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | } |
@@ -14,101 +14,101 @@ |
||
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__( "Choose a 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__( "Choose a 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 | - // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
|
84 | - $options = get_option( |
|
85 | - 'wl_exclude_include_urls_settings', |
|
86 | - array( |
|
87 | - 'include_exclude' => 'exclude', |
|
88 | - 'urls' => '', |
|
89 | - ) ); // phpcs:ignore |
|
90 | - include_once plugin_dir_path( __FILE__ ) . 'partials/field-0.php'; |
|
91 | - } |
|
79 | + /** |
|
80 | + * Callback function for settings field rendering. |
|
81 | + */ |
|
82 | + public function settings_field_0_render() { |
|
83 | + // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
|
84 | + $options = get_option( |
|
85 | + 'wl_exclude_include_urls_settings', |
|
86 | + array( |
|
87 | + 'include_exclude' => 'exclude', |
|
88 | + 'urls' => '', |
|
89 | + ) ); // phpcs:ignore |
|
90 | + include_once plugin_dir_path( __FILE__ ) . 'partials/field-0.php'; |
|
91 | + } |
|
92 | 92 | |
93 | - /** |
|
94 | - * Callback function for settings field rendering. |
|
95 | - */ |
|
96 | - public function settings_field_1_render() { |
|
97 | - // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
|
98 | - $options = get_option( |
|
99 | - 'wl_exclude_include_urls_settings', |
|
100 | - array( |
|
101 | - 'include_exclude' => true, |
|
102 | - 'urls' => '', |
|
103 | - ) ); // phpcs:ignore |
|
104 | - include_once plugin_dir_path( __FILE__ ) . 'partials/field-1.php'; |
|
105 | - } |
|
93 | + /** |
|
94 | + * Callback function for settings field rendering. |
|
95 | + */ |
|
96 | + public function settings_field_1_render() { |
|
97 | + // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
|
98 | + $options = get_option( |
|
99 | + 'wl_exclude_include_urls_settings', |
|
100 | + array( |
|
101 | + 'include_exclude' => true, |
|
102 | + 'urls' => '', |
|
103 | + ) ); // phpcs:ignore |
|
104 | + include_once plugin_dir_path( __FILE__ ) . 'partials/field-1.php'; |
|
105 | + } |
|
106 | 106 | |
107 | - /** |
|
108 | - * Callback function for Exclude Include URLs submenu page. |
|
109 | - */ |
|
110 | - public function submenu_page_callback() { |
|
111 | - include_once plugin_dir_path( __FILE__ ) . 'partials/exclude-include-urls-page.php'; |
|
112 | - } |
|
107 | + /** |
|
108 | + * Callback function for Exclude Include URLs submenu page. |
|
109 | + */ |
|
110 | + public function submenu_page_callback() { |
|
111 | + include_once plugin_dir_path( __FILE__ ) . 'partials/exclude-include-urls-page.php'; |
|
112 | + } |
|
113 | 113 | |
114 | 114 | } |
@@ -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,33 +47,33 @@ 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__( "Choose a filter type, and add list of URLs to selective active from WordLift's JSON-LD", 'wordlift' ); |
|
76 | + echo esc_html__("Choose a filter type, and add list of URLs to selective active from WordLift's JSON-LD", 'wordlift'); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | 'include_exclude' => 'exclude', |
88 | 88 | 'urls' => '', |
89 | 89 | ) ); // phpcs:ignore |
90 | - include_once plugin_dir_path( __FILE__ ) . 'partials/field-0.php'; |
|
90 | + include_once plugin_dir_path(__FILE__).'partials/field-0.php'; |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -101,14 +101,14 @@ discard block |
||
101 | 101 | 'include_exclude' => true, |
102 | 102 | 'urls' => '', |
103 | 103 | ) ); // phpcs:ignore |
104 | - include_once plugin_dir_path( __FILE__ ) . 'partials/field-1.php'; |
|
104 | + include_once plugin_dir_path(__FILE__).'partials/field-1.php'; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
108 | 108 | * Callback function for Exclude Include URLs submenu page. |
109 | 109 | */ |
110 | 110 | public function submenu_page_callback() { |
111 | - include_once plugin_dir_path( __FILE__ ) . 'partials/exclude-include-urls-page.php'; |
|
111 | + include_once plugin_dir_path(__FILE__).'partials/exclude-include-urls-page.php'; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | } |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <p> |
2 | 2 | <input type="radio" id="wl_exclude_include_urls_settings_include_exclude_include" |
3 | 3 | name="wl_exclude_include_urls_settings[include_exclude]" |
4 | - value="exclude" <?php checked( is_array( $options ) ? $options['include_exclude'] : '', 'exclude' ); // phpcs:ignore ?>> |
|
5 | - <label for="wl_exclude_include_urls_settings_include_exclude_include"><?php echo esc_html__( 'Exclude', 'wordlift' ); ?></label> |
|
4 | + value="exclude" <?php checked(is_array($options) ? $options['include_exclude'] : '', 'exclude'); // phpcs:ignore ?>> |
|
5 | + <label for="wl_exclude_include_urls_settings_include_exclude_include"><?php echo esc_html__('Exclude', 'wordlift'); ?></label> |
|
6 | 6 | </p> |
7 | 7 | <p> |
8 | 8 | <input type="radio" id="wl_exclude_include_urls_settings_include_exclude_exclude" |
9 | 9 | name="wl_exclude_include_urls_settings[include_exclude]" |
10 | - value="include" <?php checked( is_array( $options ) ? $options['include_exclude'] : '', 'include' ); // phpcs:ignore ?>> |
|
11 | - <label for="wl_exclude_include_urls_settings_include_exclude_exclude"><?php echo esc_html__( 'Include', 'wordlift' ); ?></label> |
|
10 | + value="include" <?php checked(is_array($options) ? $options['include_exclude'] : '', 'include'); // phpcs:ignore ?>> |
|
11 | + <label for="wl_exclude_include_urls_settings_include_exclude_exclude"><?php echo esc_html__('Include', 'wordlift'); ?></label> |
|
12 | 12 | </p> |
@@ -6,6 +6,6 @@ |
||
6 | 6 | $baseDir = dirname($vendorDir); |
7 | 7 | |
8 | 8 | return array( |
9 | - 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', |
|
10 | - 'Wordlift\\Modules\\Include_Exclude_Push_Config\\Include_Exclude_API' => $baseDir . '/Include_Exclude_API.php', |
|
9 | + 'Composer\\InstalledVersions' => $vendorDir.'/composer/InstalledVersions.php', |
|
10 | + 'Wordlift\\Modules\\Include_Exclude_Push_Config\\Include_Exclude_API' => $baseDir.'/Include_Exclude_API.php', |
|
11 | 11 | ); |
@@ -6,14 +6,14 @@ |
||
6 | 6 | |
7 | 7 | class ComposerStaticInit3d5ab0830c7bf52ba5addfd65f37fd54 |
8 | 8 | { |
9 | - public static $classMap = array ( |
|
10 | - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', |
|
11 | - 'Wordlift\\Modules\\Include_Exclude_Push_Config\\Include_Exclude_API' => __DIR__ . '/../..' . '/Include_Exclude_API.php', |
|
9 | + public static $classMap = array( |
|
10 | + 'Composer\\InstalledVersions' => __DIR__.'/..'.'/composer/InstalledVersions.php', |
|
11 | + 'Wordlift\\Modules\\Include_Exclude_Push_Config\\Include_Exclude_API' => __DIR__.'/../..'.'/Include_Exclude_API.php', |
|
12 | 12 | ); |
13 | 13 | |
14 | 14 | public static function getInitializer(ClassLoader $loader) |
15 | 15 | { |
16 | - return \Closure::bind(function () use ($loader) { |
|
16 | + return \Closure::bind(function() use ($loader) { |
|
17 | 17 | $loader->classMap = ComposerStaticInit3d5ab0830c7bf52ba5addfd65f37fd54::$classMap; |
18 | 18 | |
19 | 19 | }, null, ClassLoader::class); |
@@ -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 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | public static function loadClassLoader($class) |
10 | 10 | { |
11 | 11 | if ('Wordlift_Modules_Include_Exclude_Push_Config_Composer\Autoload\ClassLoader' === $class) { |
12 | - require __DIR__ . '/ClassLoader.php'; |
|
12 | + require __DIR__.'/ClassLoader.php'; |
|
13 | 13 | } |
14 | 14 | } |
15 | 15 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | self::$loader = $loader = new \Wordlift_Modules_Include_Exclude_Push_Config_Composer\Autoload\ClassLoader(\dirname(__DIR__)); |
27 | 27 | spl_autoload_unregister(array('ComposerAutoloaderInit3d5ab0830c7bf52ba5addfd65f37fd54', 'loadClassLoader')); |
28 | 28 | |
29 | - require __DIR__ . '/autoload_static.php'; |
|
29 | + require __DIR__.'/autoload_static.php'; |
|
30 | 30 | call_user_func(\Wordlift_Modules_Include_Exclude_Push_Config_Composer\Autoload\ComposerStaticInit3d5ab0830c7bf52ba5addfd65f37fd54::getInitializer($loader)); |
31 | 31 | |
32 | 32 | $loader->setClassMapAuthoritative(true); |