Skip to content

Commit

Permalink
Merge pull request #2777 from mircobabini/enhance/v30/fix-typos
Browse files Browse the repository at this point in the history
Fix typos in the codebase. 99% are comments.
  • Loading branch information
ideadude authored Apr 10, 2024
2 parents 0029041 + 9eab594 commit 7563ad0
Show file tree
Hide file tree
Showing 29 changed files with 51 additions and 52 deletions.
2 changes: 1 addition & 1 deletion adminpages/orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
$hour = intval( $_POST['ts_hour'] );
$minute = intval( $_POST['ts_minute'] );
$date = get_gmt_from_date( $year . '-' . $month . '-' . $day . ' ' . $hour . ':' . $minute . ':00' , 'U' );
$order->timestamp = $date; // Passed 'U' to get_gmt_from_date() so that we get a Unix timesamp.
$order->timestamp = $date; // Passed 'U' to get_gmt_from_date() so that we get a Unix timestamp.
}

// affiliate stuff
Expand Down
2 changes: 1 addition & 1 deletion adminpages/reports/sales.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ function pmpro_report_sales_page()
$param_hash = md5( implode( ' ', $param_array ) . PMPRO_VERSION );
set_transient( 'pmpro_sales_data_' . $param_hash, $csvdata, HOUR_IN_SECONDS );

// Here, we're goign to build data for the Google Chart.
// Here, we're going to build data for the Google Chart.
// We are doing the calculations up here so that we don't need to weave them into the JS to display the chart.
$google_chart_column_labels = array();
$google_chart_row_data = array();
Expand Down
2 changes: 1 addition & 1 deletion adminpages/subscriptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class="page-title-action pmpro-has-icon pmpro-has-icon-no"
echo esc_html( $sub_membership_level_name );

