From ebe531302933e2332acea1a87b75d9fa3420d66e Mon Sep 17 00:00:00 2001 From: Sapayth Hossain Date: Mon, 14 Oct 2024 09:05:23 +0600 Subject: [PATCH] tweak: for release 4.0.12 --- Lib/Appsero/Client.php | 14 +--- Lib/WeDevs_Insights.php | 12 +-- includes/Ajax/Frontend_Form_Ajax.php | 4 - includes/Setup_Wizard.php | 8 +- includes/Traits/TaxableTrait.php | 4 +- languages/wp-user-frontend.pot | 114 ++++++++++++++------------- temp.svg | 5 -- 7 files changed, 73 insertions(+), 88 deletions(-) delete mode 100644 temp.svg diff --git a/Lib/Appsero/Client.php b/Lib/Appsero/Client.php index 08b7f654d..1e5b40abe 100644 --- a/Lib/Appsero/Client.php +++ b/Lib/Appsero/Client.php @@ -2,6 +2,8 @@ namespace WeDevs\Wpuf\Lib\Appsero; +use WP_Error; + /** * Appsero Client * @@ -110,13 +112,9 @@ public function __construct( $hash, $name, $file ) { /** * Initialize insights class * - * @return Appsero\Insights + * @return object */ public function insights() { - if ( ! class_exists( __NAMESPACE__ . '\Insights' ) ) { - require_once __DIR__ . '/Insights.php'; - } - // if already instantiated, return the cached one if ( $this->insights ) { return $this->insights; @@ -130,13 +128,9 @@ public function insights() { /** * Initialize license checker * - * @return Appsero\License + * @return object */ public function license() { - if ( ! class_exists( __NAMESPACE__ . '\License' ) ) { - require_once __DIR__ . '/License.php'; - } - // if already instantiated, return the cached one if ( $this->license ) { return $this->license; diff --git a/Lib/WeDevs_Insights.php b/Lib/WeDevs_Insights.php index 702fc4bb8..4a732a00d 100644 --- a/Lib/WeDevs_Insights.php +++ b/Lib/WeDevs_Insights.php @@ -2,7 +2,7 @@ namespace WeDevs\Wpuf\Lib; -if ( ! class_exists( 'WPUF_WeDevs_Insights' ) ) : +if ( ! class_exists( 'WeDevs_Insights' ) ) : /** * weDevs Tracker @@ -17,7 +17,7 @@ */ class WeDevs_Insights { /** - * @var object|Appsero\Insights|Insights + * @var object|Appsero\Insights */ public $insights; @@ -25,18 +25,10 @@ class WeDevs_Insights { * Initialize the class */ public function __construct( $file ) { - if ( ! class_exists( 'Appsero\Client' ) ) { - require_once WPUF_ROOT . '/Lib/Appsero/Client.php'; - } - $client = new Appsero\Client( '958afc63-99f8-4b98-b321-fcbc5cf95694', 'WP User Frontend', $file ); $this->insights = $client->insights(); $this->insights->client = $client; $this->insights->init(); - -// $client = new Appsero\Client( '958afc63-99f8-4b98-b321-fcbc5cf95694', 'WP User Frontend', $file ); -// $this->insights = $client->insights(); -// $this->insights->init(); } } diff --git a/includes/Ajax/Frontend_Form_Ajax.php b/includes/Ajax/Frontend_Form_Ajax.php index 734fc55cc..43c4f1fd4 100644 --- a/includes/Ajax/Frontend_Form_Ajax.php +++ b/includes/Ajax/Frontend_Form_Ajax.php @@ -19,10 +19,6 @@ class Frontend_Form_Ajax { private $expired_post_status = 'wpuf-expired_post_status'; private $post_expiration_message = 'wpuf-post_expiration_message'; - /** - * @var array - */ - private $form_fields; /** * @var array diff --git a/includes/Setup_Wizard.php b/includes/Setup_Wizard.php index 9c1d55468..02df40b71 100644 --- a/includes/Setup_Wizard.php +++ b/includes/Setup_Wizard.php @@ -37,8 +37,14 @@ public function __construct() { * @return void */ public function custom_admin_bar_styles() { - if ( is_admin_bar_showing() ) { + if ( ! is_admin_bar_showing() ) { + return; + } + + if ( function_exists( 'wp_enqueue_admin_bar_header_styles' ) ) { wp_enqueue_admin_bar_header_styles(); + } else { + wp_admin_bar_header(); } } diff --git a/includes/Traits/TaxableTrait.php b/includes/Traits/TaxableTrait.php index 476b976da..31745a3ca 100644 --- a/includes/Traits/TaxableTrait.php +++ b/includes/Traits/TaxableTrait.php @@ -384,11 +384,11 @@ function wpuf_tax_rate_country_state( $country, $state ) { continue; } if ( $rate['state'] === $state && $rate['country'] === $country ) { - $tax_amount = $rate['rate']; + $tax_amount = ! empty( $rate['rate'] ) ? $rate['rate'] : 0; } if ( intval( $tax_amount ) === 0 && $rate['country'] === $country && 'country_wide' === $rate['state'] ) { - $tax_amount = $rate['rate']; + $tax_amount = ! empty( $rate['rate'] ) ? $rate['rate'] : 0; } } diff --git a/languages/wp-user-frontend.pot b/languages/wp-user-frontend.pot index 680211bb5..73bc7385d 100644 --- a/languages/wp-user-frontend.pot +++ b/languages/wp-user-frontend.pot @@ -2,9 +2,9 @@ # This file is distributed under the GPL2 or later. msgid "" msgstr "" -"Project-Id-Version: WP User Frontend 4.0.11\n" +"Project-Id-Version: WP User Frontend 4.0.12\n" "Report-Msgid-Bugs-To: https://wedevs.com/contact/\n" -"POT-Creation-Date: 2024-09-17 09:28:09+00:00\n" +"POT-Creation-Date: 2024-10-10 16:29:53+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -97,65 +97,65 @@ msgstr "" msgid "WP User Frontend" msgstr "" -#: admin/class-admin-settings.php:87 includes/Admin/Menu.php:23 +#: admin/class-admin-settings.php:89 includes/Admin/Menu.php:23 msgid "User Frontend" msgstr "" -#: admin/class-admin-settings.php:89 includes/Admin/Menu.php:27 +#: admin/class-admin-settings.php:91 includes/Admin/Menu.php:27 #: includes/Admin/Menu.php:28 #: includes/Admin/views/post-forms-list-table-view.php:5 msgid "Post Forms" msgstr "" -#: admin/class-admin-settings.php:102 includes/Admin/Menu.php:48 +#: admin/class-admin-settings.php:104 includes/Admin/Menu.php:48 #: includes/Admin/Menu.php:49 msgid "Subscriptions" msgstr "" -#: admin/class-admin-settings.php:108 includes/Admin/Admin_Tools.php:370 +#: admin/class-admin-settings.php:110 includes/Admin/Admin_Tools.php:370 #: includes/Admin/Menu.php:58 #: includes/Admin/views/transactions-list-table-view.php:2 msgid "Transactions" msgstr "" -#: admin/class-admin-settings.php:111 includes/Admin/Menu.php:63 +#: admin/class-admin-settings.php:113 includes/Admin/Menu.php:63 #: includes/Admin/views/tools.php:7 msgid "Tools" msgstr "" -#: admin/class-admin-settings.php:116 includes/Admin/Menu.php:75 +#: admin/class-admin-settings.php:118 includes/Admin/Menu.php:75 msgid "Premium" msgstr "" -#: admin/class-admin-settings.php:118 includes/Admin/Menu.php:80 +#: admin/class-admin-settings.php:120 includes/Admin/Menu.php:80 msgid "Help" msgstr "" -#: admin/class-admin-settings.php:118 +#: admin/class-admin-settings.php:120 msgid "Help" msgstr "" -#: admin/class-admin-settings.php:119 admin/class-admin-settings.php:167 +#: admin/class-admin-settings.php:121 admin/class-admin-settings.php:169 #: admin/form-builder/views/form-builder.php:9 #: includes/Admin/Admin_Settings.php:68 includes/Admin/Menu.php:91 #: includes/Admin/Menu.php:358 includes/Setup_Wizard.php:154 msgid "Settings" msgstr "" -#: admin/class-admin-settings.php:121 includes/Admin/Admin_Subscription.php:285 +#: admin/class-admin-settings.php:123 includes/Admin/Admin_Subscription.php:285 #: includes/Admin/Menu.php:85 includes/Admin/views/subscribers.php:14 msgid "Subscribers" msgstr "" -#: admin/class-admin-settings.php:464 includes/Admin/Menu.php:199 +#: admin/class-admin-settings.php:466 includes/Admin/Menu.php:199 msgid "Number of items per page:" msgstr "" -#: admin/class-admin-settings.php:495 includes/Admin.php:75 +#: admin/class-admin-settings.php:497 includes/Admin.php:75 msgid "Post lock has been cleared" msgstr "" -#: admin/class-admin-settings.php:498 includes/Admin.php:79 +#: admin/class-admin-settings.php:500 includes/Admin.php:79 msgid "" "%sThis post contains a sensitive short-code %s, that may allow others to " "sign-up with distinguished roles. If unsure, remove the short-code before " @@ -163,37 +163,37 @@ msgid "" "vulnerability.%s" msgstr "" -#: admin/class-admin-settings.php:534 includes/Admin/Menu.php:315 +#: admin/class-admin-settings.php:536 includes/Admin/Menu.php:315 msgid "WPUF Import Forms" msgstr "" -#: admin/class-admin-settings.php:535 includes/Admin/Menu.php:316 +#: admin/class-admin-settings.php:537 includes/Admin/Menu.php:316 msgid "Add JSON file" msgstr "" -#: admin/class-admin-settings.php:536 includes/Admin/Menu.php:317 +#: admin/class-admin-settings.php:538 includes/Admin/Menu.php:317 msgid "Could not import forms." msgstr "" -#: admin/class-admin-settings.php:616 +#: admin/class-admin-settings.php:618 #: includes/Admin/Forms/Admin_Form_Handler.php:60 #: includes/Admin/Forms/Admin_Form_Handler.php:200 msgid "You do not have sufficient permissions to do this action" msgstr "" -#: admin/class-admin-settings.php:621 includes/Admin/Admin_Tools.php:463 +#: admin/class-admin-settings.php:623 includes/Admin/Admin_Tools.php:463 msgid "Missing file_id param" msgstr "" -#: admin/class-admin-settings.php:631 includes/Admin/Admin_Tools.php:474 +#: admin/class-admin-settings.php:633 includes/Admin/Admin_Tools.php:474 msgid "JSON file not found" msgstr "" -#: admin/class-admin-settings.php:640 includes/Admin/Admin_Tools.php:484 +#: admin/class-admin-settings.php:642 includes/Admin/Admin_Tools.php:484 msgid "Provided file is not a JSON file." msgstr "" -#: admin/class-admin-settings.php:657 includes/Admin/Admin_Tools.php:496 +#: admin/class-admin-settings.php:659 includes/Admin/Admin_Tools.php:496 msgid "Forms imported successfully." msgstr "" @@ -1014,8 +1014,10 @@ msgstr "" #: includes/Admin/Promotion.php:305 includes/Admin/Promotion.php:309 #: includes/Ajax/Admin_Form_Builder_Ajax.php:27 #: includes/Ajax/Admin_Form_Builder_Ajax.php:31 -#: includes/Ajax/Admin_Form_Builder_Ajax.php:82 +#: includes/Ajax/Admin_Form_Builder_Ajax.php:35 #: includes/Ajax/Admin_Form_Builder_Ajax.php:86 +#: includes/Ajax/Admin_Form_Builder_Ajax.php:90 +#: includes/Ajax/Admin_Form_Builder_Ajax.php:94 #: includes/Integrations/WPUF_ACF_Compatibility.php:76 #: includes/Integrations/WPUF_ACF_Compatibility.php:94 #: includes/Integrations/WPUF_ACF_Compatibility.php:160 @@ -4063,55 +4065,55 @@ msgstr "" msgid "form data is missing" msgstr "" -#: includes/Ajax/Admin_Form_Builder_Ajax.php:35 +#: includes/Ajax/Admin_Form_Builder_Ajax.php:39 msgid "Invalid form id" msgstr "" -#: includes/Ajax/Admin_Form_Builder_Ajax.php:90 +#: includes/Ajax/Admin_Form_Builder_Ajax.php:98 msgid "Invalid post type" msgstr "" -#: includes/Ajax/Admin_Form_Builder_Ajax.php:103 +#: includes/Ajax/Admin_Form_Builder_Ajax.php:111 msgid "Default " msgstr "" -#: includes/Ajax/Frontend_Form_Ajax.php:59 +#: includes/Ajax/Frontend_Form_Ajax.php:63 msgid "Minimum %d character is required for %s" msgstr "" -#: includes/Ajax/Frontend_Form_Ajax.php:67 +#: includes/Ajax/Frontend_Form_Ajax.php:71 msgid "Maximum %d character is allowed for %s" msgstr "" -#: includes/Ajax/Frontend_Form_Ajax.php:78 +#: includes/Ajax/Frontend_Form_Ajax.php:82 msgid "Minimum %d word is required for %s" msgstr "" -#: includes/Ajax/Frontend_Form_Ajax.php:86 +#: includes/Ajax/Frontend_Form_Ajax.php:90 msgid "Maximum %d word is allowed for %s" msgstr "" -#: includes/Ajax/Frontend_Form_Ajax.php:106 +#: includes/Ajax/Frontend_Form_Ajax.php:110 msgid "Using %s as shortcode is restricted" msgstr "" -#: includes/Ajax/Frontend_Form_Ajax.php:334 includes/Api/Subscription.php:264 +#: includes/Ajax/Frontend_Form_Ajax.php:338 includes/Api/Subscription.php:264 #: includes/Api/Subscription.php:294 includes/Api/Subscription.php:368 msgid "Something went wrong" msgstr "" -#: includes/Ajax/Frontend_Form_Ajax.php:406 -#: includes/Ajax/Frontend_Form_Ajax.php:412 +#: includes/Ajax/Frontend_Form_Ajax.php:410 +#: includes/Ajax/Frontend_Form_Ajax.php:416 msgid "" "Thank you for posting on our site. We have sent you an confirmation email. " "Please check your inbox!" msgstr "" -#: includes/Ajax/Frontend_Form_Ajax.php:482 +#: includes/Ajax/Frontend_Form_Ajax.php:486 msgid "Invalid email address." msgstr "" -#: includes/Ajax/Frontend_Form_Ajax.php:508 +#: includes/Ajax/Frontend_Form_Ajax.php:512 msgid "" "You already have an account in our site. Please login to continue.\n" "\n" @@ -4120,7 +4122,7 @@ msgid "" "Click 'Cancel' to stay at this page." msgstr "" -#: includes/Ajax/Frontend_Form_Ajax.php:562 +#: includes/Ajax/Frontend_Form_Ajax.php:566 #: includes/Frontend_Render_Form.php:216 #: includes/class-frontend-render-form.php:324 msgid "You do not have sufficient permissions to access this form." @@ -5704,52 +5706,52 @@ msgstr "" msgid "You are not the post author. Cheating huh!" msgstr "" -#: includes/Frontend/Frontend_Form.php:48 +#: includes/Frontend/Frontend_Form.php:51 msgid "You are not logged in" msgstr "" -#: includes/Frontend/Frontend_Form.php:58 -#: includes/Frontend/Frontend_Form.php:88 +#: includes/Frontend/Frontend_Form.php:61 +#: includes/Frontend/Frontend_Form.php:91 msgid "Invalid post" msgstr "" -#: includes/Frontend/Frontend_Form.php:65 +#: includes/Frontend/Frontend_Form.php:68 msgid "Your edit access for this post has been locked by an administrator." msgstr "" -#: includes/Frontend/Frontend_Form.php:69 +#: includes/Frontend/Frontend_Form.php:72 msgid "Your allocated time for editing this post has been expired." msgstr "" -#: includes/Frontend/Frontend_Form.php:77 +#: includes/Frontend/Frontend_Form.php:80 msgid "Your post edit access has been locked by an administrator." msgstr "" -#: includes/Frontend/Frontend_Form.php:82 +#: includes/Frontend/Frontend_Form.php:85 msgid "Post Editing is disabled" msgstr "" -#: includes/Frontend/Frontend_Form.php:93 +#: includes/Frontend/Frontend_Form.php:96 msgid "You are not allowed to edit" msgstr "" -#: includes/Frontend/Frontend_Form.php:104 +#: includes/Frontend/Frontend_Form.php:107 msgid "I don't know how to edit this post, I don't have the form ID" msgstr "" -#: includes/Frontend/Frontend_Form.php:117 +#: includes/Frontend/Frontend_Form.php:120 msgid "You can't edit a post while in pending mode." msgstr "" -#: includes/Frontend/Frontend_Form.php:121 +#: includes/Frontend/Frontend_Form.php:124 msgid "You're not allowed to edit this post." msgstr "" -#: includes/Frontend/Frontend_Form.php:278 +#: includes/Frontend/Frontend_Form.php:281 msgid "Post Saved" msgstr "" -#: includes/Frontend/Frontend_Form.php:367 +#: includes/Frontend/Frontend_Form.php:373 msgid "Email successfully verified. Please Login." msgstr "" @@ -5959,13 +5961,13 @@ msgstr "" msgid "Please Cancel Your Currently Active Pack first!" msgstr "" -#: includes/Frontend_Render_Form.php:300 +#: includes/Frontend_Render_Form.php:299 #: includes/class-frontend-render-form.php:910 #: templates/dashboard/posts.php:120 msgid "Featured" msgstr "" -#: includes/Frontend_Render_Form.php:305 +#: includes/Frontend_Render_Form.php:304 #: includes/class-frontend-render-form.php:915 msgid "Mark the %s as featured (remaining %d)" msgstr "" @@ -7330,7 +7332,7 @@ msgstr "" msgid "You have created %d (%s)" msgstr "" -#: templates/dokan/new-post.php:7 templates/wc-marketplace/new-post.php:7 +#: templates/dokan/new-post.php:6 templates/wc-marketplace/new-post.php:7 #: templates/wc-vendors/new-post.php:7 msgid "You are not allowed to submit post. Please contact admin" msgstr "" @@ -7684,11 +7686,11 @@ msgstr "" msgid " or greater." msgstr "" -#: wpuf.php:240 +#: wpuf.php:241 msgid "Your WP User Frontend Pro is almost ready!" msgstr "" -#: wpuf.php:244 +#: wpuf.php:245 #. translators: 1: opening anchor tag, 2: closing anchor tag. msgid "" "We've pushed a major update on both WP User Frontend Free and WP " diff --git a/temp.svg b/temp.svg deleted file mode 100644 index afbd87342..000000000 --- a/temp.svg +++ /dev/null @@ -1,5 +0,0 @@ - - menu - -