diff --git a/adminpages/userinfo.php b/adminpages/userinfo.php index d57e383..4696128 100644 --- a/adminpages/userinfo.php +++ b/adminpages/userinfo.php @@ -83,14 +83,14 @@ } else { echo PMPro_Approvals::getUserApprovalStatus( $user->ID, $l, false ); ?> - [X] + [X] - | - + | + @@ -99,13 +99,13 @@ $fields ) { - $box = pmprorh_getCheckoutBoxByName( $where ); + if ( ! empty( $pmpro_user_fields ) ) { + foreach ( $pmpro_user_fields as $where => $fields ) { + $box = pmpro_get_field_group_by_name( $where ); ?> label ) ) { ?>

label ); ?>

@@ -120,7 +120,7 @@ if ( false != $field->profile ) { // Check to see if level is set for the field. - if ( isset( $field->levels ) && ! in_array( $level_details->ID, $field->levels ) ) { + if ( ! empty( $field->levels ) && ! in_array( $level_details->ID, $field->levels ) ) { continue; } @@ -136,23 +136,23 @@ ID, $field->name, true ); + $user_field = get_user_meta( $user->ID, $field->name, true ); // Get all array option values and break up the array into readable content. - if ( is_array( $register_helper_fields ) ) { - $rh_field_string = ''; - foreach( $register_helper_fields as $key => $value ) { - $rh_field_string .= $value . ', '; + if ( is_array( $user_field ) ) { + $user_field_string = ''; + foreach( $user_field as $key => $value ) { + $user_field_string .= $value . ', '; } // remove trailing comma from string. - echo '' . esc_html( rtrim( $rh_field_string, ', ' ) ) . ''; + echo '' . esc_html( rtrim( $user_field_string, ', ' ) ) . ''; } else { // If Register Helper field is a valid URL, then let's make it clickable. - if ( wp_http_validate_url( $register_helper_fields ) ) { - echo '' . esc_url( $register_helper_fields ) . ''; + if ( wp_http_validate_url( $user_field ) ) { + echo '' . esc_url( $user_field ) . ''; } else { - echo '' . esc_html( $register_helper_fields ) . ''; + echo '' . esc_html( $user_field ) . ''; } } @@ -168,5 +168,5 @@ } } ?> - « + « diff --git a/classes/class.approvalemails.php b/classes/class.approvalemails.php index c5ab8e3..7b457c7 100644 --- a/classes/class.approvalemails.php +++ b/classes/class.approvalemails.php @@ -49,11 +49,11 @@ public function sendMemberApproved( $member, $level_id = null ) { 'sitename' => get_option( 'blogname' ), 'membership_id' => $level->id, 'membership_level_name' => $level->name, - 'siteemail' => pmpro_getOption( 'from_email' ), + 'siteemail' => get_option( 'pmpro_from_email' ), 'login_link' => wp_login_url(), ); - $this->from = pmpro_getOption( 'from' ); - $this->fromname = pmpro_getOption( 'from_name' ); + $this->from = get_option( 'pmpro_from' ); + $this->fromname = get_option( 'pmpro_from_name' ); $this->data = apply_filters( 'pmpro_approvals_member_approved_email_data', $this->data, $member, $level ); @@ -92,11 +92,11 @@ public function sendMemberDenied( $member, $level_id = null ) { 'sitename' => get_option( 'blogname' ), 'membership_id' => $level->id, 'membership_level_name' => $level->name, - 'siteemail' => pmpro_getOption( 'from_email' ), + 'siteemail' => get_option( 'pmpro_from_email' ), 'login_link' => wp_login_url(), ); - $this->from = pmpro_getOption( 'from' ); - $this->fromname = pmpro_getOption( 'from_name' ); + $this->from = get_option( 'pmpro_from' ); + $this->fromname = get_option( 'pmpro_from_name' ); $this->data = apply_filters( 'pmpro_approvals_member_denied_email_data', $this->data, $member, $level ); @@ -128,11 +128,11 @@ public function sendAdminPending( $member = null, $admin = null, $level_id = nul 'name' => isset( $admin->display_name ) ? $admin->display_name : "", 'user_login' => isset( $admin->user_login ) ? $admin->user_login : "", 'sitename' => get_option( 'blogname' ), - 'siteemail' => pmpro_getOption( 'from_email' ), + 'siteemail' => get_option( 'pmpro_from_email' ), 'login_link' => wp_login_url(), ); - $this->from = pmpro_getOption( 'from' ); - $this->fromname = pmpro_getOption( 'from_name' ); + $this->from = get_option( 'pmpro_from' ); + $this->fromname = get_option( 'pmpro_from_name' ); if ( ! empty( $member ) ) { @@ -186,11 +186,11 @@ public function sendAdminApproval( $member = null, $admin = null, $level_id = nu 'name' => $admin->display_name, 'user_login' => $admin->user_login, 'sitename' => get_option( 'blogname' ), - 'siteemail' => pmpro_getOption( 'from_email' ), + 'siteemail' => get_option( 'pmpro_from_email' ), 'login_link' => wp_login_url(), ); - $this->from = pmpro_getOption( 'from' ); - $this->fromname = pmpro_getOption( 'from_name' ); + $this->from = get_option( 'pmpro_from' ); + $this->fromname = get_option( 'pmpro_from_name' ); // Let's add in the user approval data if it's available. if ( ! empty( $member ) ) { @@ -243,11 +243,11 @@ public function sendAdminDenied( $member = null, $admin = null, $level_id = null 'name' => $admin->display_name, 'user_login' => $admin->user_login, 'sitename' => get_option( 'blogname' ), - 'siteemail' => pmpro_getOption( 'from_email' ), + 'siteemail' => get_option( 'pmpro_from_email' ), 'login_link' => wp_login_url(), ); - $this->from = pmpro_getOption( 'from' ); - $this->fromname = pmpro_getOption( 'from_name' ); + $this->from = get_option( 'pmpro_from' ); + $this->fromname = get_option( 'pmpro_from_name' ); // Let's add in the user approval data if it's available. if ( ! empty( $member ) ) { diff --git a/languages/pmpro-approvals-it_IT.mo b/languages/pmpro-approvals-it_IT.mo new file mode 100644 index 0000000..a0cdb5a Binary files /dev/null and b/languages/pmpro-approvals-it_IT.mo differ diff --git a/languages/pmpro-approvals-it_IT.po b/languages/pmpro-approvals-it_IT.po new file mode 100644 index 0000000..06a95b2 --- /dev/null +++ b/languages/pmpro-approvals-it_IT.po @@ -0,0 +1,402 @@ +# Copyright (C) 2022 Stranger Studios +# This file is distributed under the same license as the Paid Memberships Pro - Approvals Add On plugin. +msgid "" +msgstr "" +"Project-Id-Version: Paid Memberships Pro - Approvals Add On 1.4.2\n" +"Report-Msgid-Bugs-To: info@paidmembershipspro.com\n" +"POT-Creation-Date: 2022-02-21T10:04:21+00:00\n" +"PO-Revision-Date: 2023-02-27 21:43+0100\n" +"Last-Translator: \n" +"Language-Team: Paid Memberships Pro \n" +"Language: it_IT\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.2.2\n" +"X-Domain: pmpro-approvals\n" + +#. Plugin Name of the plugin +msgid "Paid Memberships Pro - Approvals Add On" +msgstr "Paid Memberships Pro - Approvals Add On" + +#. Plugin URI of the plugin +msgid "https://www.paidmembershipspro.com/add-ons/approval-process-membership/" +msgstr "" +"https://www.paidmembershipspro.com/add-ons/approval-process-membership/" + +#. Description of the plugin +msgid "" +"Grants administrators the ability to approve/deny memberships after signup." +msgstr "" +"Concede agli amministratori i permessi di approvare/respingere la membership " +"dopo la registrazione." + +#. Author of the plugin +msgid "Stranger Studios" +msgstr "Stranger Studios" + +#. Author URI of the plugin +msgid "https://www.paidmembershipspro.com" +msgstr "https://www.paidmembershipspro.com" + +#: adminpages/approvals.php:6 +msgid "You do not have permissions to perform this action." +msgstr "Non hai i permessi necessari per questa azione." + +#: adminpages/approvals.php:55 pmpro-approvals.php:170 pmpro-approvals.php:189 +#: pmpro-approvals.php:191 pmpro-approvals.php:207 +msgid "Approvals" +msgstr "Approvazioni" + +#: adminpages/approvals.php:62 +msgid "All" +msgstr "Tutti" + +#: adminpages/approvals.php:67 pmpro-approvals.php:1278 +msgid "Pending" +msgstr "Pendenti" + +#: adminpages/approvals.php:72 pmpro-approvals.php:715 +msgid "Approved" +msgstr "Approvati" + +#: adminpages/approvals.php:77 +msgid "Denied" +msgstr "Respinti" + +#: adminpages/approvals.php:80 adminpages/approvals.php:84 +msgid "Search Approvals" +msgstr "Cerca approvazioni" + +#: adminpages/approvals.php:87 +msgid "Show" +msgstr "Mostra" + +#: adminpages/approvals.php:92 +msgid "All Levels" +msgstr "Tutti i livelli" + +#: adminpages/approvals.php:149 +msgid "applications awaiting review" +msgstr "applicazioni in attesa di revisione" + +#: adminpages/approvals.php:157 +msgid "ID" +msgstr "ID" + +#: adminpages/approvals.php:158 adminpages/userinfo.php:50 +msgid "Username" +msgstr "Nome utente" + +#: adminpages/approvals.php:159 +msgid "Name" +msgstr "Nome" + +#: adminpages/approvals.php:160 adminpages/userinfo.php:54 +msgid "Email" +msgstr "Email" + +#: adminpages/approvals.php:162 +msgid "Membership" +msgstr "Membership" + +#: adminpages/approvals.php:163 adminpages/userinfo.php:70 +#: pmpro-approvals.php:1412 +msgid "Approval Status" +msgstr "Stato Approvazione" + +#: adminpages/approvals.php:168 +msgid "Joined" +msgstr "Iscritto" + +#: adminpages/approvals.php:225 adminpages/userinfo.php:76 +msgid "Email Confirmation Required." +msgstr "Richiesta la conferma via email." + +#: adminpages/approvals.php:238 +msgid "Approve" +msgstr "Approva" + +#: adminpages/approvals.php:239 +msgid "Deny" +msgstr "Respingi" + +#: adminpages/approvals.php:252 +msgid "No pending members found." +msgstr "Nessun membro pendente trovato" + +#: adminpages/userinfo.php:25 +msgid "No user id passed in." +msgstr "Identificativo utente non specificato" + +#: adminpages/userinfo.php:31 +msgid "No user found with ID %d." +msgstr "Nessun utente trovato con ID %d" + +#: adminpages/userinfo.php:40 +msgid "Edit Profile" +msgstr "Modifica Profilo" + +#: adminpages/userinfo.php:43 +msgid "Account Information" +msgstr "Informazioni sull'account" + +#: adminpages/userinfo.php:46 +msgid "User ID" +msgstr "ID Utente" + +#: adminpages/userinfo.php:58 +msgid "Membership Level" +msgstr "Livello di Membership" + +#: adminpages/userinfo.php:129 +msgid "View File" +msgstr "Vedi File" + +#: adminpages/userinfo.php:165 +msgid "Back to Approvals" +msgstr "Ritorna alle Approvazioni" + +#: classes/class.approvalemails.php:35 +msgid "Your membership at %s has been approved." +msgstr "La tua richiesta di membership su %s è stata approvata." + +#: classes/class.approvalemails.php:73 +msgid "Your membership at %s has been denied." +msgstr "La tua richiesta di membership su %s è stata respinta." + +#: classes/class.approvalemails.php:111 +msgid "A member at %s is waiting approval." +msgstr "Un membero su %s è in attesa di approvazione." + +#: classes/class.approvalemails.php:164 +msgid "A member at %s has been approved." +msgstr "Un membro su %s è stato approvato" + +#: classes/class.approvalemails.php:216 +msgid "A member at %s has been denied." +msgstr "Un membro su %s è stato respinto" + +#: pmpro-approvals.php:341 +msgid "Approval Settings" +msgstr "Impostazioni di Approvazione" + +#: pmpro-approvals.php:345 +msgid "Requires Approval?" +msgstr "Richiede Approvazione?" + +#: pmpro-approvals.php:348 +msgid "No." +msgstr "No." + +#: pmpro-approvals.php:349 +msgid "Yes. Admin must approve new members for this level." +msgstr "" +"Sì. Un amministratore deve approvare i nuovi membri per questo livello." + +#: pmpro-approvals.php:351 +msgid "Yes. User must have an approved membership for a different level." +msgstr "" +"Sì. Un utente deve avere una membership approvata per un livello diverso." + +#: pmpro-approvals.php:352 +msgid "" +"Yes. User must have an approved membership for a different level AND admin " +"must approve new members for this level." +msgstr "" +"Sì. Un utente deve avere una membership approvata per un livello diverso E " +"INOLTRE un amministratore deve approvare i nuovi membri per questo livello." + +#: pmpro-approvals.php:363 +msgid "Which Level?" +msgstr "Quale livello?" + +#: pmpro-approvals.php:584 +msgid "" +"Your previous application for this level has been denied. You will not be " +"allowed to check out." +msgstr "" +"La tua precedente iscrizione a questo livello è stata respinta. Non ti sarà " +"consentito di effettuare il check out." + +#: pmpro-approvals.php:594 +msgid "" +"Since your application to the %s level has been denied, you may not check " +"out for this level." +msgstr "" +"Dal momento che la tua iscrizione al livello %s è stata respinta, non potrai " +"effettuare il check out per questo livello." + +#: pmpro-approvals.php:600 +msgid "Your application to %s is still pending." +msgstr "La tua iscrizione a %s è ancora in stato pendente." + +#: pmpro-approvals.php:604 +msgid "You must be approved for %s before checking out here." +msgstr "Devi ottenere un'approvazione per %s prima di effettuare il check out." + +#: pmpro-approvals.php:606 +msgid "" +"You must register and be approved for %2$s before " +"checking out here." +msgstr "" +"Devi registrarti ed essere approvate per accedere a %2$s prima di effettuare il check out." + +#: pmpro-approvals.php:696 +msgid "approved" +msgstr "approvato" + +#: pmpro-approvals.php:710 +msgid "%1$s on %2$s by %3$s" +msgstr "%1$s su %2$s da parte di %3$s" + +#: pmpro-approvals.php:712 +msgid "%1$s on %2$s" +msgstr "%1$s su %2$s" + +#: pmpro-approvals.php:721 pmpro-approvals.php:1304 +msgid "pending" +msgstr "pendente" + +#: pmpro-approvals.php:723 +msgid "Pending Approval for %s" +msgstr "Approvazione pendente su %s" + +#: pmpro-approvals.php:981 pmpro-approvals.php:1048 pmpro-approvals.php:1100 +msgid "You do not have permission to perform approvals." +msgstr "Non hai permessi sufficienti per approvare nuovi membri." + +#: pmpro-approvals.php:1009 +msgid "Member was approved." +msgstr "Il membro è stato approvato." + +#: pmpro-approvals.php:1076 +msgid "Member was denied." +msgstr "Il membro è stato respinto." + +#: pmpro-approvals.php:1126 +msgid "Approval reset." +msgstr "Cancellazione dell'approvazione." + +#: pmpro-approvals.php:1217 +msgid "" +"Your membership requires approval before you are able to view this content." +msgstr "" +"La tua membership richiede di essere approvata prima di accedere a questo " +"contenuto." + +#: pmpro-approvals.php:1219 +msgid "" +"Your membership application has been denied. Contact the site owners if you " +"believe this is an error." +msgstr "" +"La tua richiesta di membership è stata respinta. Contatta gli amministratori " +"del sito se pensi che questo sia un errore." + +#: pmpro-approvals.php:1258 +msgid "Status" +msgstr "Stato" + +#: pmpro-approvals.php:1307 +msgid "" +"Thank you for your membership to %1$s. Your %2$s membership status is: " +"%3$s." +msgstr "" +"Grazie per esserti iscritto a %1$s. Lo stato %2$s della tua membership è: " +"%3$s." + +#: pmpro-approvals.php:1315 +msgid "" +"Below are details about your membership account and a receipt for your " +"initial membership invoice. A welcome email with a copy of your initial " +"membership invoice has been sent to %s." +msgstr "" +"Di seguito puoi consultare i dettagli del tuo account e una copia della " +"fattura per la tua prima membership. Una email di benvenuto con la copia " +"della fattura è stata inviata a %s." + +#: pmpro-approvals.php:1327 +msgid "A user has been approved for !!membership_level_name!!" +msgstr "Un utente è stato approvato per il livello !!membership_level_name!!" + +#: pmpro-approvals.php:1328 +msgid "Approvals - Approved Email (admin)" +msgstr "Approvazioni - Email di conferma approvazione (admin)" + +#: pmpro-approvals.php:1333 +msgid "A user has been denied for !!membership_level_name!!" +msgstr "Un utente è stato respinto per il livello !!membership_level_name!!" + +#: pmpro-approvals.php:1334 +msgid "Approvals - Denied Email (admin)" +msgstr "Approvazioni - Email di respingimento (admin)" + +#: pmpro-approvals.php:1339 +msgid "A user requires approval" +msgstr "Un utente ha richiesto l'approvazione" + +#: pmpro-approvals.php:1340 +msgid "Approvals - Requires Approval (admin)" +msgstr "Approvazioni - Richiesta di approvazione (admin)" + +#: pmpro-approvals.php:1347 +msgid "Your membership to !!sitename!! has been approved." +msgstr "La tua membership sul sito !!sitename!! è stata approvata." + +#: pmpro-approvals.php:1348 +msgid "Approvals - Approved Email" +msgstr "Approvazioni - Email di approvazione" + +#: pmpro-approvals.php:1353 +msgid "Your membership to !!sitename!! has been denied." +msgstr "La tua membership sul sito !!sitename!! è stata respinta." + +#: pmpro-approvals.php:1354 +msgid "Approvals - Denied Email" +msgstr "Approvazioni - Email di respingimento" + +#: pmpro-approvals.php:1373 +msgid "" +"Your membership account is now pending. You will be notified once your " +"account has been approved/denied." +msgstr "" +"Il tuo account è in stato pendente. Ti arriverà una notifica una volta che " +"il tuo account è stato approvato o respinto." + +#: pmpro-approvals.php:1442 +msgid "User Approval Log" +msgstr "Registro di approvazione utente" + +#: pmpro-approvals.php:1475 +msgid "The chosen level does not require approval." +msgstr "Il livello selezionato non richieste approvazione." + +#: pmpro-approvals.php:1604 +msgid "No approval history found." +msgstr "Nessun log di approvazione trovato." + +#: pmpro-approvals.php:1777 +msgid "View Documentation" +msgstr "Consulta la documentazione" + +#: pmpro-approvals.php:1777 +msgid "Docs" +msgstr "Documenti" + +#: pmpro-approvals.php:1778 +msgid "Visit Customer Support Forum" +msgstr "Visita il Forum del supporto clienti" + +#: pmpro-approvals.php:1778 +msgid "Support" +msgstr "Supporto" + +#: pmpro-approvals.php:1814 +msgid "Pending Approval" +msgstr "Approvazione pendente" + +#: pmpro-approvals.php:1816 +msgid "Membership Denied" +msgstr "Membership Respinta" diff --git a/pmpro-approvals.php b/pmpro-approvals.php index c78872e..b4f5957 100644 --- a/pmpro-approvals.php +++ b/pmpro-approvals.php @@ -3,7 +3,7 @@ Plugin Name: Paid Memberships Pro - Approvals Add On Plugin URI: https://www.paidmembershipspro.com/add-ons/approval-process-membership/ Description: Grants administrators the ability to approve/deny memberships after signup. -Version: 1.5 +Version: 1.5.1 Author: Stranger Studios Author URI: https://www.paidmembershipspro.com Text Domain: pmpro-approvals @@ -867,9 +867,9 @@ public static function isPending( $user_id = null, $level_id = null ) { if ( empty( $user_approval ) || ! is_array( $user_approval ) ) { // Check if the user had this level before it was set to require approval. if ( ! empty( $level_id ) && self::hasMembershipLevelSansApproval( $level_id, $user_id ) ) { - return true; - } else { return false; + } else { + return true; } } @@ -1332,7 +1332,7 @@ public static function pmpro_account_bullets_top() { // Check that the user has this level. if ( self::hasMembershipLevelSansApproval( $approval_level_id ) ) { $level = pmpro_getLevel( $approval_level_id ); - printf( '
  • ' . esc_html( 'Approval Status for %s', 'pmpro-approvals' ) . ':' . ' %s
  • ', $level->name, $approval_statuses[ $approval_level_id ] ); + printf( '
  • ' . esc_html__( 'Approval Status for %s', 'pmpro-approvals' ) . ':' . ' %s
  • ', $level->name, $approval_statuses[ $approval_level_id ] ); } } } @@ -1418,7 +1418,7 @@ public static function pmpro_confirmation_message( $confirmation_message, $pmpro // Check instructions. $pmpro_invoice should not be empty when reaching here. if ( ! empty( $pmpro_invoice ) && $pmpro_invoice->gateway == "check" && ! pmpro_isLevelFree( $pmpro_invoice->membership_level ) ) { - $confirmation_message .= '
    ' . wpautop( wp_unslash( pmpro_getOption("instructions") ) ) . '
    '; + $confirmation_message .= '
    ' . wpautop( wp_unslash( get_option("pmpro_instructions") ) ) . '
    '; } @@ -1697,9 +1697,10 @@ public static function getApprovalCount( $approval_status = null ) { if ( ! $results ) { $number_of_users[$approval_status] = 0; + } else { + $number_of_users[$approval_status] = (int) $results[0]->count; } - $number_of_users[$approval_status] = (int) $results[0]->count; set_transient( 'pmpro_approvals_approval_count', $number_of_users, 3600*24 ); } diff --git a/readme.txt b/readme.txt index 712ba84..1791825 100644 --- a/readme.txt +++ b/readme.txt @@ -2,8 +2,8 @@ Contributors: strangerstudios, andrewza Tags: paid memberships pro, pmpro, approval, approvals, workflow Requires at least: 5.0 -Tested up to: 6.0 -Stable tag: 1.5 +Tested up to: 6.4 +Stable tag: 1.5.1 Grants administrators the ability to approve/deny memberships after signup. @@ -36,6 +36,10 @@ Members pending approval will not have access to view members-only content until View full documentation at: https://www.paidmembershipspro.com/add-ons/approval-process-membership/ == Changelog == += 1.5.1 - 2023-11-30 = +* BUG FIX/ENHANCEMENT: Added support for User Fields instead of Register Helper Fields when previewing the pending member information. Please upgrade any Register Helper code to use the User Fields logic or class. +* REFACTOR: Refactored pmpro_getOption functions to use get_option instead. + = 1.5 - 2022-10-06 = * ENHANCEMENT: Added support for Multiple Memberships Per User, allowing individual approval for each level ID a user may hold. * ENHANCEMENT: Improved logic for the Approval Counter to increase accuracy.