// If the subscription is active and the user has membership levels other than the one that the subscription is for, we should
// give the option to move the subcription to another user level.
// give the option to move the subscription to another user level.
if ( 'active' == $subscription->get_status() ) {
// Get all of the user's membership levels.
$user_membership_levels = pmpro_getMembershipLevelsForUser( $subscription->get_user_id() );
Expand Down
2 changes: 1 addition & 1 deletion classes/class-pmpro-field.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class PMPro_Field {
public $options = array();

/**
* Whether multiple options should be selectable when using a select, seelect2, or multiselect field type.
* Whether multiple options should be selectable when using a select, select2, or multiselect field type.
*
* @since 2.9
*
Expand Down
4 changes: 2 additions & 2 deletions classes/class-pmpro-subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ private function format_subscription_date( $date, $format = 'timestamp', $local_
* @return null|PMProGateway The PMProGateway object, null if not set or class found.
*/
public function get_gateway_object() {
// No gatway was set.
// No gateway was set.
if ( empty( $this->gateway ) ) {
return null;
}
Expand Down Expand Up @@ -847,7 +847,7 @@ public function get_initial_payment() {
// Get the first order object.
$order = current( $orders );

// Use the order total as the intitial payment.
// Use the order total as the initial payment.
$this->initial_payment = $order->total;
}

Expand Down
5 changes: 2 additions & 3 deletions classes/class.mimetype.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function getType($filename) {
// get base name of the filename provided by user
$filename = basename($filename);

// break file into parts seperated by .
// break file into parts separated by .
$filename = explode('.', $filename);

// take the last part of the file to get the file extension
Expand Down Expand Up @@ -220,7 +220,7 @@ function privBuildMimeArray() {
"rtf" => "text/rtf",
"sgml" => "text/sgml",
"sgm" => "text/sgml",
"tsv" => "text/tab-seperated-values",
"tsv" => "text/tab-separated-values",
"wml" => "text/vnd.wap.wml",
"wmls" => "text/vnd.wap.wmlscript",
"etx" => "text/x-setext",
Expand All @@ -242,4 +242,3 @@ function privBuildMimeArray() {
return $mimetypes;
}
}
?>
4 changes: 2 additions & 2 deletions classes/class.pmproemail.php
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ function sendRefundedAdminEmail( $user = NULL, $invoice = NULL ) {
}

/**
* Send the member a confirmation checkout email after succesfully purchasing a membership level.
* Send the member a confirmation checkout email after successfully purchasing a membership level.
*
* @param object $user The WordPress user object.
* @param MemberOrder $invoice The order object that is associated with the checkout.
Expand Down Expand Up @@ -723,7 +723,7 @@ function sendCheckoutEmail($user = NULL, $invoice = NULL)
}

/**
* Send the admin a confirmation checkout email after the member succesfully purchases a membership level.
* Send the admin a confirmation checkout email after the member successfully purchases a membership level.
*
* @param object $user The WordPress user object.
* @param MemberOrder $invoice The order object that is associated with the checkout.
Expand Down
2 changes: 1 addition & 1 deletion classes/gateways/class.pmprogateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function cancel(&$order)
if(empty($order->subscription_transaction_id))
return false;

//simulate a successful cancel
//simulate a successful cancel
$order->updateStatus("cancelled");
return true;
}
Expand Down
10 changes: 5 additions & 5 deletions classes/gateways/class.pmprogateway_authorizenet.php
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ function subscribe(&$order)

//send the xml via curl
$this->response = $this->send_request_via_curl($host,$path,$this->content);
//if curl is unavilable you can try using fsockopen
//if curl is unavailable you can try using fsockopen
/*
$response = send_request_via_fsockopen($host,$path,$content);
*/
Expand Down Expand Up @@ -778,7 +778,7 @@ function update(&$order)

//send the xml via curl
$this->response = $this->send_request_via_curl($host,$path,$this->content);
//if curl is unavilable you can try using fsockopen
//if curl is unavailable you can try using fsockopen
/*
$response = send_request_via_fsockopen($host,$path,$order->content);
*/
Expand Down Expand Up @@ -844,7 +844,7 @@ function update(&$order)
"<includeIssuerInfo>true</includeIssuerInfo>".
"</getCustomerProfileRequest>";
$this->response = $this->send_request_via_curl($host,$path,$this->content);
// Print entire repsonse.
// Print entire response.
echo $this->response;
wp_die();
*/
Expand Down Expand Up @@ -906,7 +906,7 @@ function cancel(&$order)

//send the xml via curl
$response = $this->send_request_via_curl($host,$path,$content);
//if curl is unavilable you can try using fsockopen
//if curl is unavailable you can try using fsockopen
/*
$response = send_request_via_fsockopen($host,$path,$content);
*/
Expand Down Expand Up @@ -978,7 +978,7 @@ function getSubscriptionStatus(&$order)
//send the xml via curl
$response = $this->send_request_via_curl($host,$path,$content);

//if curl is unavilable you can try using fsockopen
//if curl is unavailable you can try using fsockopen
/*
$response = send_request_via_fsockopen($host,$path,$content);
*/
Expand Down
20 changes: 10 additions & 10 deletions classes/gateways/class.pmprogateway_stripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public static function init() {

//old global RE showing billing address or not
global $pmpro_stripe_lite;
$pmpro_stripe_lite = apply_filters( "pmpro_stripe_lite", ! get_option( "pmpro_stripe_billingaddress" ) ); //default is oposite of the stripe_billingaddress setting
$pmpro_stripe_lite = apply_filters( "pmpro_stripe_lite", ! get_option( "pmpro_stripe_billingaddress" ) ); //default is opposite of the stripe_billingaddress setting

$gateway = pmpro_getGateway();
if($gateway == "stripe")
Expand Down Expand Up @@ -428,9 +428,9 @@ public static function pmpro_payment_option_fields( $values, $gateway ) {
$failed_webhooks = array();
$missing_webhooks = array();
$working_webhooks = array();
// For sites that tracked "last webhook recieved" before we started tracking webhook events individually,
// For sites that tracked "last webhook received" before we started tracking webhook events individually,
// we want to ignore events that were sent by Stripe before site was updated to start tracking individual events.
$legacy_last_webhook_recieved_timestamp = get_option( 'pmpro_stripe_last_webhook_received_' . $stripe->gateway_environment );
$legacy_last_webhook_received_timestamp = get_option( 'pmpro_stripe_last_webhook_received_' . $stripe->gateway_environment );
foreach ( $required_webhook_events as $required_webhook_event ) {
$event_data = array( 'name' => $required_webhook_event );

Expand All @@ -453,8 +453,8 @@ public static function pmpro_payment_option_fields( $values, $gateway ) {
),
'type' => $required_webhook_event,
);
if ( ! empty( $legacy_last_webhook_recieved_timestamp ) ) {
$event_query_arr['created']['gt'] = strtotime( $legacy_last_webhook_recieved_timestamp );
if ( ! empty( $legacy_last_webhook_received_timestamp ) ) {
$event_query_arr['created']['gt'] = strtotime( $legacy_last_webhook_received_timestamp );
}

try {
Expand Down Expand Up @@ -1134,7 +1134,7 @@ public static function pmpro_set_up_apple_pay( $payment_option_values, $gateway
}

/**
* This function is used to save the parameters returned after successfull connection of Stripe account.
* This function is used to save the parameters returned after successful connection of Stripe account.
*
* @return void
*/
Expand Down Expand Up @@ -1504,7 +1504,7 @@ static function show_stripe_checkout_pending_warning($show)
}

/**
* Instead of changeing membership levels, send users to Stripe to pay.
* Instead of changing membership levels, send users to Stripe to pay.
*
* @since 2.8
*
Expand Down Expand Up @@ -1627,7 +1627,7 @@ static function pmpro_checkout_before_change_membership_level($user_id, $morder)
}
}

// Set up tax and billing addres collection.
// Set up tax and billing address collection.
$automatic_tax = ( ! empty( get_option( 'pmpro_stripe_tax' ) ) && 'no' !== get_option( 'pmpro_stripe_tax' ) ) ? array(
'enabled' => true,
) : array(
Expand Down Expand Up @@ -2516,7 +2516,7 @@ private function create_customer( $args ) {
* Falls back on information in User object if insufficient
* information in MemberOrder.
*
* Should only be called when checkout is being proceesed. Otherwise,
* Should only be called when checkout is being processed. Otherwise,
* use update_customer_from_user() method.
*
* @since 2.7.0
Expand Down Expand Up @@ -3936,7 +3936,7 @@ public static function process_refund( $success, $order ) {
$myemail->sendRefundedAdminEmail( $user, $order );

} else {
$order->notes = trim( $order->notes . ' ' . __('Admin: An error occured while attempting to process this refund.', 'paid-memberships-pro' ) );
$order->notes = trim( $order->notes . ' ' . __('Admin: An error occurred while attempting to process this refund.', 'paid-memberships-pro' ) );
}

} catch ( \Throwable $e ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function pmpro_admin_init_redirect_to_dashboard() {
add_action( 'admin_init', 'pmpro_admin_init_redirect_to_dashboard' );

/**
* Block Subscibers from accessing the WordPress Dashboard.
* Block Subscribers from accessing the WordPress Dashboard.
*
* @since 2.3.4
*/
Expand Down
2 changes: 1 addition & 1 deletion includes/compatibility/bluehost-wordpress-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

/**
* When a user is logged in, the BlueHost plugin will check if their passowrd is
* When a user is logged in, the BlueHost plugin will check if their password is
* insecure. If it is, they will be redirected to an "insecure password" screen.
* This can interrupt our checkout flow.
*
Expand Down
2 changes: 1 addition & 1 deletion includes/compatibility/divi.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static function restrict_content( $output, $props, $attrs, $slug ) {
}

/**
* Filter the element classess added to the no_access messages for improved appearance in Divi.
* Filter the element classes added to the no_access messages for improved appearance in Divi.
* Hooked into pmpro_element_class.
* @since 2.8.2
*/
Expand Down
2 changes: 1 addition & 1 deletion includes/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ function pmpro_membership_content_filter( $content, $skipcheck = false ) {
//show excerpt
global $post;
if( $post->post_excerpt ) {
//defined exerpt
//defined excerpt
$content = wpautop( $post->post_excerpt );
} elseif(strpos($content, "<span id=\"more-" . $post->ID . "\"></span>") !== false) {
//more tag
Expand Down
2 changes: 1 addition & 1 deletion includes/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function pmpro_is_field( $var ) {
}

/**
* Add a field to the PMProRH regisration fields global
* Add a field to the PMProRH registration fields global
*
* $where refers to various hooks in the PMPro checkout page and can be:
* - after_username
Expand Down
2 changes: 1 addition & 1 deletion includes/filters.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
This file was added in version 1.5.5 of the plugin. This file is meant to store various hacks, filters, and actions that were originally developed outside of the PMPro core and brought in later... or just things that are cleaner/easier to impement via hooks and filters.
This file was added in version 1.5.5 of the plugin. This file is meant to store various hacks, filters, and actions that were originally developed outside of the PMPro core and brought in later... or just things that are cleaner/easier to implement via hooks and filters.
*/

/*
Expand Down
14 changes: 7 additions & 7 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,7 @@ function pmpro_clear_level_cache_for_user( $user_id ) {
function pmpro_do_action_after_all_membership_level_changes( $filter_contents = null ) {
global $pmpro_old_user_levels;
if ( empty( $pmpro_old_user_levels ) ) {
// No level changes occured, return.
// No level changes occurred, return.
return $filter_contents;
}

Expand All @@ -1373,7 +1373,7 @@ function pmpro_do_action_after_all_membership_level_changes( $filter_contents =
$pmpro_old_user_levels = null;

/**
* Run code after all membership level changes have occured. Users who have had changes
* Run code after all membership level changes have occurred. Users who have had changes
* will be stored in the global $pmpro_old_user_levels array.
*
* @since 2.6
Expand Down Expand Up @@ -4123,7 +4123,7 @@ function pmpro_kses( $original_string, $context = 'email' ) {
}

/**
* Replace last occurence of a string.
* Replace last occurrence of a string.
* From: http://stackoverflow.com/a/3835653/1154321
* @since 2.6
*/
Expand Down Expand Up @@ -4223,7 +4223,7 @@ function pmpro_kses_allowed_html( $allowed_html, $context ) {
add_filter( 'wp_kses_allowed_html', 'pmpro_kses_allowed_html', 10, 2 );

/**
* Show deprecation warning if calling function was called publically.
* Show deprecation warning if calling function was called publicly.
*
* Useful for preparing to change method visibility from public to private.
*
Expand All @@ -4243,7 +4243,7 @@ function pmpro_method_should_be_private( $deprecated_notice_version ) {
}

/**
* Send a 200 HTTP reponse without ending PHP execution.
* Send a 200 HTTP response without ending PHP execution.
*
* Useful to avoid issues like timeouts from gateways during
* webhook/IPN handlers.
Expand Down Expand Up @@ -4464,7 +4464,7 @@ function pmpro_refund_order( $order ){
/**
* Returns an array of order statuses that do not qualify for a refund
*
* @return array Returns an array of statuses that are not allowe to be refunded
* @return array Returns an array of statuses that are not allowed to be refunded
*/
function pmpro_disallowed_refund_statuses() {

Expand Down Expand Up @@ -4656,7 +4656,7 @@ function pmpro_set_expiration_date( $user_id, $level_id, $enddate ) {
/*
* Check whether a file should be allowed to be uploaded.
*
* By default, only files assiciated with a user field can be uploaded,
* By default, only files associated with a user field can be uploaded,
* but there is a filter to allow other files to be uploaded as well.
*
* @since 2.12.4
Expand Down
2 changes: 1 addition & 1 deletion includes/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ function pmpro_login_forms_handler_nav( $pmpro_form ) { ?>
}

/**
* Function to handle the actualy password reset and update password.
* Function to handle the actually password reset and update password.
* @since 2.3
*/
function pmpro_do_password_reset() {
Expand Down
2 changes: 1 addition & 1 deletion includes/recaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
function pmpro_init_recaptcha() {
// If ReCAPTCHA is not enabled, don't do anything.
// global $recaptcha for backwards compatbility.
// global $recaptcha for backwards compatibility.
// TODO: Remove this in a future version.
global $recaptcha;
$recaptcha = get_option( 'pmpro_recaptcha' );
Expand Down
2 changes: 1 addition & 1 deletion includes/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ function pmpro_rest_api_change_membership_level( $request ) {

if ( is_wp_error( $user_id ) ) {
$error = $user_id->get_error_message();
return new WP_REST_Response( $error, 500 ); // Assume it failed and return a 500 error occured like core WordPress.
return new WP_REST_Response( $error, 500 ); // Assume it failed and return a 500 error occurred like core WordPress.
}

pmpro_maybe_send_wp_new_user_notification( $user_id, $level_id );
Expand Down
2 changes: 1 addition & 1 deletion js/pmpro-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ jQuery(document).ready(function () {

// Function to prep click events.
function pmpro_userfields_prep_click_events() {
// Whenever we make a change, warn the user if they try to nagivate away.
// Whenever we make a change, warn the user if they try to navigate away.
function pmpro_userfields_made_a_change() {
window.onbeforeunload = function () {
return true;
Expand Down
2 changes: 1 addition & 1 deletion js/pmpro-checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ jQuery(document).ready(function(){
}
});

// Get non-sensitve checkout form data to be sent to checkout_levels endpoint.
// Get non-sensitive checkout form data to be sent to checkout_levels endpoint.
function pmpro_getCheckoutFormDataForCheckoutLevels() {
// We need the level, discount code, and any field with the pmpro_alter_price CSS class.
const checkoutFormData = jQuery( "#level, #pmpro_level, #discount_code, #pmpro_form .pmpro_alter_price" ).serializeArray();
Expand Down
2 changes: 1 addition & 1 deletion js/pmpro-stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ jQuery( document ).ready( function( $ ) {
$('#pmpro_processing_message').css('visibility', 'visible');
$('#payment-request-button').hide();
/*
Close the payment request interface immeditately. This is not the intended
Close the payment request interface immediately. This is not the intended
implementation from Stripe, but we are submitting the payment method
through our default checkout process instead of letting Stripe
process it through the payment request button. Closing immediately also
Expand Down
Loading

0 comments on commit 7563ad0

Please sign in to comment.