Skip to content

Commit d02c033

Browse files
committed
disable avatar store by default and fix check
1 parent 8955efd commit d02c033

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

includes/class-admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ public static function register_settings() {
424424
'type' => 'int',
425425
'description' => esc_html__( 'Store Avatars Locally', 'webmention' ),
426426
'show_in_rest' => true,
427-
'default' => 1,
427+
'default' => 0,
428428
)
429429
);
430430
register_setting(

templates/webmention-settings.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@
1414
<td>
1515
<fieldset>
1616
<label for="webmention_disable_selfpings_same_url">
17-
<input type="checkbox" name="webmention_disable_selfpings_same_url" id="webmention_disable_selfpings_same_url" value="1" <?php echo checked( true, get_option( 'webmention_disable_selfpings_same_url' ) ); ?> />
17+
<input type="checkbox" name="webmention_disable_selfpings_same_url" id="webmention_disable_selfpings_same_url" value="1" <?php checked( true, get_option( 'webmention_disable_selfpings_same_url' ) ); ?> />
1818
<?php esc_html_e( 'Disable self-pings on the same URL', 'webmention' ); ?>
1919
<p class="description"><?php esc_html_e( '(for example "http://example.com/?p=123")', 'webmention' ); ?></p>
2020
</label>
2121

2222
<br />
2323

2424
<label for="webmention_disable_selfpings_same_domain">
25-
<input type="checkbox" name="webmention_disable_selfpings_same_domain" id="webmention_disable_selfpings_same_domain" value="1" <?php echo checked( true, get_option( 'webmention_disable_selfpings_same_domain' ) ); ?> />
25+
<input type="checkbox" name="webmention_disable_selfpings_same_domain" id="webmention_disable_selfpings_same_domain" value="1" <?php checked( true, get_option( 'webmention_disable_selfpings_same_domain' ) ); ?> />
2626
<?php esc_html_e( 'Disable self-pings on the same Domain', 'webmention' ); ?>
2727
<p class="description"><?php esc_html_e( '(for example "example.com")', 'webmention' ); ?></p>
2828
</label>
2929

3030
<br />
3131

3232
<label for="webmention_disable_media_mentions">
33-
<input type="checkbox" name="webmention_disable_media_mentions" id="webmention_disable_media_mentions" value="1" <?php echo checked( true, get_option( 'webmention_disable_media_mentions' ) ); ?> />
33+
<input type="checkbox" name="webmention_disable_media_mentions" id="webmention_disable_media_mentions" value="1" <?php checked( true, get_option( 'webmention_disable_media_mentions' ) ); ?> />
3434
<?php esc_html_e( 'Disable sending Webmentions for media links (image, video, audio)', 'webmention' ); ?>
3535
</label>
3636
</fieldset>
@@ -57,7 +57,7 @@
5757
<?php foreach ( $post_types as $post_type ) { ?>
5858
<li>
5959
<label for="webmention_support_post_types_<?php echo esc_attr( $post_type->name ); ?>">
60-
<input type="checkbox" id="webmention_support_post_types_<?php echo esc_attr( $post_type->name ); ?>" name="webmention_support_post_types[]" value="<?php echo esc_attr( $post_type->name ); ?>" <?php echo checked( true, in_array( $post_type->name, $support_post_types, true ) ); ?> />
60+
<input type="checkbox" id="webmention_support_post_types_<?php echo esc_attr( $post_type->name ); ?>" name="webmention_support_post_types[]" value="<?php echo esc_attr( $post_type->name ); ?>" <?php checked( true, in_array( $post_type->name, $support_post_types, true ) ); ?> />
6161
<?php echo esc_html( $post_type->label ); ?>
6262
</label>
6363
</li>
@@ -110,7 +110,7 @@
110110
<fieldset>
111111
<p>
112112
<label for="webmention_show_comment_form">
113-
<input type="checkbox" name="webmention_show_comment_form" id="webmention_show_comment_form" value="1" <?php echo checked( true, get_option( 'webmention_show_comment_form' ) ); ?> />
113+
<input type="checkbox" name="webmention_show_comment_form" id="webmention_show_comment_form" value="1" <?php checked( true, get_option( 'webmention_show_comment_form' ) ); ?> />
114114
<?php esc_html_e( 'Show a Webmention form at the comment section, to allow anyone to notify you of a mention.', 'webmention' ); ?>
115115
</label>
116116
</p>
@@ -131,7 +131,7 @@
131131
<td>
132132
<fieldset>
133133
<label for="webmention_avatars">
134-
<input type="checkbox" name="webmention_avatars" id="webmention_avatars" value="1" <?php echo checked( true, get_option( 'webmention_avatars', 1 ) ); ?> />
134+
<input type="checkbox" name="webmention_avatars" id="webmention_avatars" value="1" <?php checked( true, get_option( 'webmention_avatars', 1 ) ); ?> />
135135
<?php esc_html_e( 'Show avatars on Webmentions if available.', 'webmention' ); ?>
136136
</label>
137137
</fieldset>
@@ -142,7 +142,7 @@
142142
<td>
143143
<fieldset>
144144
<label for="webmention_avatar_store_enable">
145-
<input type="checkbox" name="webmention_avatar_store_enable" id="webmention_avatar_store_enable" value="1" <?php checked( true, get_option( 'webmention_avatar_store_enable', 1 ) ); ?> />
145+
<input type="checkbox" name="webmention_avatar_store_enable" id="webmention_avatar_store_enable" value="1" <?php checked( true, get_option( 'webmention_avatar_store_enable', 0 ) ); ?> />
146146
<?php esc_html_e( 'Enable Local Caching of Avatars.', 'webmention' ); ?>
147147
</label>
148148
</fieldset>
@@ -154,7 +154,7 @@
154154

155155
<fieldset>
156156
<label for="webmention_separate_comment">
157-
<input type="checkbox" name="webmention_separate_comment" id="webmention_separate_comment" value="1" <?php echo checked( true, get_option( 'webmention_separate_comment', 1 ) ); ?> />
157+
<input type="checkbox" name="webmention_separate_comment" id="webmention_separate_comment" value="1" <?php checked( true, get_option( 'webmention_separate_comment', 1 ) ); ?> />
158158
<?php esc_html_e( 'Separate Webmention Types from Comments.', 'webmention' ); ?>
159159
</label>
160160
</fieldset>

webmention.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
defined( 'WEBMENTION_COMMENT_TYPE' ) || define( 'WEBMENTION_COMMENT_TYPE', 'webmention' );
2424
defined( 'WEBMENTION_GRAVATAR_CACHE_TIME' ) || define( 'WEBMENTION_GRAVATAR_CACHE_TIME', WEEK_IN_SECONDS );
2525

26-
27-
defined( 'WEBMENTION_LOCAL_AVATAR_STORE' ) || define( 'WEBMENTION_LOCAL_AVATAR_STORE', true );
2826
defined( 'WEBMENTION_AVATAR_QUALITY' ) || define( 'WEBMENTION_AVATAR_QUALITY', null );
2927
defined( 'WEBMENTION_AVATAR_SIZE' ) || define( 'WEBMENTION_AVATAR_SIZE', 256 );
3028

@@ -121,7 +119,7 @@ function init() {
121119
add_action( 'init', array( '\Webmention\Discovery', 'init' ) );
122120

123121
// load local avatar store.
124-
if ( 1 === (int) get_option( 'webmention_disable_media_mentions', 1 ) ) {
122+
if ( 1 === (int) get_option( 'webmention_avatar_store_enable', 0 ) ) {
125123
require_once __DIR__ . '/includes/class-avatar-store.php';
126124
add_action( 'init', array( '\Webmention\Avatar_Store', 'init' ) );
127125
}

0 commit comments

Comments
 (0)