Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor committed May 15, 2024
1 parent 9922e70 commit 638cab5
Show file tree
Hide file tree
Showing 39 changed files with 54 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interface Avatar_Handler {
/**
* Retrieves the URL for the given default icon type.
*
* @since 2.7.0 Removed argument index 'type' as it is not required for all implemntations.
* @since 2.7.0 Removed argument index 'type' as it is not required for all implementations.
*
* @param string $url The fallback image URL.
* @param string $hash The hashed mail address.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

/**
* A base class for parts-based icon generators independent of the used image
* format. Part definitions are chached using WordPress' transient mechanism.
* format. Part definitions are cached using WordPress' transient mechanism.
*
* The algorithm for building icons is conceptually based on Andreas Gohr's
* MonsterId library.
Expand Down Expand Up @@ -136,7 +136,7 @@ public function build( $seed, $size ) {
// Something went wrong but don't want to mess up blog layout.
return false;
} finally {
// Reset randomness to something unknonwn.
// Reset randomness to something unknown.
$this->number_generator->reset();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ protected function combine_images( $base, $image ) {
* exchanging the provided images.
*
* @since 2.1.0 Visibility changed to protected.
* @since 2.3.0 Moved to PNG_Parts_Generator class and paramter $text removed.
* @since 2.3.0 Moved to PNG_Parts_Generator class and parameter $text removed.
* Use new method `get_parts_dimensions_as_text` to retrieve the
* human-readable array definition.
*
Expand Down
2 changes: 1 addition & 1 deletion includes/avatar-privacy/class-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Controller {
/**
* Creates an instance of the plugin controller.
*
* @since 2.3.0 Component parameters replaced with factory-cofigured array.
* @since 2.3.0 Component parameters replaced with factory-configured array.
*
* @param Core $core The core API.
* @param Component[] $components An array of plugin components.
Expand Down
2 changes: 1 addition & 1 deletion includes/avatar-privacy/class-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public static function set_instance( Core $instance ) {
*/
public static function get_instance() {
if ( null === self::$instance ) {
throw new \BadMethodCallException( __METHOD__ . ' called without prior plugin intialization.' );
throw new \BadMethodCallException( __METHOD__ . ' called without prior plugin initialization.' );
}

return self::$instance;
Expand Down
4 changes: 2 additions & 2 deletions includes/avatar-privacy/cli/class-database-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public function create( array $args, array $assoc_args ) {
if ( $this->comment_author_table->maybe_create_table( '' ) ) {
WP_CLI::success( WP_CLI::colorize( "Table %B{$table_name}%n created/updated successfully." ) );
} else {
WP_CLI::error( WP_CLI::colorize( "An error occured while creating the table %B{$table_name}%n." ) );
WP_CLI::error( WP_CLI::colorize( "An error occurred while creating the table %B{$table_name}%n." ) );
}
}

Expand Down Expand Up @@ -309,7 +309,7 @@ public function upgrade( array $args, array $assoc_args ) {

// Upgrade table structure.
if ( ! $this->comment_author_table->maybe_create_table( '' ) ) {
WP_CLI::error( WP_CLI::colorize( "An error occured while creating or updating the table %B{$table}%n." ) );
WP_CLI::error( WP_CLI::colorize( "An error occurred while creating or updating the table %B{$table}%n." ) );
}

// Upgrade data.
Expand Down
4 changes: 2 additions & 2 deletions includes/avatar-privacy/cli/class-uninstall-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ public function register() {
*
* ## EXAMPLES
*
* # Remove all data from a non-multisite installatin.
* # Remove all data from a non-multisite installations.
* $ wp avatar-privacy uninstall
*
* # Remove site-specific and global data from a multisite installation
* # (site-specific data needs to be deleted from each site seperately).
* # (site-specific data needs to be deleted from each site separately).
* $ wp avatar-privacy uninstall --global
*
* @global \wpdb $wpdb The WordPress database.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ protected function determine_gravatar_policy( $user_id, $email, $id_or_email ) {
* Filters the default policy for showing gravatars.
*
* The result only applies if a user or comment author has not
* explicitely set a value for `use_gravatar` (i.e. for comments
* explicitly set a value for `use_gravatar` (i.e. for comments
* created before the plugin was installed).
*
* @param bool $show Default false.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function run() {
}

/**
* Registeres all the different CLI commands.
* Registers all the different CLI commands.
*
* @return void
*/
Expand Down
2 changes: 1 addition & 1 deletion includes/avatar-privacy/components/class-image-proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public function load_cached_avatar( \WP $wp ) {
* @since 2.1.0 Visibility changed to protected.
*
* @param string $file The full path to the image.
* @param int $cache_time The time the image should be cached by the brwoser (in seconds).
* @param int $cache_time The time the image should be cached by the browser (in seconds).
* @param string $content_type The content MIME type.
*
* @return void
Expand Down
2 changes: 1 addition & 1 deletion includes/avatar-privacy/components/class-settings-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Settings_Page implements Component {
private Template $template;

/**
* Indiciates whether the settings page is buffering its output.
* Indicates whether the settings page is buffering its output.
*
* @var bool
*/
Expand Down
2 changes: 1 addition & 1 deletion includes/avatar-privacy/components/class-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function run() {
// Update settings and database if necessary.
\add_action( 'plugins_loaded', [ $this, 'update_check' ] );

// Clean up uploaded files after deleting the refering metadata.
// Clean up uploaded files after deleting the referring metadata.
\add_action( 'deleted_user_meta', [ $this->registered_user, 'remove_orphaned_local_avatar' ], 10, 4 );
}

Expand Down
2 changes: 1 addition & 1 deletion includes/avatar-privacy/components/class-user-profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class User_Profile implements Component {
private $form;

/**
* Indiciates whether the settings page is buffering its output.
* Indicates whether the settings page is buffering its output.
*
* @var bool
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public function invalidate( $subdir = '', $regex = '' ) {
if ( $file->isWritable() ) {

if ( $file->isDir() ) {
\rmdir( $path ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_rmdir -- Useing the WP_Filesystem API is not an option on the frontend.
\rmdir( $path ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_rmdir -- Using the WP_Filesystem API is not an option on the frontend.
} else {
delete_file( $path );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public function migrate_from_global_table( $site_id ) {
*
* @global \wpdb $wpdb The WordPress Database Access Abstraction.
*
* @param string[] $emails An array of email adresses.
* @param string[] $emails An array of email addresses.
* @param string $table The table name.
*
* @return string|false The prepared query, or false.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public function maybe_create_table( $previous_version ) {

if ( ! $this->table_exists( $table_name ) ) {
// There was an error creating the table.
// TODO: Signal catastrophic error to the adminstrator.
// TODO: Signal catastrophic error to the administrator.
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
namespace Avatar_Privacy\Exceptions;

/**
* An exception indicating that an error occured during a database operation.
* An exception indicating that an error occurred during a database operation.
*
* @since 2.4.0
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
namespace Avatar_Privacy\Exceptions;

/**
* An exception indicating that an error occured while setting up the object factory.
* An exception indicating that an error occurred while setting up the object factory.
*
* @since 2.5.1
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
namespace Avatar_Privacy\Exceptions;

/**
* An exception indicating that an error occured during image handling.
* An exception indicating that an error occurred during image handling.
*
* @since 2.4.0
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
namespace Avatar_Privacy\Exceptions;

/**
* An exception indicating that an error occured while processing the file upload.
* An exception indicating that an error occurred while processing the file upload.
*
* @since 2.4.0
*
Expand Down
10 changes: 5 additions & 5 deletions includes/avatar-privacy/tools/class-hasher.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,20 @@ protected function generate_salt() {
* Generates a salted SHA-256 hash for the given identifier (an e-mail address
* in most cases).
*
* @param string $identifer The identifier. Whitespace on either side
* @param string $identifier The identifier. Whitespace on either side
* is ignored.
* @param bool $case_sensitive Optional. Whether the identifier is case-sensitive
* (e.g. an URL). Default false.
*
* @return string
*/
public function get_hash( $identifer, $case_sensitive = false ) {
$identifier = \trim( $identifer );
public function get_hash( $identifier, $case_sensitive = false ) {
$identifier = \trim( $identifier );

if ( ! $case_sensitive ) {
$identifer = \strtolower( $identifier );
$identifier = \strtolower( $identifier );
}

return \hash( 'sha256', "{$this->get_salt()}{$identifer}" );
return \hash( 'sha256', "{$this->get_salt()}{$identifier}" );
}
}
2 changes: 1 addition & 1 deletion includes/avatar-privacy/tools/class-multisite.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Multisite {
* Warning: This is potentially expensive.
*
* @param callable $task The task to execute. Should take the site ID as its parameter.
* @param int|null $network_id Optional. The network ID (`null` means the current netwrok). Default null.
* @param int|null $network_id Optional. The network ID (`null` means the current network). Default null.
*
* @return void
*/
Expand Down
2 changes: 1 addition & 1 deletion includes/avatar-privacy/tools/html/class-dependencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function __construct() {
}

/**
* Registeres a script for the block editor (using the generated asset file).
* Registers a script for the block editor (using the generated asset file).
*
* @param string $handle The name of the script. Should be unique.
* @param string $block The path of the script relative to the plugin's
Expand Down
6 changes: 3 additions & 3 deletions includes/avatar-privacy/tools/images/class-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Editor {
private string $stream_url;

/**
* The stream implmentation to use.
* The stream implementation to use.
*
* @since 2.1.0
*
Expand Down Expand Up @@ -213,7 +213,7 @@ public function get_resized_image_data( $image, $width, $height, $format = Image
return '';
}

// Caculate the crop dimensions.
// Calculate the crop dimensions.
$current = $image->get_size();
$crop = $this->get_crop_dimensions( $current['width'], $current['height'], $width, $height );

Expand Down Expand Up @@ -254,7 +254,7 @@ protected function get_crop_dimensions( $orig_w, $orig_h, $dest_w, $dest_h ) {
// with the same aspect ratio as the destination image.
$factor = \min( $orig_w / $dest_w, $orig_h / $dest_h );

// Caclulate the crop dimensions.
// Calculate the crop dimensions.
$crop_w = \round( $dest_w * $factor );
$crop_h = \round( $dest_h * $factor );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function get_image( $email, $size, $rating ) {
);

if ( false === $this->editor->get_mime_type( $image ) ) {
// Propably a Varnish error, so we ignore the data.
// Probably a Varnish error, so we ignore the data.
$image = '';
}

Expand Down Expand Up @@ -280,7 +280,7 @@ protected function calculate_caching_duration( $result, $age ) {
*
* @param int $duration The validation interval. Default 1 week if the check was successful, less if not.
* @param bool $result The result of the validation check.
* @param int $age The "age" (difference between now and the creation date) of a comment or post (in sceonds).
* @param int $age The "age" (difference between now and the creation date) of a comment or post (in seconds).
*/
return \apply_filters( 'avatar_privacy_validate_gravatar_interval', $duration, ! empty( $result ), $age );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ protected function get_file_slice( array $args ) {
protected function handle_upload_errors( array $upload_result, array $args ) {
if ( empty( $upload_result['error'] ) ) {
$id = self::ERROR_UNKNOWN;
$message = \__( 'An unknown error occured while uploading the avatar', 'avatar-privacy' );
$message = \__( 'An unknown error occurred while uploading the avatar', 'avatar-privacy' );
} elseif ( 'Sorry, this file type is not permitted for security reasons.' === $upload_result['error'] ) {
$id = self::ERROR_INVALID_IMAGE;
$message = \__( 'Please upload a valid PNG, GIF or JPEG image for the avatar.', 'avatar-privacy' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ protected function get_file_slice( array $args ) {
*/
protected function handle_upload_errors( array $upload_result, array $args ) {
if ( empty( $upload_result['error'] ) ) {
$error_message = \__( 'An unknown error occured while uploading the avatar', 'avatar-privacy' );
$error_message = \__( 'An unknown error occurred while uploading the avatar', 'avatar-privacy' );
} elseif ( 'Sorry, this file type is not permitted for security reasons.' === $upload_result['error'] ) {
$error_message = \__( 'Please upload a valid PNG, GIF or JPEG image for the avatar.', 'avatar-privacy' );
} else {
Expand Down
2 changes: 1 addition & 1 deletion public/images/LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ License URL: <https://creativecommons.org/licenses/by/4.0/>

## wavatars/*.png

The Wavatars impelementation is based on the original WordPress plugin by Shamus Young.
The Wavatars implementation is based on the original WordPress plugin by Shamus Young.

Copyright: Shames Young (2007)\
URL: <https://shamusyoung.com/twentysidedtale/?p=1462>
Expand Down
6 changes: 3 additions & 3 deletions public/partials/robohash/svg.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
* @var string $bg_color The background color as a CSS color string (e.g. `#80d8ff`).
* @var string $body The SVG elements making up the robot's body.
* @var string $face The SVG elements making up the robot's face.
* @var string $eyes The SVG elemenets making up the robot's eyes.
* @var string $mouth The SVG elemenets making up the robot's mouth.
* @var string $accessory The SVG elemenets making up the robot's accessory.
* @var string $eyes The SVG elements making up the robot's eyes.
* @var string $mouth The SVG elements making up the robot's mouth.
* @var string $accessory The SVG elements making up the robot's accessory.
*/

?>
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Yes, it certainly can. You have to be careful though which plugin options you se

= Can this plugin be used on a multisite installation? =

Yes, the plugin can be used on a multisite installation. You can either activate it on individual blogs or do a network activation. As users are global to a multisite installation, their choice regarding Gravatar.com use will affect all sites in the network. So if a user comments on blog A and chooses to display gravatars, this decision will be followed on blog B and C too. On new installations, comment author (i.e. non-user) opt-in is recorded per site, not per network. If you first installed Avatar Privacy 0.4 or earlier, the global table `wp_avatar_privacy` continues to be used for all sites in the multisite network. This behavior can be overriden by the network admin via the filter hook `avatar_privacy_enable_global_table`.
Yes, the plugin can be used on a multisite installation. You can either activate it on individual blogs or do a network activation. As users are global to a multisite installation, their choice regarding Gravatar.com use will affect all sites in the network. So if a user comments on blog A and chooses to display gravatars, this decision will be followed on blog B and C too. On new installations, comment author (i.e. non-user) opt-in is recorded per site, not per network. If you first installed Avatar Privacy 0.4 or earlier, the global table `wp_avatar_privacy` continues to be used for all sites in the multisite network. This behavior can be overridden by the network admin via the filter hook `avatar_privacy_enable_global_table`.

= Won't spam comments flood the database table with useless entries for the checkbox in the comment form? =

Expand Down
2 changes: 1 addition & 1 deletion tests/avatar-privacy/class-core-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function test_singleton() {
*/
public function test_get_instance_failing() {
$this->expectException( \BadMethodCallException::class );
$this->expectExceptionMessage( 'Avatar_Privacy\Core::get_instance called without prior plugin intialization.' );
$this->expectExceptionMessage( 'Avatar_Privacy\Core::get_instance called without prior plugin initialization.' );

$core = \Avatar_Privacy\Core::get_instance(); // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ public function provide_should_show_gravatar_data() {
[ false, false, '', false ], // No validation.
[ true, false, '', true ], // No validation.
[ true, true, false, false ], // Failed validation.
[ true, true, 'image/png', true ], // Succesful validaton.
[ true, true, 'image/png', true ], // Successful validaton.
];
}

Expand Down
2 changes: 1 addition & 1 deletion tests/avatar-privacy/components/class-shortcodes-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function test_render_frontend_form_shortcode() {
'avatar_size' => 120,
];

// Systme state.
// System state.
$user_id = 42;

// Result.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ public function test_update_gravatar_use( $email, $comment_id, $use_gravatar, $d
}

/**
* Provides dat afor testing ::update_hash.
* Provides data for testing ::update_hash.
*
* @return array
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/avatar-privacy/core/class-user-fields-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ public function provide_delete_data() {
* @param int $result The expected result.
* @param bool $hash_del Whether the email hash was deleted.
* @param bool $gravatar_del Whether the Gravatar usage policy was deleted.
* @param bool $anon_del Whether the anoymous commenting policy was deleted.
* @param bool $anon_del Whether the anonymous commenting policy was deleted.
* @param bool $avatar_del Whether the local avatar was deleted.
*/
public function test_delete( $result, $hash_del, $gravatar_del, $anon_del, $avatar_del ) {
Expand Down
Loading

0 comments on commit 638cab5

Please sign in to comment.