PATH:
home
/
letacommog
/
laindinois
/
wp-content
/
plugins
/
wiloke-listing-tools
/
app
/
Middleware
<?php namespace WilokeListingTools\Middleware; use WilokeListingTools\Framework\Helpers\GetSettings; use WilokeListingTools\Framework\Helpers\GetWilokeSubmission; use WilokeListingTools\Framework\Routing\InterfaceMiddleware; use WilokeListingTools\Frontend\User; use WilokeListingTools\Models\PlanRelationshipModel; class IsExceededFreePlan implements InterfaceMiddleware { public $msg = ''; public function handle( array $aOptions ) { if ( GetWilokeSubmission::getField('add_listing_mode') == 'free_add_listing' ){ return true; } if ( isset($aOptions['listingID']) && !empty($aOptions['listingID']) ){ $postStatus = get_post_status($aOptions['listingID']); if ( $postStatus != 'unpaid' ){ return true; } } $aPlanSettings = GetSettings::getPlanSettings($aOptions['planID']); if ( empty($aPlanSettings['availability_items']) || !empty($aPlanSettings['regular_price']) ){ return true; } $userID = isset($aOptions['userID']) ? $aOptions['userID'] : User::getCurrentUserID(); $totalListingsSubmitted = PlanRelationshipModel::countListingsUserSubmittedInPlan($aOptions['planID'], $userID); if ( $totalListingsSubmitted >= abs($aPlanSettings['availability_items']) ){ $this->msg = esc_html__('Oops! You exceeded the number of free listings of this plan', 'wiloke-listing-tools'); return false; } return true; } }
[+]
..
[-] IAgreeToPrivacyPolicy.php
[edit]
[-] DesignListingRoles.php
[edit]
[-] BeforeSubmitMessage.php
[edit]
[-] IsReviewExists.php
[edit]
[-] IsAccountConfirmed.php
[edit]
[-] CanSubmissionListing.php
[edit]
[-] IsThemeOptionSupport.php
[edit]
[-] IsListingBeingReviewed.php
[edit]
[-] CanRegister.php
[edit]
[-] VerifyPaymentID.php
[edit]
[-] IsUserLoggedIn.php
[edit]
[-] IsSupportedPostTypeAddListing.php
[edit]
[-] IsUserBeBanned.php
[edit]
[-] ValidateGoogleReCaptcha.php
[edit]
[-] IsClaimAvailable.php
[edit]
[-] IsMyPaymentSession.php
[edit]
[-] IsExceededFreePlan.php
[edit]
[-] VerifyReview.php
[edit]
[-] AddListingValidation.php
[edit]
[-] IsAdministrator.php
[edit]
[-] IAgreeToTerms.php
[edit]
[-] IsGatewaySupported.php
[edit]
[-] IsLockedAddListing.php
[edit]
[-] IsPlanExists.php
[edit]
[-] IsOwnerOfPost.php
[edit]
[-] IsExceededMaximumListingInRecurringPlan.php
[edit]
[-] IsSetupThankyouCancelUrl.php
[edit]
[-] IsWilokeShortcodeActivated.php
[edit]
[-] IsTemporaryHiddenPost.php
[edit]
[-] IsReviewEnabled.php
[edit]
[-] IsPublishedPost.php
[edit]
[-] IsPassedPostAuthor.php
[edit]
[-] IsCurrentPlanAvailable.php
[edit]
[-] IsPublishingListing.php
[edit]
[-] IsPostType.php
[edit]
[-] VerifyDirectBankTransfer.php
[edit]
[-] VerifyNonce.php
[edit]
[-] ValidationBeforeSetUserPlan.php
[edit]
[-] IsListingPostType.php
[edit]
[-] AddressRequired.php
[edit]
[-] IsPostAuthor.php
[edit]
[-] IsAllowEditingPublishedListing.php
[edit]