first commit
This commit is contained in:
30
admin/partials/network/section.php
Normal file
30
admin/partials/network/section.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of Avatar Privacy.
|
||||
*
|
||||
* Copyright 2018 Peter Putzer.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***
|
||||
*
|
||||
* @package mundschenk-at/avatar-privacy
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
if ( ! empty( $description ) ) : ?>
|
||||
<p><?php echo \esc_html( $description ); ?></p>
|
||||
<?php endif; ?>
|
||||
<?php
|
42
admin/partials/network/settings-page.php
Normal file
42
admin/partials/network/settings-page.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of Avatar Privacy.
|
||||
*
|
||||
* Copyright 2018-2019 Peter Putzer.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***
|
||||
*
|
||||
* @package mundschenk-at/avatar-privacy
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
use Avatar_Privacy\Components\Network_Settings_Page;
|
||||
|
||||
?><div class='wrap'>
|
||||
<h1><?php \esc_html_e( 'Avatar Privacy Network Settings', 'avatar-privacy' ); ?></h1>
|
||||
|
||||
<form method="post" action="<?php echo \esc_url( 'edit.php?action=' . Network_Settings_Page::ACTION ); ?>">
|
||||
<?php \settings_fields( Network_Settings_Page::OPTION_GROUP ); ?>
|
||||
<?php \do_settings_sections( Network_Settings_Page::OPTION_GROUP ); ?>
|
||||
|
||||
<p class="submit">
|
||||
<?php \submit_button( \__( 'Save Changes', 'avatar-privacy' ), 'primary', 'save_changes', false, [ 'tabindex' => 1 ] ); ?>
|
||||
</p><!-- .submit -->
|
||||
</form>
|
||||
|
||||
</div><!-- .wrap -->
|
||||
<?php
|
53
admin/partials/profile/allow-anonymous.php
Normal file
53
admin/partials/profile/allow-anonymous.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of Avatar Privacy.
|
||||
*
|
||||
* Copyright 2018-2019 Peter Putzer.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***
|
||||
*
|
||||
* @package mundschenk-at/avatar-privacy
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
/**
|
||||
* Required template variables:
|
||||
*
|
||||
* @var string $nonce The nonce itself.
|
||||
* @var string $action The nonce action.
|
||||
* @var string $field_name The name of the checkbox `<input>` element.
|
||||
* @var string $value The checkbox value.
|
||||
*/
|
||||
?>
|
||||
<tr class="avatar-privacy-allow-anonymous">
|
||||
<th scope="row"><?php \esc_html_e( 'Logged-out Commenting', 'avatar-privacy' ); ?></th>
|
||||
<td>
|
||||
<?php \wp_nonce_field( $action, $nonce ); ?>
|
||||
<input
|
||||
id="<?php echo \esc_attr( $field_name ); ?>"
|
||||
name="<?php echo \esc_attr( $field_name ); ?>"
|
||||
type="checkbox"
|
||||
value="true"
|
||||
<?php \checked( $value ); ?>
|
||||
/>
|
||||
<label for="<?php echo \esc_attr( $field_name ); ?>"><?php \esc_html_e( 'Allow logged-out comments with my profile picture.', 'avatar-privacy' ); ?></label><br />
|
||||
<p class="description">
|
||||
<?php \esc_html_e( 'Check this box if you want to be able to use your profile picture while logged-out.', 'avatar-privacy' ); ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
58
admin/partials/profile/use-gravatar.php
Normal file
58
admin/partials/profile/use-gravatar.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of Avatar Privacy.
|
||||
*
|
||||
* Copyright 2018-2021 Peter Putzer.
|
||||
* Copyright 2012-2013 Johannes Freudendahl.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***
|
||||
*
|
||||
* @package mundschenk-at/avatar-privacy
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
use Avatar_Privacy\Tools\Template as T;
|
||||
|
||||
/**
|
||||
* Required template variables:
|
||||
*
|
||||
* @var T $template The templating helper.
|
||||
* @var string $nonce The nonce itself.
|
||||
* @var string $action The nonce action.
|
||||
* @var string $field_name The name of the checkbox `<input>` element.
|
||||
* @var string $value The checkbox value.
|
||||
*/
|
||||
?>
|
||||
<tr class="avatar-privacy-use-gravatar">
|
||||
<th scope="row"><?php \esc_html_e( 'Gravatars', 'avatar-privacy' ); ?></th>
|
||||
<td>
|
||||
<?php \wp_nonce_field( $action, $nonce ); ?>
|
||||
<input
|
||||
id="<?php echo \esc_attr( $field_name ); ?>"
|
||||
name="<?php echo \esc_attr( $field_name ); ?>"
|
||||
type="checkbox"
|
||||
value="true"
|
||||
<?php \checked( $value ); ?>
|
||||
/>
|
||||
<label for="<?php echo \esc_attr( $field_name ); ?>"><?php echo \wp_kses( $template->get_use_gravatar_label( 'user' ), T::ALLOWED_HTML_LABEL ); ?></label><br />
|
||||
<p class="description">
|
||||
<?php \esc_html_e( "Uncheck this box if you don't want to display the gravatar for your e-mail address (or don't have an account on Gravatar.com).", 'avatar-privacy' ); ?>
|
||||
<?php \esc_html_e( 'This setting will only take effect if you have not uploaded a local profile picture.', 'avatar-privacy' ); ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
69
admin/partials/profile/user-avatar-upload.php
Normal file
69
admin/partials/profile/user-avatar-upload.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of Avatar Privacy.
|
||||
*
|
||||
* Copyright 2018-2021 Peter Putzer.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***
|
||||
*
|
||||
* @package mundschenk-at/avatar-privacy
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
use Avatar_Privacy\Core;
|
||||
use Avatar_Privacy\Tools\Template as T;
|
||||
|
||||
/**
|
||||
* Required template variables:
|
||||
*
|
||||
* @var int $user_id The ID of the edited user.
|
||||
* @var T $template The templating helper.
|
||||
* @var string $nonce The nonce itself.
|
||||
* @var string $action The nonce action.
|
||||
* @var string $upload_field The name of the uploader `<input>` element.
|
||||
* @var string $erase_field The name of the erase checkbox `<input>` element.
|
||||
* @var bool $uploads_disabled Whether the uploads system has been disabled completely..
|
||||
* @var bool $can_upload Whether the currently active user can upload files.
|
||||
* @var bool $has_local_avatar Whether a local avatar has been uploaded.
|
||||
* @var int $size The width/height of the avatar preview image (in pixels).
|
||||
* @var bool $show_description Whether the field description should be shown.
|
||||
*/
|
||||
|
||||
?>
|
||||
<tr class="avatar-privacy-user-avatar-upload">
|
||||
<th scope="row"><?php \esc_html_e( 'Profile Picture', 'avatar-privacy' ); ?></th>
|
||||
<td>
|
||||
<?php echo \get_avatar( $user_id, $size, '', '', [ 'upload_timestamp' => true ] ); ?>
|
||||
|
||||
<?php if ( $can_upload ) : ?>
|
||||
<p class="avatar-privacy-upload-fields">
|
||||
<?php \wp_nonce_field( $action, $nonce ); ?>
|
||||
<input type="file" id="<?php echo \esc_attr( $upload_field ); ?>" name="<?php echo \esc_attr( $upload_field ); ?>" accept="image/*" />
|
||||
<?php if ( $has_local_avatar ) : ?>
|
||||
<input type="checkbox" id="<?php echo \esc_attr( $erase_field ); ?>" name="<?php echo \esc_attr( $erase_field ); ?>" value="true" />
|
||||
<label for="<?php echo \esc_attr( $erase_field ); ?>"><?php \esc_html_e( 'Delete local avatar picture.', 'avatar-privacy' ); ?></label><br />
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<?php if ( ! $uploads_disabled && $show_description ) : ?>
|
||||
<p class="description">
|
||||
<?php echo \wp_kses( $template->get_uploader_description( $can_upload, $has_local_avatar ), T::ALLOWED_HTML_LABEL ); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
39
admin/partials/sections/avatars-disabled-script.php
Normal file
39
admin/partials/sections/avatars-disabled-script.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of Avatar Privacy.
|
||||
*
|
||||
* Copyright 2018 Peter Putzer.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***
|
||||
*
|
||||
* @package mundschenk-at/avatar-privacy
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
(function($){
|
||||
var parent = $( '#show_avatars' ),
|
||||
hideChildren = $( '.avatar-settings-disabled' ),
|
||||
showChildren = $( '.avatar-settings-enabled' );
|
||||
parent.change(function(){
|
||||
hideChildren.toggleClass( 'hide-if-js', this.checked );
|
||||
showChildren.toggleClass( 'hide-if-js', ! this.checked );
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
<?php
|
39
admin/partials/sections/avatars-disabled.php
Normal file
39
admin/partials/sections/avatars-disabled.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of Avatar Privacy.
|
||||
*
|
||||
* Copyright 2018-2019 Peter Putzer.
|
||||
* Copyright 2012-2013 Johannes Freudendahl.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***
|
||||
*
|
||||
* @package mundschenk-at/avatar-privacy
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
$show_avatars_class = empty( $show_avatars ) ? '' : ' hide-if-js';
|
||||
|
||||
?>
|
||||
<div class="avatar-settings-disabled<?php echo $show_avatars_class; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>">
|
||||
<p>
|
||||
<?php \esc_html_e( "The Avatar Privacy plugin modifies the display of avatars. You have not enabled avatars, so this plugin can't do anything for you. :-)", 'avatar-privacy' ); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php \esc_html_e( 'You can enable profile pictures for users and commenters by selecting "Show Avatars" above. Then you will also see the features enabled by the Avatar Privacy plugin here.', 'avatar-privacy' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
42
admin/partials/sections/avatars-enabled.php
Normal file
42
admin/partials/sections/avatars-enabled.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of Avatar Privacy.
|
||||
*
|
||||
* Copyright 2018-2019 Peter Putzer.
|
||||
* Copyright 2012-2013 Johannes Freudendahl.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***
|
||||
*
|
||||
* @package mundschenk-at/avatar-privacy
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
$show_avatars_class = ! empty( $show_avatars ) ? '' : ' hide-if-js';
|
||||
$allowed_html = [ 'strong' => [] ];
|
||||
|
||||
?>
|
||||
<div class="avatar-settings-enabled<?php echo $show_avatars_class; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>">
|
||||
<p>
|
||||
<?php \esc_html_e( 'To protect the privacy of your users, visitors and commenters, the Avatar Privacy plugin has enabled the following features:', 'avatar-privacy' ); ?>
|
||||
</p>
|
||||
<ul class="ul-disc">
|
||||
<li><strong><?php \esc_html_e( 'Consent:', 'avatar-privacy' ); ?></strong> <?php \esc_html_e( 'We only try to load an avatar from Gravatar.com when users and commenters have explicitly consented.', 'avatar-privacy' ); ?></li>
|
||||
<li><strong><?php \esc_html_e( 'Check:', 'avatar-privacy' ); ?></strong> <?php \esc_html_e( 'Even when people opt-in, we check if they really have a gravatar associated with their e-mail address.', 'avatar-privacy' ); ?></li>
|
||||
<li><strong><?php \esc_html_e( 'Cache:', 'avatar-privacy' ); ?></strong> <?php \esc_html_e( 'To prevent tracking of your visitors, gravatars are cached locally and all default images are hosted on your server.', 'avatar-privacy' ); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
Reference in New Issue
Block a user