scanner/issue-wfPluginRemoved.php000064400000006114147206765060013170 0ustar00 'wfPluginRemoved', 'displayType' => __('Plugin Removed', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreC' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Plugin Name', 'wordfence') => '${data.Name}', __('Current Plugin Version', 'wordfence') => '${data.Version}', null, __('Details', 'wordfence') => '{{html longMsg}}', null, __('Plugin URL', 'wordfence') => array('data.PluginURI', '${data.PluginURI}' . __('View', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . ')'), __('Vulnerability Information', 'wordfence') => array('data.vulnerabilityLink', '${data.vulnerabilityLink}' . __('View', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . ')'), __('Vulnerability Severity', 'wordfence') => array('data.cvssScore', '${data.cvssScore}/10.0 (${data.severityLabel})'), ), 'detailControls' => array( '' . __('Mark as Fixed', 'wordfence') . '', '' . __('Manage Plugins', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Plugin Name', 'wordfence') => '$data.Name', __('Current Plugin Version', 'wordfence') => '$data.Version', null, __('Details', 'wordfence') => '$longMsg', null, __('Plugin URL', 'wordfence') => '$data.PluginURI', __('Vulnerability Information', 'wordfence') => '$data.vulnerabilityLink', __('Vulnerability Severity', 'wordfence') => '${data.cvssScore}/10.0 (${data.severityLabel})', ), ))->render(); scanner/issue-wfPluginAbandoned.php000064400000007526147206765060013452 0ustar00 'wfPluginAbandoned', 'displayType' => __('Plugin Abandoned', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreC' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Plugin Name', 'wordfence') => '${data.name}', __('Current Plugin Version', 'wordfence') => '${data.version}', __('Last Updated', 'wordfence') => '${data.dateUpdated}', null, __('Details', 'wordfence') => '{{if data.vulnerable}}' . esc_html__('Plugin has unpatched security issues.', 'wordfence') . '
{{/if}}{{html longMsg}}', null, __('Plugin URL', 'wordfence') => array('data.homepage', '${data.homepage}' . __('View', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . ')'), __('Repository URL', 'wordfence') => array('data.wpURL', '${data.wpURL}' . __('View', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . ')'), __('Vulnerability Information', 'wordfence') => array('data.vulnerabilityLink', '${data.vulnerabilityLink}' . __('View', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . ')'), __('Vulnerability Severity', 'wordfence') => array('data.cvssScore', '${data.cvssScore}/10.0 (${data.severityLabel})'), ), 'detailControls' => array( '' . __('Mark as Fixed', 'wordfence') . '', '' . __('Manage Plugins', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Plugin Name', 'wordfence') => '$data.name', __('Current Plugin Version', 'wordfence') => '$data.version', __('Last Updated', 'wordfence') => '$data.dateUpdated', null, __('Details', 'wordfence') => '$longMsg', __('Vulnerability Status', 'wordfence') => array('$data.vulnerable', __('Plugin has unpatched security issues.', 'wordfence')), null, __('Plugin URL', 'wordfence') => '$data.homepage', __('Repository URL', 'wordfence') => '$data.wpURL', __('Vulnerability Information', 'wordfence') => '$data.vulnerabilityLink', __('Vulnerability Severity', 'wordfence') => '${data.cvssScore}/10.0 (${data.severityLabel})', ), ))->render();scanner/issue-control-edit-user.php000064400000002140147206765060013425 0ustar00 scanner/site-cleaning.php000064400000022170147206765060011447 0ustar00 scanner/issue-postBadTitle.php000064400000004105147206765060012447 0ustar00 'postBadTitle', 'displayType' => __('Post', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-edit-post'), wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Always Ignore', 'wordfence'), 'ignoreC' => __('Ignore Only this Title', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Title', 'wordfence') => '${data.postTitle}', __('Posted on', 'wordfence') => '${data.postDate}', null, __('Details', 'wordfence') => '{{html longMsg}}', null, __('Multisite Blog ID', 'wordfence') => array('data.isMultisite', '${data.blog_id}'), __('Multisite Blog Domain', 'wordfence') => array('data.isMultisite', '${data.domain}'), __('Multisite Blog Path', 'wordfence') => array('data.isMultisite', '${data.path}'), ), 'detailControls' => array( '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Title', 'wordfence') => '$data.postTitle', __('Posted on', 'wordfence') => '$data.postDate', null, __('Details', 'wordfence') => '$longMsg', null, __('Multisite Blog ID', 'wordfence') => array('$data.isMultisite', '$data.blog_id'), __('Multisite Blog Domain', 'wordfence') => array('$data.isMultisite', '$data.domain'), __('Multisite Blog Path', 'wordfence') => array('$data.isMultisite', '$data.path'), ), ))->render();scanner/issue-easyPassword.php000064400000004256147206765060012544 0ustar00 'easyPassword', 'displayType' => __('Insecure Password', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-edit-user'), wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore All for User', 'wordfence'), 'ignoreC' => __('Ignore Only this Password', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Login Name', 'wordfence') => '${data.user_login}', __('User Email', 'wordfence') => '${data.user_email}', __('Full Name', 'wordfence') => '${data.first_name} ${data.last_name}', null, __('Details', 'wordfence') => '{{html longMsg}}', ), 'detailControls' => array( '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Login Name', 'wordfence') => '$data.user_login', __('User Email', 'wordfence') => '$data.user_email', __('Full Name', 'wordfence') => '$data.first_name $data.last_name', null, __('Details', 'wordfence') => '$longMsg', ), ))->render();scanner/options-group-basic.php000064400000002605147206765060012632 0ustar00
$scanner, ))->render(); ?>
scanner/issue-knownfile.php000064400000005741147206765060012054 0ustar00 'knownfile', 'displayType' => __('File', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-repair'), wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Always Ignore', 'wordfence'), 'ignoreC' => __('Ignore Until File Changes', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Filename', 'wordfence') => '${data.realFile}', __('File Type', 'wordfence') => '{{if data.cType}}${WFAD.ucfirst(data.cType)}{{else}}' . __('Not a core, theme, or plugin file from wordpress.org', 'wordfence') . '.{{/if}}', __('Bad URL', 'wordfence') => array('(typeof data.badURL !== \'undefined\') && data.badURL', '${data.badURL}'), null, __('Details', 'wordfence') => '{{html longMsg}}', ), 'detailControls' => array( '{{if data.fileExists}}' . __('View File', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . '){{/if}}', '{{if data.canDiff}}' . __('View Differences', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . '){{/if}}', '{{if data.canDelete}}' . __('Delete File', 'wordfence') . '{{/if}}', '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Filename', 'wordfence') => '$data.realFile', __('File Type', 'wordfence') => '$data.ucType', __('File Type', 'wordfence') => array('!$data.ucType', 'Not a core, theme, or plugin file from wordpress.org'), __('Bad URL', 'wordfence') => '$data.badURL', null, __('Details', 'wordfence') => '$longMsg', ), ))->render();scanner/issue-wfThemeUpgrade.php000064400000007122147206765060012762 0ustar00 'wfThemeUpgrade', 'displayType' => __('Theme Upgrade', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreC' => __('Ignore ', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Theme Name', 'wordfence') => '${data.name}', __('Current Theme Version', 'wordfence') => '${data.version}', __('New Theme Version', 'wordfence') => '${data.newVersion}', null, __('Details', 'wordfence') => '{{if data.vulnerable}}' . esc_html__('Update includes security-related fixes.', 'wordfence') . '
{{/if}}{{html longMsg}}
' . esc_html__('Click here to update now', 'wordfence') . '.', null, __('Theme URL', 'wordfence') => '${data.URL}' . __('View', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . ')', __('Vulnerability Information', 'wordfence') => array('data.vulnerabilityLink', '${data.vulnerabilityLink}' . __('View', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . ')'), __('Vulnerability Severity', 'wordfence') => array('data.cvssScore', '${data.cvssScore}/10.0 (${data.severityLabel})'), ), 'detailControls' => array( '' . __('Mark as Fixed', 'wordfence') . '', '' . __('View Updates', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Theme Name', 'wordfence') => '$data.name', __('Current Theme Version', 'wordfence') => '$data.version', __('New Theme Version', 'wordfence') => '$data.newVersion', null, __('Details', 'wordfence') => '$longMsg', __('Vulnerability Status', 'wordfence') => array('$data.vulnerable', __('Update includes security-related fixes.', 'wordfence')), null, __('Theme URL', 'wordfence') => '$data.URL', __('Vulnerability Information', 'wordfence') => '$data.vulnerabilityLink', __('Vulnerability Severity', 'wordfence') => '${data.cvssScore}/10.0 (${data.severityLabel})', ), ))->render();scanner/issue-optionBadURL.php000064400000004103147206765060012351 0ustar00 'optionBadURL', 'displayType' => __('URL', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreC' => __('Ignore URL', 'wordfence'), 'ignoreP' => __('Ignore Option', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Option Name', 'wordfence') => '${data.optionKey}', __('Bad URL', 'wordfence') => '${data.badURL}', null, __('Details', 'wordfence') => '{{html longMsg}}', null, __('Multisite Blog ID', 'wordfence') => array('data.isMultisite', '${data.blog_id}'), __('Multisite Blog Domain', 'wordfence') => array('data.isMultisite', '${data.domain}'), __('Multisite Blog Path', 'wordfence') => array('data.isMultisite', '${data.path}'), ), 'detailControls' => array( '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Option Name', 'wordfence') => '$data.optionKey', __('Bad URL', 'wordfence') => '$data.badURL', null, __('Details', 'wordfence') => '$longMsg', null, __('Multisite Blog ID', 'wordfence') => array('$data.isMultisite', '$data.blog_id'), __('Multisite Blog Domain', 'wordfence') => array('$data.isMultisite', '$data.domain'), __('Multisite Blog Path', 'wordfence') => array('$data.isMultisite', '$data.path'), ), ))->render();scanner/issue-control-ignore.php000064400000004211147206765060013010 0ustar00 {{if status == 'new'}}{{else}}{{/if}} scanner/issue-database.php000064400000004167147206765060011625 0ustar00 'database', 'displayType' => __('Option', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreC' => __('Ignore Value', 'wordfence'), 'ignoreP' => __('Ignore Option', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Option Name', 'wordfence') => '${data.option_name}', __('Bad URL', 'wordfence') => array('(typeof data.badURL !== \'undefined\') && data.badURL', '${data.badURL}'), null, __('Details', 'wordfence') => '{{html longMsg}}', ), 'detailControls' => array( '{{if data.optionExists}}' . __('View Option', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . '){{/if}}', '{{if data.canDelete}}' . __('Delete Option', 'wordfence') . '{{/if}}', '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Option Name', 'wordfence') => '$data.option_name', __('Bad URL', 'wordfence') => '$data.badURL', null, __('Details', 'wordfence') => '$longMsg', ), ))->render();scanner/site-cleaning-bottom.php000064400000004043147206765060012750 0ustar00
scanner/issue-control-show-details.php000064400000003705147206765060014137 0ustar00 scanner/scan-progress-detailed.php000064400000005636147206765060013274 0ustar00
scanner/issue-spamvertizeCheck.php000064400000002502147206765060013357 0ustar00 'spamvertizeCheck', 'displayType' => __('Spam', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Details', 'wordfence') => '{{html longMsg}}', ), 'detailControls' => array( '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Details', 'wordfence') => '$longMsg', ), ))->render();scanner/issue-postBadURL.php000064400000006277147206765060012044 0ustar00 'postBadURL', 'displayType' => __('URL', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-edit-post'), wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Always Ignore', 'wordfence'), 'ignoreC' => __('Ignore this URL', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Title', 'wordfence') => '${data.postTitle}', __('Bad URL', 'wordfence') => '${data.badURL}', __('Posted on', 'wordfence') => '${data.postDate}', null, __('Details', 'wordfence') => '{{html longMsg}}', null, __('Multisite Blog ID', 'wordfence') => array('data.isMultisite', '${data.blog_id}'), __('Multisite Blog Domain', 'wordfence') => array('data.isMultisite', '${data.domain}'), __('Multisite Blog Path', 'wordfence') => array('data.isMultisite', '${data.path}'), ), 'detailControls' => array( '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Title', 'wordfence') => '$data.postTitle', __('Bad URL', 'wordfence') => '$data.badURL', __('Posted on', 'wordfence') => '$data.postDate', null, __('Details', 'wordfence') => '$longMsg', null, __('Multisite Blog ID', 'wordfence') => array('$data.isMultisite', '$data.blog_id'), __('Multisite Blog Domain', 'wordfence') => array('$data.isMultisite', '$data.domain'), __('Multisite Blog Path', 'wordfence') => array('$data.isMultisite', '$data.path'), ), ))->render();scanner/issue-checkHowGetIPs.php000064400000003021147206765060012654 0ustar00 'checkHowGetIPs', 'displayType' => __('IP Detection', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Details', 'wordfence') => '{{html longMsg}}', ), 'detailControls' => array( '' . __('Use Recommended Value', 'wordfence') . '', '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Details', 'wordfence') => '$longMsg', ), ))->render();scanner/no-issues.php000064400000002156147206765060010654 0ustar00 scanner/scan-scheduling.php000064400000043264147206765060012003 0ustar00
  • 'scheduledScansEnabled', 'value' => wfConfig::get('scheduledScansEnabled') ? '1': '0', 'title' => __('Schedule Wordfence Scans', 'wordfence'), 'states' => array( array('value' => '0', 'label' => __('Disabled', 'wordfence')), array('value' => '1', 'label' => __('Enabled', 'wordfence')), ), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_SCHEDULING), ))->render(); ?>
  • scanner/issue-commentBadURL.php000064400000006140147206765060012506 0ustar00 'commentBadURL', 'displayType' => __('URL', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-edit-comment'), wfView::create('scanner/issue-control-ignore'), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Author', 'wordfence') => '${data.author}', __('Bad URL', 'wordfence') => '${data.badURL}', __('Posted on', 'wordfence') => '${data.commentDate}', null, __('Details', 'wordfence') => '{{html longMsg}}', null, __('Multisite Blog ID', 'wordfence') => array('data.isMultisite', '${data.blog_id}'), __('Multisite Blog Domain', 'wordfence') => array('data.isMultisite', '${data.domain}'), __('Multisite Blog Path', 'wordfence') => array('data.isMultisite', '${data.path}'), ), 'detailControls' => array( '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Author', 'wordfence') => '$data.author', __('Bad URL', 'wordfence') => '$data.badURL', __('Posted on', 'wordfence') => '$data.commentDate', null, __('Details', 'wordfence') => '$longMsg', null, __('Multisite Blog ID', 'wordfence') => array('$data.isMultisite', '$data.blog_id'), __('Multisite Blog Domain', 'wordfence') => array('$data.isMultisite', '$data.domain'), __('Multisite Blog Path', 'wordfence') => array('$data.isMultisite', '$data.path'), ), ))->render();scanner/scan-starter.php000064400000003526147206765060011337 0ustar00
    scanner/options-group-performance.php000064400000010175147206765060014053 0ustar00
      'lowResourceScansEnabled', 'label' => __('Use low resource scanning (reduces server load by lengthening the scan duration)', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_LOW_RESOURCE)), array('key' => 'scan_maxIssues', 'label' => __('Limit the number of issues sent in the scan results email', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_LIMIT_ISSUES), 'view' => 'options/option-text', 'parameters' => array('subtitle' => __('0 or empty means unlimited issues will be sent', 'wordfence'))), array('key' => 'scan_maxDuration', 'label' => __('Time limit that a scan can run in seconds', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_OVERALL_TIME_LIMIT), 'view' => 'options/option-text', 'parameters' => array('subtitle' => sprintf(/* translators: Time until. */ __('0 or empty means the default of %s will be used', 'wordfence'), wfUtils::makeDuration(WORDFENCE_DEFAULT_MAX_SCAN_TIME)))), array('key' => 'maxMem', 'label' => __('How much memory should Wordfence request when scanning', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_MEMORY_LIMIT), 'view' => 'options/option-text', 'parameters' => array('subtitle' => __('Memory size in megabytes', 'wordfence'))), array('key' => 'maxExecutionTime', 'label' => __('Maximum execution time for each scan stage ', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_STAGE_TIME_LIMIT), 'view' => 'options/option-text', 'parameters' => array('subtitle' => sprintf(/* translators: PHP max execution time (number). */ __('0 for default. Must be %d or greater and 10-20 or higher is recommended for most servers', 'wordfence'), intval(WORDFENCE_SCAN_MIN_EXECUTION_TIME)))), ); foreach ($options as $o): ?>
    • $o['key'], 'textValue' => wfConfig::get($o['key']), 'title' => $o['label'], 'helpLink' => $o['helpLink'], ), $o['parameters']))->render(); } else { echo wfView::create('options/option-toggled', array( 'optionName' => $o['key'], 'enabledValue' => 1, 'disabledValue' => 0, 'value' => wfConfig::get($o['key']) ? 1 : 0, 'title' => $o['label'], 'helpLink' => $o['helpLink'], 'disabled' => isset($o['disabled']) ? $o['disabled'] : false, ))->render(); } ?>
    scanner/issue-wfPluginVulnerable.php000064400000006023147206765060013665 0ustar00 'wfPluginVulnerable', 'displayType' => __('Plugin Vulnerable', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreC' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Plugin Name', 'wordfence') => '${data.Name}', __('Current Plugin Version', 'wordfence') => '${data.Version}', null, __('Details', 'wordfence') => '{{html longMsg}}', null, __('Repository URL', 'wordfence') => array('data.wpURL', '${data.wpURL}' . __('View', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . ')'), __('Vulnerability Information', 'wordfence') => array('data.vulnerabilityLink', '${data.vulnerabilityLink}' . __('View', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . ')'), __('Vulnerability Severity', 'wordfence') => array('data.cvssScore', '${data.cvssScore}/10.0 (${data.severityLabel})'), ), 'detailControls' => array( '' . __('Mark as Fixed', 'wordfence') . '', '' . __('Manage Plugins', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Plugin Name', 'wordfence') => '$data.Name', __('Current Plugin Version', 'wordfence') => '$data.Version', null, __('Details', 'wordfence') => '$longMsg', null, __('Vulnerability Information', 'wordfence') => '$data.vulnerabilityLink', __('Vulnerability Severity', 'wordfence') => '${data.cvssScore}/10.0 (${data.severityLabel})', ), ))->render();scanner/issue-control-edit-comment.php000064400000000674147206765060014123 0ustar00 scanner/options-group-general.php000064400000017567147206765060013203 0ustar00
      'scansEnabled_checkGSB', 'label' => __('Check if this website is on a domain blocklist', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_CHECK_SITE_BLACKLISTED), 'premium' => true, 'subtitleHTML' => wp_kses(__('Reputation check', 'wordfence'), array('em'=>array()))), array('key' => 'spamvertizeCheck', 'label' => __('Check if this website is being "Spamvertised"', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_CHECK_SITE_SPAMVERTIZED), 'premium' => true, 'subtitleHTML' => wp_kses(__('Reputation check', 'wordfence'), array('em'=>array()))), array('key' => 'checkSpamIP', 'label' => __('Check if this website IP is generating spam', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_CHECK_IP_SPAMMING), 'premium' => true, 'subtitleHTML' => wp_kses(__('Reputation check', 'wordfence'), array('em'=>array()))), array('key' => 'scansEnabled_checkHowGetIPs', 'label' => __('Scan for misconfigured How does Wordfence get IPs', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_CHECK_MISCONFIGURED_HOW_GET_IPS)), array('key' => 'scansEnabled_checkReadableConfig', 'label' => __('Scan for publicly accessible configuration, backup, or log files', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_PUBLIC_CONFIG)), array('key' => 'scansEnabled_suspectedFiles', 'label' => __('Scan for publicly accessible quarantined files', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_PUBLIC_QUARANTINED)), array('key' => 'scansEnabled_core', 'label' => __('Scan core files against repository versions for changes', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_CORE_CHANGES)), array('key' => 'scansEnabled_themes', 'label' => __('Scan theme files against repository versions for changes', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_THEME_CHANGES)), array('key' => 'scansEnabled_plugins', 'label' => __('Scan plugin files against repository versions for changes', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_PLUGIN_CHANGES)), array('key' => 'scansEnabled_coreUnknown', 'label' => __('Scan wp-admin and wp-includes for files not bundled with WordPress', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_UNKNOWN_CORE)), array('key' => 'scansEnabled_malware', 'label' => __('Scan for signatures of known malicious files', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_MALWARE_HASHES)), array('key' => 'scansEnabled_fileContents', 'label' => __('Scan file contents for backdoors, trojans and suspicious code', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_MALWARE_SIGNATURES)), array('key' => 'scansEnabled_fileContentsGSB', 'label' => __('Scan file contents for malicious URLs', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_MALWARE_URLS)), array('key' => 'scansEnabled_posts', 'label' => __('Scan posts for known dangerous URLs and suspicious content', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_POST_URLS)), array('key' => 'scansEnabled_comments', 'label' => __('Scan comments for known dangerous URLs and suspicious content', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_COMMENT_URLS)), array('key' => 'scansEnabled_suspiciousOptions', 'label' => __('Scan WordPress core, plugin, and theme options for known dangerous URLs and suspicious content', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_MALWARE_OPTIONS)), array('key' => 'scansEnabled_oldVersions', 'label' => __('Scan for out of date, abandoned, and vulnerable plugins, themes, and WordPress versions', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_UPDATES)), array('key' => 'scansEnabled_suspiciousAdminUsers', 'label' => __('Scan for suspicious admin users created outside of WordPress', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_UNKNOWN_ADMINS)), array('key' => 'scansEnabled_passwds', 'label' => __('Check the strength of passwords', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_PASSWORD_STRENGTH)), array('key' => 'scansEnabled_diskSpace', 'label' => __('Monitor disk space', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_DISK_SPACE)), array('key' => 'scansEnabled_wafStatus', 'label' => __('Monitor Web Application Firewall status', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_WAF_STATUS)), array('key' => 'other_scanOutside', 'label' => __('Scan files outside your WordPress installation', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_OUTSIDE_WORDPRESS)), array('key' => 'scansEnabled_scanImages', 'label' => __('Scan images, binary, and other files as if they were executable', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_IMAGES_EXECUTABLE)), ); foreach ($options as $o): ?>
    • $o['key'], 'value' => wfConfig::get($o['key']) ? 1 : 0, 'title' => $o['label'], 'helpLink' => $o['helpLink'], 'premium' => isset($o['premium']) && $o['premium'], ))->render(); } else { echo wfView::create('options/option-toggled', array( 'optionName' => $o['key'], 'enabledValue' => 1, 'disabledValue' => 0, 'value' => wfConfig::get($o['key']) ? 1 : 0, 'title' => $o['label'], 'subtitleHTML' => isset($o['subtitleHTML']) ? $o['subtitleHTML'] : null, 'helpLink' => $o['helpLink'], 'premium' => isset($o['premium']) && $o['premium'], ))->render(); } ?>
    scanner/issue-diskSpace.php000064400000003704147206765060011763 0ustar00 'diskSpace', 'displayType' => __('Disk Space', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Space Remaining', 'wordfence') => '${data.spaceLeft}', null, __('Details', 'wordfence') => '{{html longMsg}}', ), 'detailControls' => array( '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Space Remaining', 'wordfence') => '$data.spaceLeft', null, __('Details', 'wordfence') => '$longMsg', ), ))->render();scanner/site-cleaning-beta-sigs.php000064400000021131147206765060013317 0ustar00 scanner/issue-control-edit-post.php000064400000001156147206765060013442 0ustar00 scanner/issue-wfUpgradeError.php000064400000002636147206765060013016 0ustar00 'wfUpgradeError', 'displayType' => __('Update Check Error', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreC' => __('Ignore Update', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Details', 'wordfence') => '{{html longMsg}}', ), 'detailControls' => array( '' . __('Mark as Fixed', 'wordfence') . '', '' . __('View Updates', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Details', 'wordfence') => '$longMsg', ), ))->render(); scanner/scanner-status.php000064400000007757147206765060011715 0ustar00 scanner/issue-configReadable.php000064400000004042147206765060012736 0ustar00 'configReadable', 'displayType' => __('Publicly Accessible Config/Backup/Log', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-hide-file'), wfView::create('scanner/issue-control-ignore', array('ignoreC' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('URL', 'wordfence') => '${data.url} (' . esc_html__('opens in new tab', 'wordfence') . ')', null, __('Details', 'wordfence') => '{{html longMsg}}' ), 'detailControls' => array( '{{if data.fileExists}}' . __('View File', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . '){{/if}}', '{{if data.canDelete}}' . __('Delete File', 'wordfence') . '{{/if}}', '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('URL', 'wordfence') => '$data.url', null, __('Details', 'wordfence') => '$longMsg', ), ))->render();scanner/scan-results.php000064400000020437147206765060011354 0ustar00getDeleteableIssueCount(); $hasRepairableIssue = !!$issues->getFixableIssueCount(); $tabs = array( new wfTab('new', 'new', __('Results Found', 'wordfence'), ''), new wfTab('ignored', 'ignored', __('Ignored Results', 'wordfence'), ''), ) ?> scanner/options-group-advanced.php000064400000007201147206765060013313 0ustar00
    • 'scan_exclude', 'textValue' => wfUtils::cleanupOneEntryPerLine(wfConfig::get('scan_exclude')), 'title' => __('Exclude files from scan that match these wildcard patterns (one per line)', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_EXCLUDE_PATTERNS), 'noSpacer' => true, ))->render(); ?>
    • 'scan_include_extra', 'textValue' => wfConfig::get('scan_include_extra'), 'title' => __('Additional scan signatures (one per line)', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_CUSTOM_MALWARE_SIGNATURES), 'noSpacer' => true, ))->render(); ?>
    • 'scan_force_ipv4_start', 'enabledValue' => 1, 'disabledValue' => 0, 'value' => wfConfig::get('scan_force_ipv4_start') ? 1 : 0, 'title' => __('Use only IPv4 to start scans', 'wordfence'), 'subtitle' => __('This option requires cURL. (This may have no effect on some old PHP or cURL versions.)', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_USE_ONLY_IPV4), 'premium' => false, 'disabled' => !wfUtils::isCurlSupported() ))->render(); ?>
    • $number, 'label' => $number > 0 ? $number : '0 (Disabled)'); } echo wfView::create('options/option-select', array( 'selectOptionName' => 'scan_max_resume_attempts', 'selectOptions' => $options, 'selectValue' => wfConfig::get('scan_max_resume_attempts', wfScanMonitor::DEFAULT_RESUME_ATTEMPTS), 'title' => __('Maximum number of attempts to resume each scan stage', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_SCAN_OPTION_MAX_RESUME_ATTEMPTS), ))->render(); ?>
    scanner/scan-progress.php000064400000005540147206765060011515 0ustar00stageStatus(); ?> scanner/issue-wfPluginUpgrade.php000064400000007771147206765060013170 0ustar00 'wfPluginUpgrade', 'displayType' => __('Plugin Upgrade', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreC' => __('Ignore Update', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Plugin Name', 'wordfence') => '${data.Name}', __('Current Plugin Version', 'wordfence') => '${data.Version}', __('New Plugin Version', 'wordfence') => '${data.newVersion}', null, __('Details', 'wordfence') => '{{if data.vulnerable}}' . esc_html__('Update includes security-related fixes.', 'wordfence') . '
    {{/if}}{{html longMsg}}
    ' . esc_html__('Click here to update now', 'wordfence') . '.', null, __('Plugin URL', 'wordfence') => array('data.PluginURI', '${data.PluginURI}' . __('View', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . ')'), __('Changelog', 'wordfence') => array('data.wpURL', '${data.wpURL}/#developers' . __('View', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . ')'), __('Vulnerability Information', 'wordfence') => array('data.vulnerabilityLink', '${data.vulnerabilityLink}' . __('View', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . ')'), __('Vulnerability Severity', 'wordfence') => array('data.cvssScore', '${data.cvssScore}/10.0 (${data.severityLabel})'), ), 'detailControls' => array( '' . __('Mark as Fixed', 'wordfence') . '', '' . __('View Updates', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Plugin Name', 'wordfence') => '$data.Name', __('Current Plugin Version', 'wordfence') => '$data.Version', __('New Plugin Version', 'wordfence') => '$data.newVersion', null, __('Details', 'wordfence') => '$longMsg', __('Vulnerability Status', 'wordfence') => array('$data.vulnerable', __('Update includes security-related fixes.', 'wordfence')), null, __('Plugin URL', 'wordfence') => '$data.PluginURI', __('Repository URL', 'wordfence') => '$data.wpURL', __('Vulnerability Information', 'wordfence') => '$data.vulnerabilityLink', __('Vulnerability Severity', 'wordfence') => '${data.cvssScore}/10.0 (${data.severityLabel})', ), ))->render(); scanner/options-group-scan-schedule.php000064400000002655147206765060014274 0ustar00
      $scanner, ))->render(); ?>
    scanner/issue-base.php000064400000020767147206765060010777 0ustar00 $value) { if ($value === null) { echo "\n"; continue; } unset($conditional); if (is_array($value)) { $conditional = $value[0]; if (!is_array($conditional)) { $conditional = array($conditional); } $value = $value[1]; } $allow = true; if (isset($conditional)) { foreach ($conditional as $test) { if (!$allow) { break; } if (preg_match('/^!?\$(\S+)/', $test, $matches)) { $invert = (strpos($test, '!') === 0); $components = explode('.', $matches[1]); $tier = $textOutput; foreach ($components as $index => $c) { if (is_array($tier) && !isset($tier[$c])) { if (!$invert) { $allow = false; } break; } if ($index == count($components) - 1 && is_array($tier)) { if ((!$tier[$c] && !$invert) || ($tier[$c] && $invert)) { $allow = false; } break; } else if (!is_array($tier)) { $allow = false; break; } $tier = $tier[$c]; } } } } if (!$allow) { continue; } if (preg_match_all('/(?<=^|\s)\$(\S+)(?=$|\s)/', $value, $matches, PREG_OFFSET_CAPTURE)) { array_shift($matches); $matches = $matches[0]; $matches = array_reverse($matches); foreach ($matches as $m) { $resolvedKeyPath = ''; $components = explode('.', $m[0]); $tier = $textOutput; foreach ($components as $index => $c) { if (is_array($tier) && !isset($tier[$c])) { $allow = false; break 2; } if ($index == count($components) - 1 && is_array($tier)) { $resolvedKeyPath = (string) $tier[$c]; break; } else if (!is_array($tier)) { $allow = false; break 2; } $tier = $tier[$c]; } $value = substr($value, 0, $m[1] - 1) . strip_tags($resolvedKeyPath) . substr($value, $m[1] + strlen($m[0])); } } if (!$allow) { continue; } echo $label . ': ' . $value . "\n"; } ?> scanner/issue-coreUnknown.php000064400000004000147206765060012353 0ustar00 'coreUnknown', 'displayType' => __('Unknown Core File', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Always Ignore Version', 'wordfence'), 'ignoreC' => __('Ignore Until Version Changes', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array(__('Details', 'wordfence') => '{{html longMsg}}'), 'detailControls' => array( '{{if data.fileExists}}' . __('View File', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . '){{/if}}', '{{if data.canDelete}}' . __('Delete File', 'wordfence') . '{{/if}}', '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Details', 'wordfence') => '$longMsg', ), ))->render();scanner/issue-skippedPaths.php000064400000003311147206765060012506 0ustar00 'skippedPaths', 'displayType' => __('Skipped Paths', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Details', 'wordfence') => '{{html longMsg}}', ), 'detailControls' => array( '' . __('Go To Option', 'wordfence') . '', '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Details', 'wordfence') => '$longMsg', ), ))->render();scanner/issue-suspiciousAdminUsers.php000064400000004366147206765060014263 0ustar00 'suspiciousAdminUsers', 'displayType' => __('Unknown Administrator', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Details', 'wordfence') => '{{html longMsg}}', ), 'detailControls' => array( '' . __('Delete User', 'wordfence') . '', '' . __('Revoke Capabilities', 'wordfence') . '', '' . __('Acknowledge User', 'wordfence') . '', '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Details', 'wordfence') => '$longMsg', ), ))->render();scanner/issue-control-repair.php000064400000001624147206765060013014 0ustar00 {{if data.canFix}}{{/if}}scanner/issue-timelimit.php000064400000003474147206765060012056 0ustar00 'timelimit', 'displayType' => __('Time Limit', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Details', 'wordfence') => '{{html longMsg}}', ), 'detailControls' => array( '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Details', 'wordfence') => '$longMsg', ), ))->render();scanner/scan-progress-element.php000064400000004022147206765060013136 0ustar00
  • ">
    50, ))->render(); ?>
    ()
  • scanner/issue-checkSpamIP.php000064400000002475147206765060012210 0ustar00 'checkSpamIP', 'displayType' => __('Spam', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Details', 'wordfence') => '{{html longMsg}}', ), 'detailControls' => array( '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Details', 'wordfence') => '$longMsg', ), ))->render();scanner/issue-geoipSupport.php000064400000003502147206765060012551 0ustar00 'geoipSupport', 'displayType' => __('Server Update', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Details', 'wordfence') => '{{html longMsg}}', ), 'detailControls' => array( '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Details', 'wordfence') => '$longMsg', ), ))->render();scanner/issue-control-hide-file.php000064400000005334147206765060013362 0ustar00 scanner/site-cleaning-high-sense.php000064400000021133147206765060013475 0ustar00 scanner/issue-publiclyAccessible.php000064400000004021147206765060013647 0ustar00 'publiclyAccessible', 'displayType' => __('Quarantined File', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-hide-file'), wfView::create('scanner/issue-control-ignore', array('ignoreC' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('URL', 'wordfence') => '${data.url} (' . esc_html__('opens in new tab', 'wordfence') . ')', null, __('Details', 'wordfence') => '{{html longMsg}}' ), 'detailControls' => array( '{{if data.fileExists}}' . __('View File', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . '){{/if}}', '{{if data.canDelete}}' . __('Delete File', 'wordfence') . '{{/if}}', '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('URL', 'wordfence') => '$data.url', null, __('Details', 'wordfence') => '$longMsg', ), ))->render();scanner/scan-type.php000064400000022166147206765060010635 0ustar00 scanner/issue-checkGSB.php000064400000004643147206765060011471 0ustar00 'checkGSB', 'displayType' => __('URL', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Bad URL', 'wordfence') => array('(typeof data.badURL !== \'undefined\') && data.badURL', '${data.badURL}'), null, __('Details', 'wordfence') => '{{html longMsg}}', ), 'detailControls' => array( '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Bad URL', 'wordfence') => '$data.badURL', null, __('Details', 'wordfence') => '$longMsg', ), ))->render();scanner/issue-wfUpgrade.php000064400000007027147206765060012003 0ustar00 'wfUpgrade', 'displayType' => __('Core Upgrade', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreC' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Current WordPress Version', 'wordfence') => '${data.currentVersion}', __('New WordPress Version', 'wordfence') => '${data.newVersion}', null, __('Details', 'wordfence') => '{{if data.vulnerable}}' . esc_html__('Update includes security-related fixes.', 'wordfence') . '
    {{/if}}{{html longMsg}}
    ' . esc_html__('Click here to update now', 'wordfence') . '.', null, __('Vulnerability Information', 'wordfence') => array('data.vulnerabilityLink', '${data.vulnerabilityLink}' . __('View', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . ')'), __('Vulnerability Severity', 'wordfence') => array('data.cvssScore', '${data.cvssScore}/10.0 (${data.severityLabel})'), ), 'detailControls' => array( '' . __('Mark as Fixed', 'wordfence') . '', '' . __('View Updates', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Current WordPress Version', 'wordfence') => '$data.currentVersion', __('New WordPress Version', 'wordfence') => '$data.newVersion', null, __('Details', 'wordfence') => '$longMsg', __('Vulnerability Status', 'wordfence') => array('$data.vulnerable', __('Update includes security-related fixes.', 'wordfence')), null, __('Vulnerability Information', 'wordfence') => '$data.vulnerabilityLink', __('Vulnerability Severity', 'wordfence') => '${data.cvssScore}/10.0 (${data.severityLabel})', ), ))->render();scanner/scan-failed.php000064400000003412147206765060011071 0ustar00 scanner/issue-wafStatus.php000064400000003700147206765060012032 0ustar00 'wafStatus', 'displayType' => __('WAF Status', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Status', 'wordfence') => '${data.wafStatusDisplay}', null, __('Details', 'wordfence') => '{{html longMsg}}', ), 'detailControls' => array( '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Status', 'wordfence') => '$data.wafStatusDisplay', null, __('Details', 'wordfence') => '$longMsg', ), ))->render();scanner/issue-file.php000064400000006446147206765060011002 0ustar00 'file', 'displayType' => __('File', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-repair'), wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Always Ignore', 'wordfence'), 'ignoreC' => __('Ignore Until File Changes', 'wordfence'))), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('Filename', 'wordfence') => '${data.realFile}', __('File Type', 'wordfence') => '{{if data.cType}}${WFAD.ucfirst(data.cType)}{{else data.wpconfig}}' . __('WordPress Configuration File', 'wordfence') . '{{else}}' . __('Not a core, theme, or plugin file from wordpress.org', 'wordfence') . '.{{/if}}', __('Bad URL', 'wordfence') => array('(typeof data.badURL !== \'undefined\') && data.badURL', '${data.badURL}'), null, __('Details', 'wordfence') => '{{html longMsg}}

    {{if data.wpconfig}}' . esc_html__('This is your main configuration file and cannot be deleted. It must be cleaned manually.', 'wordfence') . '{{/if}}', ), 'detailControls' => array( '{{if data.fileExists}}' . __('View File', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . '){{/if}}', '{{if data.canDiff}}' . __('View Differences', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . '){{/if}}', '{{if data.canDelete}}' . __('Delete File', 'wordfence') . '{{/if}}', '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('Filename', 'wordfence') => '$data.realFile', __('File Type', 'wordfence') => '$data.ucType', __('File Type', 'wordfence') => '$data.wpconfig', __('File Type', 'wordfence') => array(array('!$data.ucType', '!$data.wpconfig'), 'Not a core, theme, or plugin file from wordpress.org'), __('Bad URL', 'wordfence') => '$data.badURL', null, __('Details', 'wordfence') => '$longMsg', ), ))->render();scanner/issue-wpscan_fullPathDiscl.php000064400000004335147206765060014167 0ustar00 'wpscan_fullPathDiscl', 'displayType' => __('Full Path Disclosure', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore'), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('URL', 'wordfence') => '${data.url} (' . esc_html__('opens in new tab', 'wordfence') . ')', null, __('Details', 'wordfence') => '{{html longMsg}}' ), 'detailControls' => array( '{{if data.fileExists}}' . __('View File', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . '){{/if}}', '{{if data.canDelete}}' . __('Delete File', 'wordfence') . '{{/if}}', '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('URL', 'wordfence') => '$data.url', null, __('Details', 'wordfence') => '$longMsg', ), ))->render();scanner/option-scan-signatures.php000064400000013546147206765060013350 0ustar00 scanner/issue-wpscan_directoryList.php000064400000004342147206765060014267 0ustar00 'wpscan_fullPathDiscl', 'displayType' => __('Directory Listing Enabled', 'wordfence'), 'iconSVG' => '', 'summaryControls' => array(wfView::create('scanner/issue-control-ignore'), wfView::create('scanner/issue-control-show-details')), 'detailPairs' => array( __('URL', 'wordfence') => '${data.url} (' . esc_html__('opens in new tab', 'wordfence') . ')', null, __('Details', 'wordfence') => '{{html longMsg}}' ), 'detailControls' => array( '{{if data.fileExists}}' . __('View File', 'wordfence') . ' (' . esc_html__('opens in new tab', 'wordfence') . '){{/if}}', '{{if data.canDelete}}' . __('Delete File', 'wordfence') . '{{/if}}', '' . __('Mark as Fixed', 'wordfence') . '', ), 'textOutput' => (isset($textOutput) ? $textOutput : null), 'textOutputDetailPairs' => array( __('URL', 'wordfence') => '$data.url', null, __('Details', 'wordfence') => '$longMsg', ), ))->render();onboarding/banner.php000064400000004313147206765060010662 0ustar00
    onboarding/plugin-header.php000064400000002623147206765060012143 0ustar00
    onboarding/overlay.php000064400000001622147206765060011076 0ustar00
    ×
    onboarding/modal-final-attempt.php000064400000006154147206765060013261 0ustar00
    onboarding/registration-prompt.php000064400000015124147206765060013450 0ustar00

    style="display: none;">
    style="display: none;" >
    array( 'title' => __('Response License Installed', 'wordfence'), 'content' => __('Congratulations! Wordfence Response is now active on your website. Please note that some Response features are not enabled by default.', 'wordfence') ), 'care' => array( 'title' => __('Care License Installed', 'wordfence'), 'content' => __('Congratulations! Wordfence Care is now active on your website. Please note that some Care features are not enabled by default.', 'wordfence') ), 'premium' => array( 'title' => __('Premium License Installed', 'wordfence'), 'content' => __('Congratulations! Wordfence Premium is now active on your website. Please note that some Premium features are not enabled by default.', 'wordfence') ), 'free' => array( 'title' => __('Free License Installed', 'wordfence'), 'content' => __('Congratulations! Wordfence Free is now active on your website.', 'wordfence') ), ); ?> $modal): ?>
    ">

    contact Wordfence Support(opens in new tab)', 'wordfence'), array('a' => array('href' => array(), 'target' => array(), 'rel' => array()), 'span' => array('class' => array()))) ?>

    onboarding/disabled-overlay.php000064400000000774147206765060012652 0ustar00

    onboarding/tour-overlay.php000064400000000235147206765060012064 0ustar00 onboarding/fresh-install.php000064400000002216147206765060012170 0ustar00

    1)) ?>
    user/disabled-application-passwords.php000064400000002105147206765060014341 0ustar00

    blocking/country-modal.php000064400000005552147206765060011666 0ustar00 blocking/blocking-status.php000064400000003212147206765060012171 0ustar00 blocking/option-bypass-cookie.php000064400000004542147206765060013145 0ustar00 blocking/options-group-advanced-country.php000064400000010524147206765060015155 0ustar00
    • 'cbl_action', 'selectOptions' => array( array('value' => 'block', 'label' => 'Show the standard Wordfence blocked message'), array('value' => 'redir', 'label' => 'Redirect to the URL below'), ), 'selectValue' => wfConfig::get('cbl_action'), 'title' => __('What to do when we block someone', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_BLOCKING_OPTION_WHAT_TO_DO), ))->render(); ?>
    • 'cbl_redirURL', 'textValue' => wfConfig::get('cbl_redirURL'), 'title' => __('URL to redirect blocked users to', 'wordfence'), 'placeholder' => __('Enter a full URL (e.g., http://example.com/blocked/)', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_BLOCKING_OPTION_REDIRECT), ))->render(); ?>
    • 'cbl_loggedInBlocked', 'enabledValue' => 1, 'disabledValue' => 0, 'value' => wfConfig::get('cbl_loggedInBlocked') ? 1 : 0, 'title' => __('Block countries even if they are logged in', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_BLOCKING_OPTION_BLOCK_LOGGED_IN), ))->render(); ?>
    • render(); ?>
    • render(); ?>
    • render(); ?>
    • ()
    blocking/option-bypass-redirect.php000064400000005511147206765060013472 0ustar00 blocking/country-block-map.php000064400001276560147206765060012451 0ustar00 blocking/blocking-create.php000064400000070111147206765060012113 0ustar00 render(); ?> blocking/block-list.php000064400000055350147206765060011135 0ustar00

    for %s', 'wordfence'), preg_replace('/^https?:\/\//i', '', wfUtils::wpSiteURL())), array('span'=>array('class'=>array()))); ?>

    • Wordfence Automatic Blocks', 'wordfence'), array('span'=>array('class'=>array()))); ?>
    offboarding/deactivation-prompt.php000064400000020074147206765060013546 0ustar00getKey(); ?>

    getKey(); ?>
    getKey() === $selectedOptionKey): ?> checked>

    common/license.php000064400000006611147206765060010210 0ustar00 <?php echo esc_html($title); ?>

    Wordfence Admin Page', 'wordfence'), network_admin_url('admin.php?page=Wordfence')), array('a'=>array('href'=>array()))); ?>

    .
    .

    common/page-help.php000064400000000576147206765060010434 0ustar00 common/modal-prompt.php000064400000006445147206765060011206 0ustar00 , 'label' =>

    waf/options-group-rate-limiting.php000064400000032103147206765060013436 0ustar00getStorageEngine(); if (!isset($collapseable)) { $collapseable = true; } ?>
    • 'firewallEnabled', 'value' => wfConfig::get('firewallEnabled') ? '1': '0', 'title' => __('Enable Rate Limiting and Advanced Blocking', 'wordfence'), 'subtitle' => __('NOTE: This checkbox enables ALL blocking/throttling functions including IP, country and advanced blocking, and the "Rate Limiting Rules" below.', 'wordfence'), 'states' => array( array('value' => '0', 'label' => __('Off', 'wordfence')), array('value' => '1', 'label' => __('On', 'wordfence')), ), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_ENABLE_ADVANCED_BLOCKING), 'noSpacer' => true, 'alignment' => 'wf-right', ))->render(); ?>
    • 'neverBlockBG', 'selectOptions' => array( array('value' => 'neverBlockVerified', 'label' => __('Verified Google crawlers will not be rate-limited', 'wordfence')), array('value' => 'neverBlockUA', 'label' => __('Anyone claiming to be Google will not be rate-limited', 'wordfence')), array('value' => 'treatAsOtherCrawlers', 'label' => __('Treat Google like any other Crawler', 'wordfence')), ), 'selectValue' => wfConfig::get('neverBlockBG'), 'title' => __('How should we treat Google\'s crawlers', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_GOOGLE_ACTION), ))->render(); ?>
    • 'DISABLED', 'label' => __('Unlimited', 'wordfence')), array('value' => 1920, 'label' => sprintf(/* translators: Number of HTTP requests. */__('%d per minute', 'wordfence'), 1920)), array('value' => 960, 'label' => sprintf(/* translators: Number of HTTP requests. */__('%d per minute', 'wordfence'), 960)), array('value' => 480, 'label' => sprintf(/* translators: Number of HTTP requests. */__('%d per minute', 'wordfence'), 480)), array('value' => 240, 'label' => sprintf(/* translators: Number of HTTP requests. */__('%d per minute', 'wordfence'), 240)), array('value' => 120, 'label' => sprintf(/* translators: Number of HTTP requests. */__('%d per minute', 'wordfence'), 120)), array('value' => 60, 'label' => sprintf(/* translators: Number of HTTP requests. */__('%d per minute', 'wordfence'), 60)), array('value' => 30, 'label' => sprintf(/* translators: Number of HTTP requests. */__('%d per minute', 'wordfence'), 30)), array('value' => 15, 'label' => sprintf(/* translators: Number of HTTP requests. */__('%d per minute', 'wordfence'), 15)), array('value' => 10, 'label' => sprintf(/* translators: Number of HTTP requests. */__('%d per minute', 'wordfence'), 10)), array('value' => 5, 'label' => sprintf(/* translators: Number of HTTP requests. */__('%d per minute', 'wordfence'), 5)), array('value' => 4, 'label' => sprintf(/* translators: Number of HTTP requests. */__('%d per minute', 'wordfence'), 4)), array('value' => 3, 'label' => sprintf(/* translators: Number of HTTP requests. */__('%d per minute', 'wordfence'), 3)), array('value' => 2, 'label' => sprintf(/* translators: Number of HTTP requests. */__('%d per minute', 'wordfence'), 2)), array('value' => 1, 'label' => sprintf(/* translators: Number of HTTP requests. */__('%d per minute', 'wordfence'), 1)), ); $actionOptions = array( array('value' => 'throttle', 'label' => __('throttle it', 'wordfence')), array('value' => 'block', 'label' => __('block it', 'wordfence')), ); ?>
    • 'maxGlobalRequests_enabled', 'toggleValue' => !!wfConfig::get('maxGlobalRequests_enabled') ? 1 : 0, 'rateOptionName' => 'maxGlobalRequests', 'rateOptions' => $rateOptions, 'rateValue' => wfConfig::get('maxGlobalRequests'), 'lowValue' => 120, 'actionOptionName' => 'maxGlobalRequests_action', 'actionOptions' => $actionOptions, 'actionValue' => wfConfig::get('maxGlobalRequests_action'), 'title' => __('If anyone\'s requests exceed', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_RATE_LIMIT_ANY), ))->render(); ?>
    • 'maxRequestsCrawlers_enabled', 'toggleValue' => !!wfConfig::get('maxRequestsCrawlers_enabled') ? 1 : 0, 'rateOptionName' => 'maxRequestsCrawlers', 'rateOptions' => $rateOptions, 'rateValue' => wfConfig::get('maxRequestsCrawlers'), 'lowValue' => 120, 'actionOptionName' => 'maxRequestsCrawlers_action', 'actionOptions' => $actionOptions, 'actionValue' => wfConfig::get('maxRequestsCrawlers_action'), 'title' => __('If a crawler\'s page views exceed', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_RATE_LIMIT_CRAWLER), ))->render(); ?>
    • 'max404Crawlers_enabled', 'toggleValue' => !!wfConfig::get('max404Crawlers_enabled') ? 1 : 0, 'rateOptionName' => 'max404Crawlers', 'rateOptions' => $rateOptions, 'rateValue' => wfConfig::get('max404Crawlers'), 'lowValue' => 60, 'actionOptionName' => 'max404Crawlers_action', 'actionOptions' => $actionOptions, 'actionValue' => wfConfig::get('max404Crawlers_action'), 'title' => __('If a crawler\'s pages not found (404s) exceed', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_RATE_LIMIT_CRAWLER_404), ))->render(); ?>
    • 'maxRequestsHumans_enabled', 'toggleValue' => !!wfConfig::get('maxRequestsHumans_enabled') ? 1 : 0, 'rateOptionName' => 'maxRequestsHumans', 'rateOptions' => $rateOptions, 'rateValue' => wfConfig::get('maxRequestsHumans'), 'lowValue' => 120, 'actionOptionName' => 'maxRequestsHumans_action', 'actionOptions' => $actionOptions, 'actionValue' => wfConfig::get('maxRequestsHumans_action'), 'title' => __('If a human\'s page views exceed', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_RATE_LIMIT_HUMAN), ))->render(); ?>
    • 'max404Humans_enabled', 'toggleValue' => !!wfConfig::get('max404Humans_enabled') ? 1 : 0, 'rateOptionName' => 'max404Humans', 'rateOptions' => $rateOptions, 'rateValue' => wfConfig::get('max404Humans'), 'lowValue' => 60, 'actionOptionName' => 'max404Humans_action', 'actionOptions' => $actionOptions, 'actionValue' => wfConfig::get('max404Humans_action'), 'title' => __('If a human\'s pages not found (404s) exceed', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_RATE_LIMIT_HUMAN_404), ))->render(); ?>
    • $b, 'label' => wfUtils::makeDuration($b)); } echo wfView::create('options/option-select', array( 'selectOptionName' => 'blockedTime', 'selectOptions' => $options, 'selectValue' => wfConfig::getInt('blockedTime'), 'title' => __('How long is an IP address blocked when it breaks a rule', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_AUTOMATIC_BLOCK_DURATION), ))->render(); ?>
    • 'allowed404s', 'textValue' => wfUtils::cleanupOneEntryPerLine(wfConfig::get('allowed404s')), 'title' => __('Allowlisted 404 URLs', 'wordfence'), 'subtitle' => __('These URL patterns will be excluded from the throttling rules used to limit crawlers.', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_WHITELISTED_404), ))->render(); ?>
    waf/options-group-whitelisted.php000064400000027521147206765060013226 0ustar00getStorageEngine(); if (!isset($collapseable)) { $collapseable = true; } ?>
      isSubDirectoryInstallation()): ?>
    • click here to configure the Firewall to run correctly on this site.', 'wordfence'), esc_attr(network_admin_url('admin.php?page=WordfenceWAF&subpage=waf_options#configureAutoPrepend'))), array('a'=>array('href'=>array()))); ?>

    • render(); ?>
    • array( array( 'name' => 'ajaxWatcherDisabled_front', 'enabledValue' => 0, 'disabledValue' => 1, 'value' => wfConfig::get('ajaxWatcherDisabled_front') ? 1 : 0, 'title' => __('Front-end Website', 'wordfence'), ), array( 'name' => 'ajaxWatcherDisabled_admin', 'enabledValue' => 0, 'disabledValue' => 1, 'value' => wfConfig::get('ajaxWatcherDisabled_admin') ? 1 : 0, 'title' => __('Admin Panel', 'wordfence'), ), ), 'noSpacer' => true, 'htmlTitle' => '' . esc_html__('Monitor background requests from an administrator\'s web browser for false positives', 'wordfence') . '', 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_MONITOR_AJAX), ))->render(); ?>
    waf/waf-install-manual.php000064400000002007147206765060011542 0ustar00

    php.ini to finish installation:', 'wordfence'), array('code'=>array())); ?>

    auto_prepend_file = ''

    in our documentation (opens in new tab).', 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_FIREWALL_WAF_INSTALL_MANUALLY)), array('a'=>array('href'=>array(), 'target'=>array(), 'rel'=>array()), 'span'=>array('class'=>array()))); ?>

    waf/waf-modal-wrapper.php000064400000003371147206765060011400 0ustar00
    waf/options-group-basic-firewall.php000064400000066002147206765060013562 0ustar00getStorageEngine(); if (!isset($collapseable)) { $collapseable = true; } ?>
    • isSubDirectoryInstallation()): ?>

      click here to configure the Firewall to run correctly on this site.', 'wordfence'), esc_attr(network_admin_url('admin.php?page=WordfenceWAF&subpage=waf_options#configureAutoPrepend'))), array('a'=>array('href'=>array()))); ?>

      firewallMode(); ?>

    • protectionMode() == wfFirewall::PROTECTION_MODE_EXTENDED && !$firewall->isSubDirectoryInstallation()): ?>

      remove them manually (opens in new tab).', 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_FIREWALL_WAF_REMOVE_MANUALLY)), array('a'=>array('href'=>array(), 'target'=>array(), 'rel'=>array()), 'span'=>array('class'=>array()))); ?>

      isSubDirectoryInstallation()): ?>

    • ruleMode() == wfFirewall::RULE_MODE_COMMUNITY): ?>

         ()

      isSubDirectoryInstallation()): ?>

      click here to configure the Firewall to run correctly on this site.', 'wordfence'), esc_attr(network_admin_url('admin.php?page=WordfenceWAF&subpage=waf_options#configureAutoPrepend'))), array('a'=>array('href'=>array()))); ?>

        '1', 'label' => __('Disabled', 'wordfence')), array('value' => '0', 'label' => __('Enabled', 'wordfence')), ); foreach ($states as $s): $disableBlacklist = false; try { $disableBlacklist = !!$config->getConfig('disableWAFBlacklistBlocking'); } catch (Exception $e) { } ?> data-option-value="" role="radio" aria-checked="" tabindex="0">
    protectionMode() == wfFirewall::PROTECTION_MODE_BASIC || ($firewall->protectionMode() == wfFirewall::PROTECTION_MODE_EXTENDED && $firewall->isSubDirectoryInstallation())) { echo wfView::create('waf/waf-install', array( ))->render(); } else { echo wfView::create('waf/waf-uninstall', array( ))->render(); } ?>waf/waf-install.php000064400000021600147206765060010267 0ustar00 waf/status-tooltip-learning-mode.php000064400000001320147206765060013575 0ustar00 waf/options-group-brute-force.php000064400000031153147206765060013112 0ustar00getStorageEngine(); if (!isset($collapseable)) { $collapseable = true; } ?>
    • 'loginSecurityEnabled', 'value' => wfConfig::get('loginSecurityEnabled') ? '1': '0', 'titleHTML' => '' . esc_html__('Enable brute force protection', 'wordfence') . '', 'subtitle' => __('This option enables all "Brute Force Protection" options, including strong password enforcement and invalid login throttling. You can modify individual options below.', 'wordfence'), 'states' => array( array('value' => '0', 'label' => __('Off', 'wordfence')), array('value' => '1', 'label' => __('On', 'wordfence')), ), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_ENABLE_LOGIN_SECURITY), 'noSpacer' => true, 'alignment' => 'wf-right', ))->render(); ?>
    • $b, 'label' => $b); } echo wfView::create('options/option-select', array( 'selectOptionName' => 'loginSec_maxFailures', 'selectOptions' => $options, 'selectValue' => wfConfig::get('loginSec_maxFailures'), 'title' => __('Lock out after how many login failures', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_LOCK_OUT_FAILURE_COUNT), ))->render(); ?>
    • $b, 'label' => $b); } echo wfView::create('options/option-select', array( 'selectOptionName' => 'loginSec_maxForgotPasswd', 'selectOptions' => $options, 'selectValue' => wfConfig::get('loginSec_maxForgotPasswd'), 'title' => __('Lock out after how many forgot password attempts', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_LOCK_OUT_FORGOT_PASSWORD_COUNT), ))->render(); ?>
    • $b, 'label' => wfUtils::makeDuration($b * 60)); } echo wfView::create('options/option-select', array( 'selectOptionName' => 'loginSec_countFailMins', 'selectOptions' => $options, 'selectValue' => wfConfig::getInt('loginSec_countFailMins'), 'title' => __('Count failures over what time period', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_COUNT_TIME_PERIOD), ))->render(); ?>
    • $b, 'label' => wfUtils::makeDuration($b * 60)); } echo wfView::create('options/option-select', array( 'selectOptionName' => 'loginSec_lockoutMins', 'selectOptions' => $options, 'selectValue' => wfConfig::getInt('loginSec_lockoutMins'), 'title' => __('Amount of time a user is locked out', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_LOCKOUT_DURATION), ))->render(); ?>
    • 'loginSec_lockInvalidUsers', 'enabledValue' => 1, 'disabledValue' => 0, 'value' => wfConfig::get('loginSec_lockInvalidUsers') ? 1 : 0, 'title' => __('Immediately lock out invalid usernames', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_IMMEDIATELY_LOCK_OUT_INVALID_USERS), ))->render(); ?>
    • 'loginSec_userBlacklist', 'tokenValue' => $users, 'title' => __('Immediately block the IP of users who try to sign in as these usernames', 'wordfence'), 'subtitle' => __('Hit enter to add a username', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_IMMEDIATELY_BLOCK_USERS), ))->render(); ?>
    • 'loginSec_breachPasswds_enabled', 'enabledToggleValue' => 1, 'disabledToggleValue' => 0, 'toggleValue' => !!wfConfig::get('loginSec_breachPasswds_enabled') ? 1 : 0, 'selectOptionName' => 'loginSec_breachPasswds', 'selectOptions' => array(array('value' => 'admins', 'label' => __('For admins only', 'wordfence')), array('value' => 'pubs', 'label' => __('For all users with "publish posts" capability', 'wordfence'))), 'selectValue' => wfConfig::get('loginSec_breachPasswds'), 'title' => __('Prevent the use of passwords leaked in data breaches', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_PREVENT_BREACH_PASSWORDS), ))->render(); ?>
    • '' . esc_html__('Additional Options', 'wordfence') . '', 'noSpacer' => true, ))->render(); ?>
    • 'loginSec_strongPasswds_enabled', 'enabledToggleValue' => 1, 'disabledToggleValue' => 0, 'toggleValue' => !!wfConfig::get('loginSec_strongPasswds_enabled') ? 1 : 0, 'selectOptionName' => 'loginSec_strongPasswds', 'selectOptions' => array(array('value' => 'pubs', 'label' => __('Force admins and publishers to use strong passwords (recommended)', 'wordfence')), array('value' => 'all', 'label' => __('Force all members to use strong passwords', 'wordfence'))), 'selectValue' => wfConfig::get('loginSec_strongPasswds'), 'title' => __('Enforce strong passwords', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_ENFORCE_STRONG_PASSWORDS), ))->render(); ?>
    • 'loginSec_maskLoginErrors', 'enabledValue' => 1, 'disabledValue' => 0, 'value' => wfConfig::get('loginSec_maskLoginErrors') ? 1 : 0, 'title' => __('Don\'t let WordPress reveal valid users in login errors', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_MASK_LOGIN_ERRORS), ))->render(); ?>
    • 'loginSec_blockAdminReg', 'enabledValue' => 1, 'disabledValue' => 0, 'value' => wfConfig::get('loginSec_blockAdminReg') ? 1 : 0, 'title' => __('Prevent users registering \'admin\' username if it doesn\'t exist', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_PREVENT_ADMIN_REGISTRATION), ))->render(); ?>
    • 'loginSec_disableAuthorScan', 'enabledValue' => 1, 'disabledValue' => 0, 'value' => wfConfig::get('loginSec_disableAuthorScan') ? 1 : 0, 'title' => __('Prevent discovery of usernames through \'/?author=N\' scans, the oEmbed API, the WordPress REST API, and WordPress XML Sitemaps', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_PREVENT_AUTHOR_SCAN), ))->render(); ?>
    • 'loginSec_disableApplicationPasswords', 'enabledValue' => 1, 'disabledValue' => 0, 'value' => wfConfig::get('loginSec_disableApplicationPasswords') ? 1 : 0, 'title' => __('Disable WordPress application passwords', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_DISABLE_APPLICATION_PASSWORDS), ))->render(); ?>
    • 'other_blockBadPOST', 'enabledValue' => 1, 'disabledValue' => 0, 'value' => wfConfig::get('other_blockBadPOST') ? 1 : 0, 'title' => __('Block IPs who send POST requests with blank User-Agent and Referer', 'wordfence'), 'subtitleHTML' => esc_html__('If you use external services that may send POST requests without these headers, do not use this option, as they will be blocked.', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_BLOCK_BAD_POST), ))->render(); ?>
    • 'blockCustomText', 'textValue' => wfConfig::get('blockCustomText'), 'title' => __('Custom text shown on block pages', 'wordfence'), 'alignTitle' => 'top', 'subtitleHTML' => esc_html__('HTML tags will be stripped prior to output and line breaks will be converted into the appropriate tags.', 'wordfence'), 'subtitlePosition' => 'value', 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_CUSTOM_BLOCK_TEXT), ))->render(); ?>
    • 'other_pwStrengthOnUpdate', 'enabledValue' => 1, 'disabledValue' => 0, 'value' => wfConfig::get('other_pwStrengthOnUpdate') ? 1 : 0, 'title' => __('Check password strength on profile update', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_CHECK_PASSWORD), ))->render(); ?>
    • 'other_WFNet', 'enabledValue' => 1, 'disabledValue' => 0, 'value' => wfConfig::get('other_WFNet') ? 1 : 0, 'title' => __('Participate in the Real-Time Wordfence Security Network', 'wordfence'), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_PARTICIPATE_WFSN), ))->render(); ?>
    waf/options-group-advanced-firewall.php000064400000024130147206765060014242 0ustar00getStorageEngine(); if (!isset($collapseable)) { $collapseable = true; } ?>
    • 'disableWAFIPBlocking', 'enabledValue' => 1, 'disabledValue' => 0, 'value' => wfConfig::get('disableWAFIPBlocking') ? 1 : 0, 'title' => __('Delay IP and Country blocking until after WordPress and plugins have loaded (only process firewall rules early)', 'wordfence'), 'subtitle' => ($firewall->isSubDirectoryInstallation() ? __('You are currently running the WAF from another WordPress installation. This option can be changed once you configure the firewall to run correctly on this site.', 'wordfence') : ''), 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_DELAY_BLOCKING), 'disabled' => $firewall->isSubDirectoryInstallation(), ))->render(); ?>
    • 'whitelisted', 'textValue' => wfUtils::cleanupOneEntryPerLine(wfConfig::get('whitelisted')), 'title' => __('Allowlisted IP addresses that bypass all rules', 'wordfence'), 'alignTitle' => 'top', 'subtitleHTML' => wp_kses(__('Allowlisted IPs must be separated by commas or placed on separate lines. You can specify ranges using the following formats: 127.0.0.1/24, 127.0.0.[1-100], or 127.0.0.1-127.0.1.100
      Wordfence automatically allowlists private networks (opens in new tab) because these are not routable on the public Internet.', 'wordfence'), array('br'=>array(), 'a'=>array('href'=>array(), 'target'=>array(), 'rel'=>array()), 'span'=>array('class'=>array()))), 'subtitlePosition' => 'value', 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_WHITELISTED_IPS), ))->render(); ?>
    • $preset) { if (!isset($preset['n'])) { continue; } //Not named, omitted from configurable list if ((isset($preset['h']) && $preset['h']) || (isset($preset['f']) && $preset['f'])) { continue; } //Flagged as hidden or always enabled, omitted from configurable list $names[$tag] = $preset['n']; if (!isset($whitelistedServices[$tag]) && isset($preset['d']) && $preset['d']) { $whitelistedServices[$tag] = 1; } } $options = array(); foreach ($names as $tag => $name) { $options[] = array( 'name' => 'whitelistedServices.' . preg_replace('/[^a-z0-9]/i', '', $tag), 'enabledValue' => 1, 'disabledValue' => 0, 'value' => (isset($whitelistedServices[$tag]) && $whitelistedServices[$tag]) ? 1 : 0, 'title' => $name, ); } echo wfView::create('options/option-toggled-multiple', array( 'options' => $options, 'title' => __('Allowlisted services', 'wordfence'), 'id' => 'wf-option-whitelistedServices', 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_WHITELISTED_SERVICES), ))->render(); ?>
    • 'bannedURLs', 'textValue' => wfUtils::cleanupOneEntryPerLine(wfConfig::get('bannedURLs')), 'title' => __('Immediately block IPs that access these URLs', 'wordfence'), 'alignTitle' => 'top', 'subtitle' => __('Separate multiple URLs with commas or place them on separate lines. Asterisks are wildcards, but use with care. If you see an attacker repeatedly probing your site for a known vulnerability you can use this to immediately block them. All URLs must start with a "/" without quotes and must be relative. e.g. /badURLone/, /bannedPage.html, /dont-access/this/URL/, /starts/with-*', 'wordfence'), 'subtitlePosition' => 'value', 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_OPTION_IMMEDIATELY_BLOCK_URLS), ))->render(); ?>
    • 'wafAlertWhitelist', 'textValue' => wfUtils::cleanupOneEntryPerLine(wfConfig::get('wafAlertWhitelist')), 'title' => __('Ignored IP addresses for Wordfence Web Application Firewall alerting', 'wordfence'), 'alignTitle' => 'top', 'subtitle' => __('Ignored IPs must be separated by commas or placed on separate lines. These addresses will be ignored from any alerts about increased attacks and can be used to ignore things like standalone website security scanners.', 'wordfence'), 'subtitlePosition' => 'value', 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_IGNORED_ALERT_IPS), ))->render(); ?>
    • $firewall, ))->render(); ?>
    waf/option-rate-limit.php000064400000010171147206765060011424 0ustar00 , 'label' => ), ...) * @var string $rateValue The current value of $rateOptionName. * @var int $lowValue The value below which the false positive warning should begin showing * @var string $actionOptionName The option name for the rate portion. * @var array $actionOptions An array of the possible values for $actionOptionName. The array is of the format array(array('value' => , 'label' => ), ...) * @var string $actionValue The current value of $actionOptionName. * @var string $title The title shown for the option. * @var string $helpLink If defined, the link to the corresponding external help page. * @var bool $premium If defined, the option will be tagged as premium only and not allow its value to change for free users. */ $rateID = 'wf-option-' . preg_replace('/[^a-z0-9]/i', '-', $rateOptionName); $actionID = 'wf-option-' . preg_replace('/[^a-z0-9]/i', '-', $actionOptionName); ?> add.php000064400000015076147206770760006036 0ustar00 array('extraData' => '&action=swpm_validate_email&member_id=' . filter_input(INPUT_GET, 'member_id', FILTER_SANITIZE_NUMBER_INT)))); $settings = SwpmSettings::get_instance(); $force_strong_pass = $settings->get_value('force-strong-passwords'); if (!empty($force_strong_pass)) { $pass_class = apply_filters( "swpm_registration_strong_pass_validation", "validate[required,custom[strongPass],minSize[8]]" ); } else { $pass_class = ""; } // Filter allowing to change the default value of user_name $user_name = apply_filters('swpm_registration_form_set_username', $user_name); ?>
    > > > > get_value('enable-terms-and-conditions'); if (!empty($terms_enabled)) { $terms_page_url = $settings->get_value('terms-and-conditions-page-url'); ?> get_value('enable-privacy-policy'); if (!empty($pp_enabled)) { $pp_page_url = $settings->get_value('privacy-policy-page-url'); ?>
    />
    '; //Add the level input verification data. $swpm_p_key = get_option('swpm_private_key_one'); if (empty($swpm_p_key)) { $swpm_p_key = uniqid('', true); update_option('swpm_private_key_one', $swpm_p_key); } $swpm_level_hash = md5($swpm_p_key . '|' . $membership_level); //level hash echo ''; ?>
    forgot_password.php000064400000003373147206770760010525 0ustar00get_value('use-new-form-ui'); if ( !empty( $render_new_form_ui ) ){ $pass_reset_submit_class .= ' swpm-submit-btn-default-style'; } ?>
    admin_add.php000064400000010101147206770760007166 0ustar00
    >



    'createswpmusersub')); ?>
    admin_membership_manage.php000064400000003044147206770760012111 0ustar00


    Content protection example usage
    edit-v2.php000064400000031141147206770760006547 0ustar00userData; $user_data['membership_level_alias'] = $auth->get('alias'); extract($user_data, EXTR_SKIP); $settings = SwpmSettings::get_instance(); $force_strong_pass = $settings->get_value('force-strong-passwords'); $custom_pass_pattern_validator = ""; $custom_pass_pattern_validator_msg = ""; $custom_pass_min_length_validator = null; $custom_pass_min_length_validator_msg = ""; if (!empty($force_strong_pass)) { // Leaving the value empty will take the default strong password validation rule and its message. // filters for password pattern customization. $custom_pass_pattern_validator = apply_filters( "swpm_profile_pass_pattern_validation", "" ); $custom_pass_pattern_validator_msg = apply_filters( "swpm_profile_pass_pattern_validation_msg", "" ); // filters for password min length customization. $custom_pass_min_length_validator = apply_filters( "swpm_profile_pass_min_length_validation", null ); $custom_pass_min_length_validator_msg = apply_filters( "swpm_profile_pass_min_length_validation_msg", "" ); } $form_id = "swpm-profile-form"; $is_strong_password_enabled = empty($force_strong_pass) ? 'false' : 'true'; SimpleWpMembership::enqueue_validation_scripts_v2( "swpm-profile-form-validator", array( 'query_args' => array( 'member_id' => filter_input(INPUT_GET, 'member_id', FILTER_SANITIZE_NUMBER_INT), 'nonce' => wp_create_nonce('swpm-rego-form-ajax-nonce'), ), 'form_id' => $form_id, 'is_strong_password_enabled' => $is_strong_password_enabled, 'custom_pass_pattern_validator' => $custom_pass_pattern_validator, 'custom_pass_pattern_validator_msg' => $custom_pass_pattern_validator_msg, 'custom_pass_min_length_validator' => $custom_pass_min_length_validator, 'custom_pass_min_length_validator_msg' => $custom_pass_min_length_validator_msg, ) ); ?>
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    admin_member_form_common_part.php000064400000007524147206770760013345 0ustar00

    admin_edit_v2.php000064400000037536147206770760010017 0ustar00 array( 'member_id' => $member_id, 'nonce' => wp_create_nonce('swpm-rego-form-ajax-nonce'), ), 'form_id' => $form_id, ) ); $is_attached_subscription_canceled = SwpmMemberUtils::get_subscription_data_extra_info($member_id, 'subscription_status') === 'inactive'; //Get the current expiry date based on the membership level of this member. $member_current_expiry_date = SwpmMemberUtils::get_formatted_expiry_date_by_user_id($member_id); ?>
    >

    This user account registration is not complete yet. The member needs to click on the unique registration completion link (sent to his email) and complete the registration by choosing a username and password.


    You can go to the Tools Interface and generate another unique "Registration Completion" link then send the link to the user. Alternatively, you can use that link yourself and complete the registration on behalf of the user.


    If you suspect that this user has lost interest in becoming a member then you can delete this member record.

    '; echo '

    ' . 'Error! This user\'s membership level is not set. Please select a membership level and save the record.' . '

    '; echo '

    '; echo 'If member accounts are created without a level, that indicates a problem in your setup. Please review your '; echo 'registration setup.'; echo '

    '; echo ''; } ?>

    .

    this documentation.', 'simple-membership'); ?>

    '; print_r($unserialized_extra_info); echo ''; //echo esc_attr($extra_info); ?>

    'createswpmusersub')); ?> '; echo '' . __('Delete User Profile', 'simple-membership') . ''; echo '
    '; ?> join_us.php000064400000000000147206770760006731 0ustar00admin_addon_settings.php000064400000001040147206770760011445 0ustar00

    edit.php000064400000015656147206770760006237 0ustar00userData; $user_data['membership_level_alias'] = $auth->get('alias'); extract($user_data, EXTR_SKIP); $settings=SwpmSettings::get_instance(); $force_strong_pass=$settings->get_value('force-strong-passwords'); if (!empty($force_strong_pass)) { $pass_class = apply_filters( "swpm_profile_strong_pass_validation", "validate[custom[strongPass],minSize[8]]" ); } else { $pass_class=""; } SimpleWpMembership::enqueue_validation_scripts(); //The admin ajax causes an issue with the JS validation if done on form submission. The edit profile doesn't need JS validation on email. There is PHP validation which will catch any email error. //SimpleWpMembership::enqueue_validation_scripts(array('ajaxEmailCall' => array('extraData'=>'&action=swpm_validate_email&member_id='.SwpmAuth::get_instance()->get('member_id')))); ?>
    > > > > > > > > > > >

    admin_edit_level.php000064400000022717147206770760010572 0ustar00get_value( 'default-account-status' ) == 'pending' && checked($email_activation, true, false) ? true : false; ?>
    >

    ' . __('this documentation', 'simple-membership') . ''; echo __(' to learn how a membership level works.', 'simple-membership'); ?>

    '; echo __('You are currently editing: ', 'simple-membership'); echo esc_attr(stripslashes($alias)); echo __(' (Level ID: ', 'simple-membership') . esc_attr($id) . ')'; echo '

    '; ?>

    value="" name="subscription_duration_type" />

    value="" name="subscription_duration_type" /> " name="subscription_period_">

    value="" name="subscription_duration_type" /> " name="subscription_period_">

    value="" name="subscription_duration_type" /> " name="subscription_period_">

    value="" name="subscription_duration_type" /> " name="subscription_period_">

    value="" name="subscription_duration_type" /> " name="subscription_period_" id="subscription_period_">

    ' . __('View Documentation', 'simple-membership') . '.'; ?>

    >

    ' . SwpmUtils::_('View Documentation') . '.'; ?> '.SwpmUtils::_('Note:').' '.SwpmUtils::_('If enabled, decryptable member password is temporarily stored in the database until the account is activated.'); ?>


    'editswpmlevelsub' ) ); ?>
    admin_members_list.php000064400000012140147206770760011130 0ustar00delete(); $success_msg = '

    '; $success_msg .= SwpmUtils::_('The selected entry was deleted!'); $success_msg .= '

    '; echo $success_msg; } $this->prepare_items(); $count = $this->get_user_count_by_account_state(); global $wpdb; $query = "SELECT * FROM " . $wpdb->prefix . "swpm_membership_tbl WHERE id !=1 "; $levels = $wpdb->get_results($query, ARRAY_A); $account_state = isset($_GET['status']) ? sanitize_text_field($_GET['status']) : ''; $membership_level = filter_input(INPUT_GET, 'membership_level', FILTER_SANITIZE_NUMBER_INT); ?>
    display(); ?>

    account_delete_warning.php000064400000001717147206770760012006 0ustar00 ' . $msg . '

    '; ?>

    admin_add_level.php000064400000015246147206770760010374 0ustar00

    ' . __('this documentation', 'simple-membership') . ''; echo __(' to learn how a membership level works.', 'simple-membership'); ?>

    )

    ' . __('View Documentation', 'simple-membership') . '.'; ?>

    ' . SwpmUtils::_('View Documentation') . '.'; ?> '.SwpmUtils::_('Note:').' '.SwpmUtils::_('If enabled, the member\'s decryptable password is temporarily stored in the database until the account is activated.'); ?>


    'createswpmlevelsub' ) ); ?>
    admin_add_v2.php000064400000013326147206770760007611 0ustar00 array( 'member_id' => filter_input(INPUT_GET, 'member_id', FILTER_SANITIZE_NUMBER_INT), 'nonce' => wp_create_nonce('swpm-rego-form-ajax-nonce'), ), 'form_id' => $form_id, ) ); ?>
    >

    'createswpmusersub')); ?>
    add-v2.php000064400000025621147206770760006360 0ustar00get_value('force-strong-passwords'); $custom_pass_pattern_validator = ""; $custom_pass_pattern_validator_msg = ""; $custom_pass_min_length_validator = null; $custom_pass_min_length_validator_msg = ""; if (!empty($force_strong_pass)) { // Leaving the value empty will take the default strong password validation rule and its message. // filters for password pattern customization. $custom_pass_pattern_validator = apply_filters( "swpm_reg_pass_pattern_validation", "" ); $custom_pass_pattern_validator_msg = apply_filters( "swpm_reg_pass_pattern_validation_msg", "" ); // filters for password min length customization. $custom_pass_min_length_validator = apply_filters( "swpm_reg_pass_min_length_validation", null ); $custom_pass_min_length_validator_msg = apply_filters( "swpm_reg_pass_min_length_validation_msg", "" ); } $terms_enabled = $settings->get_value('enable-terms-and-conditions'); $pp_enabled = $settings->get_value('enable-privacy-policy'); // Filter allowing to change the default value of user_name. $user_name = apply_filters('swpm_registration_form_set_username', $user_name); // $form_id = uniqid("swpm-registration-form-"); $form_id = "swpm-registration-form"; // Let javascript know that the fields are enabled and need to be validated. $is_terms_enabled = empty($terms_enabled) ? 'false' : 'true'; $is_pp_enabled = empty($pp_enabled) ? 'false' : 'true'; $is_strong_password_enabled = empty($force_strong_pass) ? 'false' : 'true'; SimpleWpMembership::enqueue_validation_scripts_v2( 'swpm-reg-form-validator', array( 'query_args' => array( 'member_id' => filter_input(INPUT_GET, 'member_id', FILTER_SANITIZE_NUMBER_INT), 'nonce' => wp_create_nonce('swpm-rego-form-ajax-nonce'), ), 'form_id' => $form_id, 'is_terms_enabled' => $is_terms_enabled, 'is_pp_enabled' => $is_pp_enabled, 'is_strong_password_enabled' => $is_strong_password_enabled, 'custom_pass_pattern_validator' => $custom_pass_pattern_validator, 'custom_pass_pattern_validator_msg' => $custom_pass_pattern_validator_msg, 'custom_pass_min_length_validator' => $custom_pass_min_length_validator, 'custom_pass_min_length_validator_msg' => $custom_pass_min_length_validator_msg, ) ); ?>
    >
    />
    >
    >
    >
    '; //Add the level input verification data. $swpm_p_key = get_option('swpm_private_key_one'); if (empty($swpm_p_key)) { $swpm_p_key = uniqid('', true); update_option('swpm_private_key_one', $swpm_p_key); } $swpm_level_hash = md5($swpm_p_key . '|' . $membership_level); //level hash echo ''; ?>
    get_value('terms-and-conditions-page-url'); ?>
    get_value('privacy-policy-page-url'); ?>
    admin_edit.php000064400000031514147206770760007376 0ustar00 array('extraData'=>'&action=swpm_validate_email&member_id='.$member_id))); $is_attached_subscription_canceled = SwpmMemberUtils::get_subscription_data_extra_info($member_id, 'subscription_status') === 'inactive'; //Get the current expiry date based on the membership level of this member. $member_current_expiry_date = SwpmMemberUtils::get_formatted_expiry_date_by_user_id($member_id); ?>
    >

    This user account registration is not complete yet. The member needs to click on the unique registration completion link (sent to his email) and complete the registration by choosing a username and password.


    You can go to the Tools Interface and generate another unique "Registration Completion" link then send the link to the user. Alternatively, you can use that link yourself and complete the registration on behalf of the user.


    If you suspect that this user has lost interest in becoming a member then you can delete this member record.



    '; echo '

    ' . 'Error! This user\'s membership level is not set. Please select a membership level and save the record.' . '

    '; echo '

    '; echo 'If member accounts are created without a level, that indicates a problem in your setup. Please review your '; echo 'registration setup.'; echo '

    '; echo ''; } ?>

    .

    this documentation.', 'simple-membership'); ?>

    'createswpmusersub' ) ); ?> '; echo ''.SwpmUtils::_('Delete User Profile').''; echo '
    '; ?> admin_post_list.php000064400000005777147206770760010505 0ustar00


    prepare_items(); ?> display(); ?>
    admin_settings.php000064400000001551147206770760010307 0ustar00
    payments/admin_payment_buttons.php000064400000002007147206770760013537 0ustar00
    prepare_items(); ?>
    display(); ?>

    payments/admin_all_payment_transactions.php000064400000005057147206770760015411 0ustar00



    delete_record($post_id); if ($result) { $success_msg = '

    '; $success_msg .= __('The selected entry was deleted!', 'simple-membership'); $success_msg .= '

    '; echo $success_msg; } break; default: break; } } //Fetch, prepare, sort, and filter our data... $payments_list_table->prepare_items(); ?>
    display(); ?>

    payments/admin_edit_transaction.php000064400000025430147206770760013643 0ustar00ID, 'first_name', $first_name); } if (isset($_POST['swpm_txn_last_name']) && $_POST['swpm_txn_last_name'] != '') { $last_name = sanitize_text_field($_POST['swpm_txn_last_name']); update_post_meta($post->ID, 'last_name', $last_name); } if (isset($_POST['swpm_txn_email_address']) && $_POST['swpm_txn_email_address'] != '') { $email_address = sanitize_text_field($_POST['swpm_txn_email_address']); update_post_meta($post->ID, 'email', $email_address); } if (isset($_POST['swpm_txn_ipaddress']) && $_POST['swpm_txn_ipaddress'] != '') { $ip_address = sanitize_text_field($_POST['swpm_txn_ipaddress']); update_post_meta($post->ID, 'ip_address', $ip_address); } if (isset($_POST['swpm_txn_payment_amount']) && !empty($_POST['swpm_txn_payment_amount'])) { $payment_amount = sanitize_text_field($_POST['swpm_txn_payment_amount']); // Validate if value is a float if (!empty(floatval($payment_amount))) { update_post_meta($post->ID, 'payment_amount', $payment_amount); } } if (isset($_POST['swpm_txn_discount_amount']) && !empty($_POST['swpm_txn_discount_amount'])) { $discount_amount = sanitize_text_field($_POST['swpm_txn_discount_amount']); // Validate if value is a float if (!empty(floatval($discount_amount))) { update_post_meta($post->ID, 'discount_amount', $discount_amount); } } if (isset($_POST['swpm_txn_reference']) && $_POST['swpm_txn_reference'] != '') { $reference = sanitize_text_field($_POST['swpm_txn_reference']); update_post_meta($post->ID, 'reference', $reference); } echo '

    '; _e('Transaction data updated successfully. ', 'simple-membership'); echo ''. __('View all transactions', 'simple-membership') .''; echo '

    '; SwpmLog::log_simple_debug("Transaction data updated successfully.", true); // $redirect_to = admin_url(). "/admin.php?page=simple_wp_membership_payments"; // SwpmMiscUtils::redirect_to_url($redirect_to); } //Show the transaction edit from. swpm_show_edit_txn_form($post); } function swpm_show_edit_txn_form($post) { $post_id = $post->ID; $txn_date = get_post_meta($post_id, 'txn_date', true); $txn_id = get_post_meta($post_id, 'txn_id', true); $subscr_id = get_post_meta($post_id, 'subscr_id', true); if (empty($subscr_id)) { $subscr_id = '-'; } $email = get_post_meta($post_id, 'email', true); $first_name = get_post_meta($post_id, 'first_name', true); $last_name = get_post_meta($post_id, 'last_name', true); //Get the member ID that maybe associated with this transaction. $member_id = get_post_meta($post_id, 'member_id', true); if (empty($member_id) && !empty($subscr_id)){ //Try to get the member ID from the subscriber ID reference. $member_record = SwpmMemberUtils::get_user_by_subsriber_id( $subscr_id ); if ( $member_record ) { $member_id = $member_record->member_id; } } $profile_link_output = ''; if ( empty( $member_id ) ) { //If we still can't find the member ID, set it to a dash. The corresponding member profile may have been deleted. $member_id = '-'; } else { if( !SwpmMemberUtils::member_record_exists( $member_id ) ) { //Looks like the profile may have been deleted. Add a note to the profile link. $profile_link_output = ' ' . __('(Profile Deleted)', 'simple-membership') . ''; } else { //Generate the corresponding member profile view/edit link $profile_url = 'admin.php?page=simple_wp_membership&member_action=edit&member_id=' . esc_attr($member_id); $profile_link_output = '' . __('(View Profile)', 'simple-membership') . ''; } } $membership_level_link_output = ''; $membership_level_id = get_post_meta($post_id, 'membership_level', true); if (!empty($membership_level_id)) { //Get the membership level name. $membership_level_name = SwpmMembershipLevelUtils::get_membership_level_name_by_level_id($membership_level_id); //Generate the corresponding membership level view/edit link. $membership_level_url = 'admin.php?page=simple_wp_membership_levels&level_action=edit&id=' . esc_attr($membership_level_id); $membership_level_link_output = '' . __('(View Membership Level)', 'simple-membership') . ''; } else { $membership_level_name = '-'; } //We will use this field to save any additional note or reference for the transaction. $reference = get_post_meta($post_id, 'reference', true); $payment_amount = get_post_meta($post_id, 'payment_amount', true); $gateway = get_post_meta($post_id, 'gateway', true); if (!empty($gateway)) { $gateway = SwpmUtils::get_formatted_payment_gateway_name($gateway); } else { $gateway = '-'; } $status = get_post_meta($post_id, 'status', true); $ip_address = get_post_meta($post_id, 'ip_address', true); $payment_button_link_output = ''; $payment_button_id = get_post_meta($post_id, 'payment_button_id', true); if (empty($payment_button_id)) { $payment_button_id = '-'; } else { //Get the payment button type so we can link to the correct edit page for it to view the button configuration. $button_type = get_post_meta($payment_button_id, 'button_type', true); $payment_button_src = admin_url() . 'admin.php?page=simple_wp_membership_payments&tab=edit_button&button_id=' . esc_attr($payment_button_id) . '&button_type=' . esc_attr($button_type); $payment_button_link_output = '' . __('(View Button Configuration)', 'simple-membership') . ''; } $is_live = get_post_meta($post_id, 'is_live', true); if (!empty($is_live)) { $is_live = __("Yes", 'simple-membership'); } else { $is_live = __("No", 'simple-membership'); } $discount_amount = get_post_meta($post_id, 'discount_amount', true); if (empty($discount_amount)) { $discount_amount = floatval(0); } $custom = get_post_meta($post_id, 'custom', true); if (empty($custom)) { $custom = '-'; } ?>

    0 ) { ?>


    Payment Settings tab in the Payments menu. Click the link below to navigate to the new location.','simple-membership');?>

    '; _e( 'You can add a new transaction record manually using this interface. It can be useful if you manually accept cash payment for your memberships.', 'simple-membership' ); echo ''; if( isset( $_POST['swpm_add_new_txn_save_submit'] ) ){ //Check nonce first check_admin_referer( 'swpm_admin_add_new_txn_form_action', 'swpm_admin_add_new_txn_form_field' ); //let's also store transactions data in swpm_transactions CPT $post = array(); $post['post_title'] = ''; $post['post_status'] = 'publish'; $post['content'] = ''; $post['post_type'] = 'swpm_transactions'; $post_id = wp_insert_post( $post ); $current_date = SwpmUtils::get_current_date_in_wp_zone(); if (isset($_POST['email_address']) && $_POST['email_address'] != '') { $email_address = sanitize_text_field($_POST['email_address']); update_post_meta( $post_id, 'email', $email_address); } if (isset($_POST['first_name']) && $_POST['first_name'] != '') { $first_name = sanitize_text_field($_POST['first_name']); update_post_meta( $post_id, 'first_name', $first_name); } if (isset($_POST['last_name']) && $_POST['last_name'] != '') { $last_name = sanitize_text_field($_POST['last_name']); update_post_meta( $post_id, 'last_name', $last_name); } if (isset($_POST['member_id']) && $_POST['member_id'] != '') { $member_id = intval(sanitize_text_field($_POST['member_id'])); update_post_meta( $post_id, 'member_id', $member_id); } if (isset($_POST['membership_level_id']) && $_POST['membership_level_id'] != '') { $membership_level_id = intval(sanitize_text_field($_POST['membership_level_id'])); update_post_meta( $post_id, 'membership_level', $membership_level_id); } if (isset($_POST['payment_amount']) && !empty($_POST['payment_amount'])) { $payment_amount = sanitize_text_field($_POST['payment_amount']); // Validate if value is a float if (!empty(floatval($payment_amount))) { update_post_meta( $post_id, 'payment_amount', $payment_amount); } } if (isset($_POST['discount_amount']) && !empty($_POST['discount_amount'])) { $discount_amount = sanitize_text_field($_POST['discount_amount']); // Validate if value is a float if (!empty(floatval($discount_amount))) { update_post_meta( $post_id, 'discount_amount', $discount_amount); } } $txn_date = isset ( $_POST['txn_date'] ) ? sanitize_text_field( $_POST['txn_date' ] ) : $current_date; update_post_meta( $post_id, 'txn_date', $txn_date); $txn_id = isset ( $_POST['txn_id'] ) ? sanitize_text_field( $_POST['txn_id' ] ) : ''; update_post_meta( $post_id, 'txn_id', $txn_id); $subscr_id = isset ( $_POST['subscriber_id'] ) ? sanitize_text_field( $_POST['subscriber_id' ] ) : ''; update_post_meta( $post_id, 'subscr_id', $subscr_id); $txn_status = isset ( $_POST['txn_status'] ) ? sanitize_text_field( $_POST['txn_status' ] ) : ''; update_post_meta( $post_id, 'status', $txn_status); update_post_meta( $post_id, 'reference', ''); update_post_meta( $post_id, 'ip_address', ''); update_post_meta( $post_id, 'gateway', 'manual'); SwpmLog::log_simple_debug("Manual transaction added successfully.", true); echo '
    '; _e('Manual transaction added successfully. ', 'simple-membership'); echo ''.__('View all transactions', 'wp-express-checkout').''; echo '
    '; } else { //Show the form to add manual txn record swpm_show_add_new_txn_form(); } } function swpm_show_add_new_txn_form(){ ?>

    '.__('Error! swpm_render_pp_buy_now_new_button_sc_output() function requires the button ID value to be passed to it.', 'simple-membership').'

    '; } //Membership level for this button $membership_level_id = get_post_meta($button_id, 'membership_level_id', true); //Verify that this membership level exists (to prevent user paying for a level that has been deleted) if (!SwpmUtils::membership_level_id_exists($membership_level_id)) { return '

    '.__('Error! The membership level specified in this button does not exist. You may have deleted this membership level. Edit the button and use the correct membership level.', 'simple-membership').'

    '; } //Payment amount $payment_amount = get_post_meta($button_id, 'payment_amount', true); //Get the Item name for this button. This will be used as the item name in the IPN. $button_cpt = get_post($button_id); //Retrieve the CPT for this button $item_name = htmlspecialchars($button_cpt->post_title); $item_name = substr($item_name, 0, 127);//Limit the item name to 127 characters (PayPal limit) //User's IP address $user_ip = SwpmUtils::get_user_ip_address(); //Custom field data $custom_field_value = 'subsc_ref=' . $membership_level_id; $custom_field_value .= '&user_ip=' . $user_ip; if (SwpmMemberUtils::is_member_logged_in()) { $member_id = SwpmMemberUtils::get_logged_in_members_id(); $custom_field_value .= '&swpm_id=' . $member_id; //$member_first_name = SwpmMemberUtils::get_member_field_by_id($member_id, 'first_name'); //$member_last_name = SwpmMemberUtils::get_member_field_by_id($member_id, 'last_name'); //$member_email = SwpmMemberUtils::get_member_field_by_id($member_id, 'email'); } $custom_field_value = apply_filters('swpm_custom_field_value_filter', $custom_field_value); /***************************************** * Settings and Button Specific Configuration *****************************************/ $settings = SwpmSettings::get_instance(); $live_client_id = $settings->get_value('paypal-live-client-id'); $sandbox_client_id = $settings->get_value('paypal-sandbox-client-id'); $sandbox_enabled = $settings->get_value('enable-sandbox-testing'); $is_live_mode = $sandbox_enabled ? 0 : 1; $currency = get_post_meta( $button_id, 'payment_currency', true ); $disable_funding_card = get_post_meta( $button_id, 'pp_buy_now_new_disable_funding_card', true ); $disable_funding_credit = get_post_meta( $button_id, 'pp_buy_now_new_disable_funding_credit', true ); $disable_funding_venmo = get_post_meta( $button_id, 'pp_buy_now_new_disable_funding_venmo', true ); $disable_funding = array(); if( !empty($disable_funding_card)){ $disable_funding[] = 'card'; } if( !empty($disable_funding_credit)){ $disable_funding[] = 'credit'; } if( !empty($disable_funding_venmo)){ $disable_funding[] = 'venmo'; } $btn_type = get_post_meta($button_id, 'pp_buy_now_new_btn_type', true); $btn_shape = get_post_meta($button_id, 'pp_buy_now_new_btn_shape', true); $btn_layout = get_post_meta($button_id, 'pp_buy_now_new_btn_layout', true); $btn_color = get_post_meta($button_id, 'pp_buy_now_new_btn_color', true); $btn_width = get_post_meta($button_id, 'pp_buy_now_new_btn_width', true); $btn_height = get_post_meta($button_id, 'pp_buy_now_new_btn_height', true); $btn_sizes = array( 'small' => 25, 'medium' => 35, 'large' => 45, 'xlarge' => 55 ); $btn_height = isset( $btn_sizes[ $btn_height ] ) ? $btn_sizes[ $btn_height ] : 35; $return_url = get_post_meta($button_id, 'return_url', true); $txn_success_message = __('Transaction completed successfully!', 'simple-membership'); /********************** * PayPal SDK Settings **********************/ //Configure the paypal SDK settings and enqueue the code for SDK loading. $settings_args = array( 'is_live_mode' => $is_live_mode, 'live_client_id' => $live_client_id, 'sandbox_client_id' => $sandbox_client_id, 'currency' => $currency, 'disable-funding' => $disable_funding, /*array('card', 'credit', 'venmo'),*/ 'intent' => 'capture', /* It is used to set the "intent" parameter in the JS SDK */ 'is_subscription' => 0, /* It is used to set the "vault" parameter in the JS SDK */ ); //Initialize and set the settings args that will be used to load the JS SDK. $pp_js_button = SWPM_PayPal_JS_Button_Embed::get_instance(); $pp_js_button->set_settings_args( $settings_args ); //Load the JS SDK on footer (so it only loads once per page) add_action( 'wp_footer', array($pp_js_button, 'load_paypal_sdk') ); //The on page embed button id is used to identify the button on the page. Useful when there are multiple buttons (of the same item/product) on the same page. $on_page_embed_button_id = $pp_js_button->get_next_button_id(); //Create nonce for this button. $wp_nonce = wp_create_nonce($on_page_embed_button_id); $swpm_button_wrapper_id = 'swpm-button-wrapper-'.$button_id; $output = ''; ob_start(); ?>
     

    sanitize_text_field($_REQUEST['button_type']), ); render_save_edit_pp_smart_checkout_button_interface($bt_opts); } /* * *************************************************************** * Render edit PayPal Smart Checkout payment button interface * ************************************************************** */ add_action('swpm_edit_payment_button_for_pp_smart_checkout', 'swpm_edit_pp_smart_checkout_button'); function swpm_edit_pp_smart_checkout_button() { //Retrieve the payment button data and present it for editing. $button_id = sanitize_text_field($_REQUEST['button_id']); $button_id = absint($button_id); $button = get_post($button_id); //Retrieve the CPT for this button //$button_image_url = get_post_meta($button_id, 'button_image_url', true); $bt_opts = array( 'button_id' => $button_id, 'button_type' => sanitize_text_field($_REQUEST['button_type']), 'button_name' => $button->post_title, 'membership_level_id' => get_post_meta($button_id, 'membership_level_id', true), 'payment_amount' => get_post_meta($button_id, 'payment_amount', true), 'payment_currency' => get_post_meta($button_id, 'payment_currency', true), 'pp_smart_checkout_live_id' => get_post_meta($button_id, 'pp_smart_checkout_live_id', true), 'pp_smart_checkout_live_sec' => get_post_meta($button_id, 'pp_smart_checkout_live_sec', true), 'pp_smart_checkout_test_id' => get_post_meta($button_id, 'pp_smart_checkout_test_id', true), 'pp_smart_checkout_test_sec' => get_post_meta($button_id, 'pp_smart_checkout_test_sec', true), 'pp_smart_checkout_btn_size' => get_post_meta($button_id, 'pp_smart_checkout_btn_size', true), 'pp_smart_checkout_btn_color' => get_post_meta($button_id, 'pp_smart_checkout_btn_color', true), 'pp_smart_checkout_btn_shape' => get_post_meta($button_id, 'pp_smart_checkout_btn_shape', true), 'pp_smart_checkout_btn_layout' => get_post_meta($button_id, 'pp_smart_checkout_btn_layout', true), 'pp_smart_checkout_payment_method_credit' => get_post_meta($button_id, 'pp_smart_checkout_payment_method_credit', true), 'pp_smart_checkout_payment_method_elv' => get_post_meta($button_id, 'pp_smart_checkout_payment_method_elv', true), 'return_url' => get_post_meta($button_id, 'return_url', true), ); render_save_edit_pp_smart_checkout_button_interface($bt_opts, true); } /* * Process submission and save the new or edit PayPal Smart Checkout payment button data */ add_action('swpm_create_new_button_process_submission', 'swpm_save_edit_pp_smart_checkout_button_data'); add_action('swpm_edit_payment_button_process_submission', 'swpm_save_edit_pp_smart_checkout_button_data'); //I've merged two (save and edit events) into one function swpm_save_edit_pp_smart_checkout_button_data() { $btn_size = isset($_POST['pp_smart_checkout_btn_size']) ? sanitize_text_field($_POST['pp_smart_checkout_btn_size']) : ''; $btn_color = isset($_POST['pp_smart_checkout_btn_color']) ? sanitize_text_field($_POST['pp_smart_checkout_btn_color']) : ''; $btn_shape = isset($_POST['pp_smart_checkout_btn_shape']) ? sanitize_text_field($_POST['pp_smart_checkout_btn_shape']) : ''; $btn_layout = isset($_POST['pp_smart_checkout_btn_layout']) ? sanitize_text_field($_POST['pp_smart_checkout_btn_layout']) : ''; $pm_credit = isset($_POST['pp_smart_checkout_payment_method_credit']) ? sanitize_text_field($_POST['pp_smart_checkout_payment_method_credit']) : ''; $pm_elv = isset($_POST['pp_smart_checkout_payment_method_elv']) ? sanitize_text_field($_POST['pp_smart_checkout_payment_method_elv']) : ''; if (isset($_REQUEST['swpm_pp_smart_checkout_save_submit'])) { //This is a PayPal Smart Checkout button save event. check_admin_referer( 'swpm_admin_add_edit_pp_smart_checkout_btn', 'swpm_admin_add_edit_pp_smart_checkout_btn' ); $button_id = wp_insert_post( array( 'post_title' => sanitize_text_field($_REQUEST['button_name']), 'post_type' => 'swpm_payment_button', 'post_content' => '', 'post_status' => 'publish' ) ); $button_type = sanitize_text_field($_REQUEST['button_type']); add_post_meta($button_id, 'button_type', $button_type); add_post_meta($button_id, 'membership_level_id', sanitize_text_field($_REQUEST['membership_level_id'])); add_post_meta($button_id, 'payment_amount', trim(sanitize_text_field($_REQUEST['payment_amount']))); add_post_meta($button_id, 'payment_currency', trim(sanitize_text_field($_REQUEST['payment_currency']))); add_post_meta($button_id, 'pp_smart_checkout_live_id', trim(sanitize_text_field($_REQUEST['pp_smart_checkout_live_id']))); add_post_meta($button_id, 'pp_smart_checkout_live_sec', trim(sanitize_text_field($_REQUEST['pp_smart_checkout_live_sec']))); add_post_meta($button_id, 'pp_smart_checkout_test_id', trim(sanitize_text_field($_REQUEST['pp_smart_checkout_test_id']))); add_post_meta($button_id, 'pp_smart_checkout_test_sec', trim(sanitize_text_field($_REQUEST['pp_smart_checkout_test_sec']))); add_post_meta($button_id, 'pp_smart_checkout_btn_size', $btn_size); add_post_meta($button_id, 'pp_smart_checkout_btn_color', $btn_color); add_post_meta($button_id, 'pp_smart_checkout_btn_shape', $btn_shape); add_post_meta($button_id, 'pp_smart_checkout_btn_layout', $btn_layout); add_post_meta($button_id, 'pp_smart_checkout_payment_method_credit', $pm_credit); add_post_meta($button_id, 'pp_smart_checkout_payment_method_elv', $pm_elv); add_post_meta($button_id, 'return_url', trim(sanitize_text_field($_REQUEST['return_url']))); //Redirect to the manage payment buttons interface $url = admin_url() . 'admin.php?page=simple_wp_membership_payments&tab=payment_buttons'; SwpmMiscUtils::redirect_to_url($url); } if (isset($_REQUEST['swpm_pp_smart_checkout_edit_submit'])) { //This is a PayPal Smart Checkout button edit event. check_admin_referer( 'swpm_admin_add_edit_pp_smart_checkout_btn', 'swpm_admin_add_edit_pp_smart_checkout_btn' ); $button_id = sanitize_text_field($_REQUEST['button_id']); $button_id = absint($button_id); $button_type = sanitize_text_field($_REQUEST['button_type']); $button_name = sanitize_text_field($_REQUEST['button_name']); $button_post = array( 'ID' => $button_id, 'post_title' => $button_name, 'post_type' => 'swpm_payment_button', ); wp_update_post($button_post); update_post_meta($button_id, 'button_type', $button_type); update_post_meta($button_id, 'membership_level_id', sanitize_text_field($_REQUEST['membership_level_id'])); update_post_meta($button_id, 'payment_amount', trim(sanitize_text_field($_REQUEST['payment_amount']))); update_post_meta($button_id, 'payment_currency', trim(sanitize_text_field($_REQUEST['payment_currency']))); update_post_meta($button_id, 'pp_smart_checkout_live_id', trim(sanitize_text_field($_REQUEST['pp_smart_checkout_live_id']))); update_post_meta($button_id, 'pp_smart_checkout_live_sec', trim(sanitize_text_field($_REQUEST['pp_smart_checkout_live_sec']))); update_post_meta($button_id, 'pp_smart_checkout_test_id', trim(sanitize_text_field($_REQUEST['pp_smart_checkout_test_id']))); update_post_meta($button_id, 'pp_smart_checkout_test_sec', trim(sanitize_text_field($_REQUEST['pp_smart_checkout_test_sec']))); update_post_meta($button_id, 'pp_smart_checkout_btn_size', $btn_size); update_post_meta($button_id, 'pp_smart_checkout_btn_color', $btn_color); update_post_meta($button_id, 'pp_smart_checkout_btn_shape', $btn_shape); update_post_meta($button_id, 'pp_smart_checkout_btn_layout', $btn_layout); update_post_meta($button_id, 'pp_smart_checkout_payment_method_credit', $pm_credit); update_post_meta($button_id, 'pp_smart_checkout_payment_method_elv', $pm_elv); update_post_meta($button_id, 'return_url', trim(sanitize_text_field($_REQUEST['return_url']))); echo '

    '. __('Payment button data successfully updated!', 'simple-membership'). '

    '; } } payments/payment-gateway/admin_stripe_buy_now_button.php000064400000067617147206770760020105 0ustar00'; echo '

    '.__('The Stripe payment gateway libary requires at least PHP 5.6.0. Your server is using a very old version of PHP that Stripe does not support.', 'simple-membership').'

    '; echo '

    '. __('Request your hosting provider to upgrade your PHP to a more recent version then you will be able to use the Stripe gateway.', 'simple-membership').'

    '; echo ''; return; } ?>

      ', 'simple-membership') ?>

    Payment Settings tab.' , 'simple-membership'); ?>

    sanitize_text_field( $_REQUEST['button_name'] ), 'post_type' => 'swpm_payment_button', 'post_content' => '', 'post_status' => 'publish', ) ); $button_type = sanitize_text_field( $_REQUEST['button_type'] ); add_post_meta( $button_id, 'button_type', $button_type ); add_post_meta( $button_id, 'membership_level_id', sanitize_text_field( $_REQUEST['membership_level_id'] ) ); add_post_meta( $button_id, 'payment_amount', trim( sanitize_text_field( $_REQUEST['payment_amount'] ) ) ); add_post_meta( $button_id, 'payment_currency', sanitize_text_field( $_REQUEST['payment_currency'] ) ); $stripe_test_secret_key = isset( $_POST['stripe_test_secret_key'] ) ? sanitize_text_field( stripslashes ( $_POST['stripe_test_secret_key'] ) ) : ''; $stripe_test_publishable_key = isset( $_POST['stripe_test_publishable_key'] ) ? sanitize_text_field( stripslashes ( $_POST['stripe_test_publishable_key'] ) ) : ''; if ( ! is_null( $stripe_test_secret_key ) ) { update_post_meta( $button_id, 'stripe_test_secret_key', trim( $stripe_test_secret_key ) ); } if ( ! is_null( $stripe_test_publishable_key ) ) { update_post_meta( $button_id, 'stripe_test_publishable_key', trim( $stripe_test_publishable_key ) ); } $stripe_live_secret_key = isset( $_POST['stripe_live_secret_key'] ) ? sanitize_text_field( stripslashes ( $_POST['stripe_live_secret_key'] ) ) : ''; $stripe_live_publishable_key = isset( $_POST['stripe_live_publishable_key'] ) ? sanitize_text_field( stripslashes ( $_POST['stripe_live_publishable_key'] ) ) : ''; if ( ! is_null( $stripe_live_secret_key ) ) { update_post_meta( $button_id, 'stripe_live_secret_key', trim( $stripe_live_secret_key ) ); } if ( ! is_null( $stripe_live_publishable_key ) ) { update_post_meta( $button_id, 'stripe_live_publishable_key', trim( $stripe_live_publishable_key ) ); } $stripe_use_global_keys = filter_input( INPUT_POST, 'stripe_use_global_keys', FILTER_SANITIZE_NUMBER_INT ); $stripe_use_global_keys = $stripe_use_global_keys ? true : false; update_post_meta( $button_id, 'stripe_use_global_keys', $stripe_use_global_keys ); add_post_meta( $button_id, 'stripe_collect_address', isset( $_POST['collect_address'] ) ? '1' : '' ); add_post_meta( $button_id, 'return_url', trim( sanitize_text_field( $_REQUEST['return_url'] ) ) ); add_post_meta( $button_id, 'button_image_url', esc_url( $_REQUEST['button_image_url'] ) ); //Redirect to the edit interface of this button with $button_id //$url = admin_url() . 'admin.php?page=simple_wp_membership_payments&tab=edit_button&button_id=' . $button_id . '&button_type=' . $button_type; //Redirect to the manage payment buttons interface $url = admin_url() . 'admin.php?page=simple_wp_membership_payments&tab=payment_buttons'; SwpmMiscUtils::redirect_to_url( $url ); } } /* * ********************************************************************** * End of new Stripe Buy now payment button stuff * ********************************************************************** */ /* * *************************************************************** * Render edit Stripe Buy now payment button interface * ************************************************************** */ add_action( 'swpm_edit_payment_button_for_stripe_buy_now', 'swpm_edit_stripe_buy_now_button' ); function swpm_edit_stripe_buy_now_button() { //Retrieve the payment button data and present it for editing. $button_id = sanitize_text_field( $_REQUEST['button_id'] ); $button_id = absint( $button_id ); $button_type = sanitize_text_field( $_REQUEST['button_type'] ); $button = get_post( $button_id ); //Retrieve the CPT for this button $membership_level_id = get_post_meta( $button_id, 'membership_level_id', true ); $payment_amount = get_post_meta( $button_id, 'payment_amount', true ); $payment_currency = get_post_meta( $button_id, 'payment_currency', true ); $stripe_test_secret_key = get_post_meta( $button_id, 'stripe_test_secret_key', true ); $stripe_test_publishable_key = get_post_meta( $button_id, 'stripe_test_publishable_key', true ); $stripe_live_secret_key = get_post_meta( $button_id, 'stripe_live_secret_key', true ); $stripe_live_publishable_key = get_post_meta( $button_id, 'stripe_live_publishable_key', true ); $collect_address = get_post_meta( $button_id, 'stripe_collect_address', true ); if ( $collect_address == '1' ) { $collect_address = ' checked'; } else { $collect_address = ''; } $use_global_keys = get_post_meta( $button_id, 'stripe_use_global_keys', true ); $use_global_keys = empty( $use_global_keys ) ? false : true; $return_url = get_post_meta( $button_id, 'return_url', true ); $button_image_url = get_post_meta( $button_id, 'button_image_url', true ); ?>

    />

    Payment Settings tab.' , 'simple-membership'); ?>

    />

    $button_id, 'post_title' => $button_name, 'post_type' => 'swpm_payment_button', ); wp_update_post( $button_post ); update_post_meta( $button_id, 'button_type', $button_type ); update_post_meta( $button_id, 'membership_level_id', sanitize_text_field( $_REQUEST['membership_level_id'] ) ); update_post_meta( $button_id, 'payment_amount', trim( sanitize_text_field( $_REQUEST['payment_amount'] ) ) ); update_post_meta( $button_id, 'payment_currency', sanitize_text_field( $_REQUEST['payment_currency'] ) ); $stripe_test_secret_key = isset( $_POST['stripe_test_secret_key'] ) ? sanitize_text_field( stripslashes ( $_POST['stripe_test_secret_key'] ) ) : ''; $stripe_test_publishable_key = isset( $_POST['stripe_test_publishable_key'] ) ? sanitize_text_field( stripslashes ( $_POST['stripe_test_publishable_key'] ) ) : ''; if ( ! is_null( $stripe_test_secret_key ) ) { update_post_meta( $button_id, 'stripe_test_secret_key', trim( $stripe_test_secret_key ) ); } if ( ! is_null( $stripe_test_publishable_key ) ) { update_post_meta( $button_id, 'stripe_test_publishable_key', trim( $stripe_test_publishable_key ) ); } $stripe_live_secret_key = isset( $_POST['stripe_live_secret_key'] ) ? sanitize_text_field( stripslashes ( $_POST['stripe_live_secret_key'] ) ) : ''; $stripe_live_publishable_key = isset( $_POST['stripe_live_publishable_key'] ) ? sanitize_text_field( stripslashes ( $_POST['stripe_live_publishable_key'] ) ) : ''; if ( ! is_null( $stripe_live_secret_key ) ) { update_post_meta( $button_id, 'stripe_live_secret_key', trim( $stripe_live_secret_key ) ); } if ( ! is_null( $stripe_live_publishable_key ) ) { update_post_meta( $button_id, 'stripe_live_publishable_key', trim( $stripe_live_publishable_key ) ); } update_post_meta( $button_id, 'stripe_collect_address', isset( $_POST['collect_address'] ) ? '1' : '' ); $stripe_use_global_keys = filter_input( INPUT_POST, 'stripe_use_global_keys', FILTER_SANITIZE_NUMBER_INT ); $stripe_use_global_keys = $stripe_use_global_keys ? true : false; update_post_meta( $button_id, 'stripe_use_global_keys', $stripe_use_global_keys ); update_post_meta( $button_id, 'stripe_collect_address', isset( $_POST['collect_address'] ) ? '1' : '' ); update_post_meta( $button_id, 'return_url', trim( sanitize_text_field( $_REQUEST['return_url'] ) ) ); update_post_meta( $button_id, 'button_image_url', esc_url( $_REQUEST['button_image_url'] ) ); echo '

    '.__('Payment button data successfully updated!', 'simple-membership').'

    '; } } /************************************************************************ * End of edit Stripe Buy now payment button stuff ************************************************************************/ payments/payment-gateway/admin_stripe_subscription_button.php000064400000041346147206770760021136 0ustar00'; echo '

    The Stripe payment gateway libary requires at least PHP 5.6.0. Your server is using a very old version of PHP that Stripe does not support.

    '; echo '

    Request your hosting provider to upgrade your PHP to a more recent version then you will be able to use the Stripe gateway.

    '; echo '

    '; return; } if ( isset( $opts['stripe_use_global_keys'][0] ) ) { $use_global_keys = $opts['stripe_use_global_keys'][0]; } else { $use_global_keys = $edit ? false : true; } $stripe_test_publishable_key = isset( $opts['stripe_test_publishable_key'][0] ) ? $opts['stripe_test_publishable_key'][0] : ''; $stripe_test_secret_key = isset( $opts['stripe_test_secret_key'][0] ) ? $opts['stripe_test_secret_key'][0] : ''; $stripe_live_publishable_key = isset( $opts['stripe_live_publishable_key'][0] ) ? $opts['stripe_live_publishable_key'][0] : ''; $stripe_live_secret_key = isset( $opts['stripe_live_secret_key'][0] ) ? $opts['stripe_live_secret_key'][0] : ''; function swpm_stripe_subscr_gen_curr_opts( $selected = false ) { $curr_arr = array( 'USD' => 'US Dollars ($)', 'EUR' => 'Euros (€)', 'GBP' => 'Pounds Sterling (£)', 'AUD' => 'Australian Dollars ($)', 'BRL' => 'Brazilian Real (R$)', 'CAD' => 'Canadian Dollars ($)', 'CNY' => 'Chinese Yuan', 'CZK' => 'Czech Koruna', 'DKK' => 'Danish Krone', 'HKD' => 'Hong Kong Dollar ($)', 'HUF' => 'Hungarian Forint', 'INR' => 'Indian Rupee', 'IDR' => 'Indonesia Rupiah', 'ILS' => 'Israeli Shekel', 'JPY' => 'Japanese Yen (¥)', 'MYR' => 'Malaysian Ringgits', 'MXN' => 'Mexican Peso ($)', 'NZD' => 'New Zealand Dollar ($)', 'NOK' => 'Norwegian Krone', 'PHP' => 'Philippine Pesos', 'PLN' => 'Polish Zloty', 'SGD' => 'Singapore Dollar ($)', 'ZAR' => 'South African Rand (R)', 'KRW' => 'South Korean Won', 'SEK' => 'Swedish Krona', 'CHF' => 'Swiss Franc', 'TWD' => 'Taiwan New Dollars', 'THB' => 'Thai Baht', 'TRY' => 'Turkish Lira', 'VND' => 'Vietnamese Dong', ); $out = ''; foreach ( $curr_arr as $key => $value ) { if ( $selected !== false && $selected == $key ) { $sel = ' selected'; } else { $sel = ''; } $out .= ''; } return $out; } ?>
    View the documentation  to learn how to create a Stripe Subscription payment button and use it.

    This is the ID of this payment button. It is automatically generated for you and it cannot be changed.

    Give this membership payment button a name. Example: Gold membership payment

    Select the membership level this payment button is for.

    ID of the plan that you want subscribers to be assigned to. You can get more details in the documentation.

    />

    Payment Settings tab.' ); ?>

    Enter your Stripe test publishable key.

    Enter your Stripe test secret key.

    Enter your Stripe live publishable key.

    Enter your Stripe live secret key.

    You should create a new Webhook in your Stripe account and put this URL there if you want the plugin to handle subscription expiration automatically.
    You can get more info in the documentation.

    />

    Enable this option if you want to collect customer address during Stripe checkout.

    This is the URL the user will be redirected to after a successful payment. Enter the URL of your Thank You page here.

    If you want to customize the look of the button using an image then enter the URL of the image.

    post_title; $post_meta['button_id'] = $button_id; swpm_render_new_edit_stripe_subscription_button_interface( $post_meta, true ); } /* * Process submission and save the new PayPal Subscription payment button data */ add_action( 'swpm_create_new_button_process_submission', 'swpm_save_edit_stripe_subscription_button_data' ); add_action( 'swpm_edit_payment_button_process_submission', 'swpm_save_edit_stripe_subscription_button_data' ); function swpm_save_edit_stripe_subscription_button_data() { if ( isset( $_REQUEST['swpm_stripe_subscription_save_submit'] ) ) { $edit = false; } if ( isset( $_REQUEST['swpm_stripe_subscription_edit_submit'] ) ) { $edit = true; } if ( isset( $edit ) ) { //This is a Stripe subscription button save or edit event. Process the submission. check_admin_referer( 'swpm_admin_add_edit_stripe_subs_btn', 'swpm_admin_add_edit_stripe_subs_btn' ); if ( $edit ) { $button_id = sanitize_text_field( $_REQUEST['button_id'] ); $button_id = absint( $button_id ); $button_type = sanitize_text_field( $_REQUEST['button_type'] ); $button_name = sanitize_text_field( $_REQUEST['button_name'] ); $button_post = array( 'ID' => $button_id, 'post_title' => $button_name, 'post_type' => 'swpm_payment_button', ); wp_update_post( $button_post ); } else { $button_id = wp_insert_post( array( 'post_title' => sanitize_text_field( $_REQUEST['button_name'] ), 'post_type' => 'swpm_payment_button', 'post_content' => '', 'post_status' => 'publish', ) ); $button_type = sanitize_text_field( $_REQUEST['button_type'] ); } update_post_meta( $button_id, 'button_type', $button_type ); update_post_meta( $button_id, 'membership_level_id', sanitize_text_field( $_REQUEST['membership_level_id'] ) ); update_post_meta( $button_id, 'return_url', trim( sanitize_text_field( $_REQUEST['return_url'] ) ) ); update_post_meta( $button_id, 'button_image_url', trim( sanitize_text_field( $_REQUEST['button_image_url'] ) ) ); update_post_meta( $button_id, 'stripe_collect_address', isset( $_POST['collect_address'] ) ? '1' : '' ); //API details $stripe_test_secret_key = isset( $_POST['stripe_test_secret_key'] ) ? sanitize_text_field( stripslashes ( $_POST['stripe_test_secret_key'] ) ) : ''; $stripe_test_publishable_key = isset( $_POST['stripe_test_publishable_key'] ) ? sanitize_text_field( stripslashes ( $_POST['stripe_test_publishable_key'] ) ) : ''; $stripe_live_secret_key = isset( $_POST['stripe_live_secret_key'] ) ? sanitize_text_field( stripslashes ( $_POST['stripe_live_secret_key'] ) ) : ''; $stripe_live_publishable_key = isset( $_POST['stripe_live_publishable_key'] ) ? sanitize_text_field( stripslashes ( $_POST['stripe_live_publishable_key'] ) ) : ''; if ( isset( $stripe_test_secret_key ) ) { update_post_meta( $button_id, 'stripe_test_secret_key', sanitize_text_field( $stripe_test_secret_key ) ); } if ( isset( $stripe_test_publishable_key ) ) { update_post_meta( $button_id, 'stripe_test_publishable_key', sanitize_text_field( $stripe_test_publishable_key ) ); } if ( isset( $stripe_live_secret_key ) ) { update_post_meta( $button_id, 'stripe_live_secret_key', sanitize_text_field( $stripe_live_secret_key ) ); } if ( isset( $stripe_live_publishable_key ) ) { update_post_meta( $button_id, 'stripe_live_publishable_key', sanitize_text_field( $stripe_live_publishable_key ) ); } $stripe_use_global_keys = filter_input( INPUT_POST, 'stripe_use_global_keys', FILTER_SANITIZE_NUMBER_INT ); $stripe_use_global_keys = $stripe_use_global_keys ? true : false; update_post_meta( $button_id, 'stripe_use_global_keys', $stripe_use_global_keys ); if ( $edit ) { // let's see if Stripe details (plan ID and Secret Key) are valid $stripe_error_msg = ''; $settings = SwpmSettings::get_instance(); $sandbox_enabled = $settings->get_value( 'enable-sandbox-testing' ); if ( $sandbox_enabled ) { $secret_key = $stripe_test_secret_key ? $stripe_test_secret_key : $settings->get_value( 'stripe-test-secret-key' ); } else { $secret_key = $stripe_live_secret_key ? $stripe_live_secret_key : $settings->get_value( 'stripe-live-secret-key' ); } require_once SIMPLE_WP_MEMBERSHIP_PATH . 'lib/stripe-util-functions.php'; $result = StripeUtilFunctions::get_stripe_plan_info( $secret_key, sanitize_text_field( $_REQUEST['stripe_plan_id'] ) ); if ( $result['success'] ) { $plan_data = $result['plan_data']; } else { $stripe_error_msg = $result['error_msg']; } } //Subscription billing details update_post_meta( $button_id, 'stripe_plan_id', sanitize_text_field( $_REQUEST['stripe_plan_id'] ) ); update_post_meta( $button_id, 'stripe_plan_data', ( isset( $plan_data ) ? $plan_data : false ) ); if ( $edit ) { if ( empty( $stripe_error_msg ) ) { echo '

    Payment button data successfully updated!

    '; } else { echo '

    ' . $stripe_error_msg . '

    '; } } else { //Redirect to the edit interface of this button with $button_id $url = admin_url() . 'admin.php?page=simple_wp_membership_payments&tab=edit_button&button_id=' . $button_id . '&button_type=' . $button_type; SwpmMiscUtils::redirect_to_url( $url ); } } } payments/payment-gateway/admin_paypal_buy_now_button.php000064400000060676147206770760020063 0ustar00
     

    sanitize_text_field($_REQUEST['button_name']), 'post_type' => 'swpm_payment_button', 'post_content' => '', 'post_status' => 'publish' ) ); $button_type = sanitize_text_field($_REQUEST['button_type']); add_post_meta($button_id, 'button_type', $button_type); add_post_meta($button_id, 'membership_level_id', sanitize_text_field($_REQUEST['membership_level_id'])); add_post_meta($button_id, 'payment_amount', trim(sanitize_text_field($_REQUEST['payment_amount']))); add_post_meta($button_id, 'payment_currency', sanitize_text_field($_REQUEST['payment_currency'])); add_post_meta($button_id, 'return_url', trim(sanitize_text_field($_REQUEST['return_url']))); add_post_meta($button_id, 'paypal_email', trim(sanitize_email($_REQUEST['paypal_email']))); add_post_meta($button_id, 'button_image_url', trim(sanitize_text_field($_REQUEST['button_image_url']))); add_post_meta($button_id, 'checkout_logo_image_url', trim(sanitize_text_field($_REQUEST['checkout_logo_image_url']))); //Redirect to the edit interface of this button with $button_id //$url = admin_url() . 'admin.php?page=simple_wp_membership_payments&tab=edit_button&button_id=' . $button_id . '&button_type=' . $button_type; //Redirect to the manage payment buttons interface $url = admin_url() . 'admin.php?page=simple_wp_membership_payments&tab=payment_buttons'; SwpmMiscUtils::redirect_to_url($url); } } /* * ********************************************************************** * End of new PayPal Buy now payment button stuff * ********************************************************************** */ /* * *************************************************************** * Render edit PayPal Buy now payment button interface * ************************************************************** */ add_action('swpm_edit_payment_button_for_pp_buy_now', 'swpm_edit_pp_buy_now_button'); function swpm_edit_pp_buy_now_button() { //Retrieve the payment button data and present it for editing. $button_id = sanitize_text_field($_REQUEST['button_id']); $button_id = absint($button_id); $button_type = sanitize_text_field($_REQUEST['button_type']); $button = get_post($button_id); //Retrieve the CPT for this button $membership_level_id = get_post_meta($button_id, 'membership_level_id', true); $payment_amount = get_post_meta($button_id, 'payment_amount', true); $payment_currency = get_post_meta($button_id, 'payment_currency', true); $return_url = get_post_meta($button_id, 'return_url', true); $paypal_email = get_post_meta($button_id, 'paypal_email', true); $button_image_url = get_post_meta($button_id, 'button_image_url', true); $checkout_logo_image_url = get_post_meta($button_id, 'checkout_logo_image_url', true); ?>

    $button_id, 'post_title' => $button_name, 'post_type' => 'swpm_payment_button', ); wp_update_post($button_post); update_post_meta($button_id, 'button_type', $button_type); update_post_meta($button_id, 'membership_level_id', sanitize_text_field($_REQUEST['membership_level_id'])); update_post_meta($button_id, 'payment_amount', trim(sanitize_text_field($_REQUEST['payment_amount']))); update_post_meta($button_id, 'payment_currency', sanitize_text_field($_REQUEST['payment_currency'])); update_post_meta($button_id, 'return_url', trim(sanitize_text_field($_REQUEST['return_url']))); update_post_meta($button_id, 'paypal_email', trim(sanitize_email($_REQUEST['paypal_email']))); update_post_meta($button_id, 'button_image_url', trim(sanitize_text_field($_REQUEST['button_image_url']))); update_post_meta($button_id, 'checkout_logo_image_url', trim(sanitize_text_field($_REQUEST['checkout_logo_image_url']))); echo '

    '. __('Payment button data successfully updated!', 'simple-membership'). '

    '; } } /************************************************************************ * End of edit PayPal Buy now payment button stuff ************************************************************************/payments/payment-gateway/stripe_button_shortcode_view.php000064400000036727147206770760020275 0ustar00Error! swpm_render_stripe_buy_now_button_sc_output() function requires the button ID value to be passed to it.

    '; } //Get class option for button styling, set Stripe's default if none specified $class = isset( $args['class'] ) ? sanitize_html_class($args['class']) : 'stripe-button-el'; //Check new_window parameter $window_target = isset( $args['new_window'] ) ? 'target="_blank"' : ''; $button_text = ( isset( $args['button_text'] ) ) ? esc_attr( $args['button_text'] ) : __( 'Buy Now', 'simple-membership' ); $item_logo = ''; //Can be used to show an item logo or thumbnail in the checkout form. $settings = SwpmSettings::get_instance(); $button_cpt = get_post( $button_id ); //Retrieve the CPT for this button $item_name = htmlspecialchars( $button_cpt->post_title ); $membership_level_id = get_post_meta( $button_id, 'membership_level_id', true ); //Verify that this membership level exists (to prevent user paying for a level that has been deleted) if ( ! SwpmUtils::membership_level_id_exists( $membership_level_id ) ) { return '

    Error! The membership level specified in this button does not exist. You may have deleted this membership level. Edit the button and use the correct membership level.

    '; } //Payment amount and currency $payment_amount = get_post_meta( $button_id, 'payment_amount', true ); if ( ! is_numeric( $payment_amount ) ) { return '

    Error! The payment amount value of the button must be a numeric number. Example: 49.50

    '; } $payment_currency = get_post_meta( $button_id, 'payment_currency', true ); $payment_amount = round( $payment_amount, 2 ); //round the amount to 2 decimal place. $zeroCents = unserialize( SIMPLE_WP_MEMBERSHIP_STRIPE_ZERO_CENTS ); if ( in_array( $payment_currency, $zeroCents ) ) { //this is zero-cents currency, amount shouldn't be multiplied by 100 $price_in_cents = $payment_amount; } else { $price_in_cents = $payment_amount * 100; //The amount (in cents). This value is passed to Stripe API. } $payment_amount_formatted = SwpmMiscUtils::format_money( $payment_amount, $payment_currency ); //Return, cancel, notifiy URLs $notify_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL . '/?swpm_process_stripe_buy_now=1'; //We are going to use it to do post payment processing. //$button_image_url = get_post_meta($button_id, 'button_image_url', true);//Stripe doesn't currenty support button image for their standard checkout. //User's IP address $user_ip = SwpmUtils::get_user_ip_address(); $_SESSION['swpm_payment_button_interaction'] = $user_ip; //Custom field data $custom_field_value = 'subsc_ref=' . $membership_level_id; $custom_field_value .= '&user_ip=' . $user_ip; if ( SwpmMemberUtils::is_member_logged_in() ) { $custom_field_value .= '&swpm_id=' . SwpmMemberUtils::get_logged_in_members_id(); } $custom_field_value = apply_filters( 'swpm_custom_field_value_filter', $custom_field_value ); //Sandbox settings $sandbox_enabled = $settings->get_value( 'enable-sandbox-testing' ); //API keys $api_keys = SwpmMiscUtils::get_stripe_api_keys_from_payment_button( $button_id, ! $sandbox_enabled ); //prefill member email $prefill_member_email = $settings->get_value( 'stripe-prefill-member-email' ); if ( $prefill_member_email ) { $auth = SwpmAuth::get_instance(); $member_email = $auth->get( 'email' ); } //Billing address $billing_address = isset( $args['billing_address'] ) ? '1' : ''; //By default don't show the billing address in the checkout form. //if billing_address parameter is not present in the shortcode, let's check button option if ( $billing_address === '' ) { $collect_address = get_post_meta( $button_id, 'stripe_collect_address', true ); if ( $collect_address === '1' ) { //Collect Address enabled in button settings $billing_address = 1; } } $uniqid = uniqid(); /* === Stripe Buy Now Button Form === */ $output = ''; $output .= '
    '; $output .= "
    "; $output .= "
    "; $output .= "'; $output .= '
    '; $button_image_url = get_post_meta( $button_id, 'button_image_url', true ); if ( ! empty( $button_image_url ) ) { $output .= ''; } else { $output .= ""; } $output .= wp_nonce_field( 'stripe_payments', '_wpnonce', true, false ); $output .= ''; $output .= ""; $output .= ""; $output .= ""; $output .= ""; //Filter to add additional payment input fields to the form. $output .= apply_filters( 'swpm_stripe_payment_form_additional_fields', '' ); $output .= '
    '; $output .= '
    '; //End .swpm_button_wrapper return $output; } payments/payment-gateway/admin_stripe_sca_subscription_button.php000064400000046225147206770760021765 0ustar00'; echo '

    '.__('The Stripe payment gateway libary requires at least PHP 5.6.0. Your server is using a very old version of PHP that Stripe does not support.', 'simple-membership').'

    '; echo '

    '.__('Request your hosting provider to upgrade your PHP to a more recent version then you will be able to use the Stripe gateway.', 'simple-membership').'

    '; echo ''; return; } if ( isset( $opts['stripe_use_global_keys'][0] ) ) { $use_global_keys = $opts['stripe_use_global_keys'][0]; } else { $use_global_keys = $edit ? false : true; } $stripe_test_publishable_key = isset( $opts['stripe_test_publishable_key'][0] ) ? $opts['stripe_test_publishable_key'][0] : ''; $stripe_test_secret_key = isset( $opts['stripe_test_secret_key'][0] ) ? $opts['stripe_test_secret_key'][0] : ''; $stripe_live_publishable_key = isset( $opts['stripe_live_publishable_key'][0] ) ? $opts['stripe_live_publishable_key'][0] : ''; $stripe_live_secret_key = isset( $opts['stripe_live_secret_key'][0] ) ? $opts['stripe_live_secret_key'][0] : ''; function swpm_stripe_sca_subscr_gen_curr_opts( $selected = false ) { $curr_arr = array( 'USD' => 'US Dollars ($)', 'EUR' => 'Euros (€)', 'GBP' => 'Pounds Sterling (£)', 'AUD' => 'Australian Dollars ($)', 'BRL' => 'Brazilian Real (R$)', 'CAD' => 'Canadian Dollars ($)', 'CNY' => 'Chinese Yuan', 'CZK' => 'Czech Koruna', 'DKK' => 'Danish Krone', 'HKD' => 'Hong Kong Dollar ($)', 'HUF' => 'Hungarian Forint', 'INR' => 'Indian Rupee', 'IDR' => 'Indonesia Rupiah', 'ILS' => 'Israeli Shekel', 'JPY' => 'Japanese Yen (¥)', 'MYR' => 'Malaysian Ringgits', 'MXN' => 'Mexican Peso ($)', 'NZD' => 'New Zealand Dollar ($)', 'NOK' => 'Norwegian Krone', 'PHP' => 'Philippine Pesos', 'PLN' => 'Polish Zloty', 'SGD' => 'Singapore Dollar ($)', 'ZAR' => 'South African Rand (R)', 'KRW' => 'South Korean Won', 'SEK' => 'Swedish Krona', 'CHF' => 'Swiss Franc', 'TWD' => 'Taiwan New Dollars', 'THB' => 'Thai Baht', 'TRY' => 'Turkish Lira', 'VND' => 'Vietnamese Dong', ); $out = ''; foreach ( $curr_arr as $key => $value ) { if ( $selected !== false && $selected == $key ) { $sel = ' selected'; } else { $sel = ''; } $out .= ''; } return $out; } ?>

     

    .

    />

    Payment Settings tab.', 'simple-membership' ); ?>

    .

    />

    />

    post_title; $post_meta['button_id'] = $button_id; swpm_render_new_edit_stripe_sca_subscription_button_interface( $post_meta, true ); } /* * Process submission and save the new PayPal Subscription payment button data */ add_action( 'swpm_create_new_button_process_submission', 'swpm_save_edit_stripe_sca_subscription_button_data' ); add_action( 'swpm_edit_payment_button_process_submission', 'swpm_save_edit_stripe_sca_subscription_button_data' ); function swpm_save_edit_stripe_sca_subscription_button_data() { if ( isset( $_REQUEST['swpm_stripe_sca_subscription_save_submit'] ) ) { $edit = false; } if ( isset( $_REQUEST['swpm_stripe_sca_subscription_edit_submit'] ) ) { $edit = true; } if ( isset( $edit ) ) { //This is a Stripe subscription button save or edit event. Process the submission. check_admin_referer( 'swpm_admin_add_edit_stripe_sca_subs_btn', 'swpm_admin_add_edit_stripe_sca_subs_btn' ); if ( $edit ) { $button_id = sanitize_text_field( $_REQUEST['button_id'] ); $button_id = absint( $button_id ); $button_type = sanitize_text_field( $_REQUEST['button_type'] ); $button_name = sanitize_text_field( $_REQUEST['button_name'] ); $button_post = array( 'ID' => $button_id, 'post_title' => $button_name, 'post_type' => 'swpm_payment_button', ); wp_update_post( $button_post ); } else { $button_id = wp_insert_post( array( 'post_title' => sanitize_text_field( $_REQUEST['button_name'] ), 'post_type' => 'swpm_payment_button', 'post_content' => '', 'post_status' => 'publish', ) ); $button_type = sanitize_text_field( $_REQUEST['button_type'] ); } update_post_meta( $button_id, 'button_type', $button_type ); update_post_meta( $button_id, 'membership_level_id', sanitize_text_field( $_REQUEST['membership_level_id'] ) ); update_post_meta( $button_id, 'return_url', trim( sanitize_text_field( $_REQUEST['return_url'] ) ) ); $cancel_url = isset($_POST['cancel_url']) && !empty($_POST['cancel_url']) ? trim(sanitize_text_field($_POST['cancel_url'])) : ''; update_post_meta( $button_id, 'cancel_url', $cancel_url ); update_post_meta( $button_id, 'button_image_url', trim( sanitize_text_field( $_REQUEST['button_image_url'] ) ) ); update_post_meta( $button_id, 'stripe_collect_address', isset( $_POST['collect_address'] ) ? '1' : '' ); update_post_meta( $button_id, 'stripe_automatic_tax', isset( $_POST['automatic_tax'] ) ? '1' : '' ); //API details $stripe_test_secret_key = isset( $_POST['stripe_test_secret_key'] ) ? sanitize_text_field( stripslashes ( $_POST['stripe_test_secret_key'] ) ) : ''; $stripe_test_publishable_key = isset( $_POST['stripe_test_publishable_key'] ) ? sanitize_text_field( stripslashes ( $_POST['stripe_test_publishable_key'] ) ) : ''; $stripe_live_secret_key = isset( $_POST['stripe_live_secret_key'] ) ? sanitize_text_field( stripslashes ( $_POST['stripe_live_secret_key'] ) ) : ''; $stripe_live_publishable_key = isset( $_POST['stripe_live_publishable_key'] ) ? sanitize_text_field( stripslashes ( $_POST['stripe_live_publishable_key'] ) ) : ''; if ( isset( $stripe_test_secret_key ) ) { update_post_meta( $button_id, 'stripe_test_secret_key', sanitize_text_field( $stripe_test_secret_key ) ); } if ( isset( $stripe_test_publishable_key ) ) { update_post_meta( $button_id, 'stripe_test_publishable_key', sanitize_text_field( $stripe_test_publishable_key ) ); } if ( isset( $stripe_live_secret_key ) ) { update_post_meta( $button_id, 'stripe_live_secret_key', sanitize_text_field( $stripe_live_secret_key ) ); } if ( isset( $stripe_live_publishable_key ) ) { update_post_meta( $button_id, 'stripe_live_publishable_key', sanitize_text_field( $stripe_live_publishable_key ) ); } $stripe_use_global_keys = filter_input( INPUT_POST, 'stripe_use_global_keys', FILTER_SANITIZE_NUMBER_INT ); $stripe_use_global_keys = $stripe_use_global_keys ? true : false; update_post_meta( $button_id, 'stripe_use_global_keys', $stripe_use_global_keys ); if ( $edit ) { // let's see if Stripe details (plan ID and Secret Key) are valid $stripe_error_msg = ''; $settings = SwpmSettings::get_instance(); $sandbox_enabled = $settings->get_value( 'enable-sandbox-testing' ); if ( $sandbox_enabled ) { $secret_key = $stripe_test_secret_key ? $stripe_test_secret_key : $settings->get_value( 'stripe-test-secret-key' ); } else { $secret_key = $stripe_live_secret_key ? $stripe_live_secret_key : $settings->get_value( 'stripe-live-secret-key' ); } require_once SIMPLE_WP_MEMBERSHIP_PATH . 'lib/stripe-util-functions.php'; $result = StripeUtilFunctions::get_stripe_plan_info( $secret_key, sanitize_text_field( $_REQUEST['stripe_plan_id'] ) ); if ( $result['success'] ) { $plan_data = $result['plan_data']; } else { $stripe_error_msg = $result['error_msg']; } } //Subscription billing details update_post_meta( $button_id, 'stripe_plan_id', sanitize_text_field( $_REQUEST['stripe_plan_id'] ) ); update_post_meta( $button_id, 'stripe_trial_period', sanitize_text_field( $_REQUEST['stripe_trial_period'] ) ); update_post_meta( $button_id, 'stripe_plan_data', ( isset( $plan_data ) ? $plan_data : false ) ); if ( $edit ) { if ( empty( $stripe_error_msg ) ) { echo '

    '.__('Payment button data successfully updated!', 'simple-membership').'

    '; } else { echo '

    ' . $stripe_error_msg . '

    '; } } else { //Redirect to the manage payment buttons interface $url = admin_url() . 'admin.php?page=simple_wp_membership_payments&tab=payment_buttons'; SwpmMiscUtils::redirect_to_url( $url ); } } } payments/payment-gateway/paypal_subscription_new_button_shortcode_view.php000064400000036716147206770760023730 0ustar00'.__('Error! swpm_render_pp_subscription_new_button_sc_output() function requires the button ID value to be passed to it.', 'simple-membership').'

    '; } //Membership level for this button $membership_level_id = get_post_meta($button_id, 'membership_level_id', true); //Verify that this membership level exists (to prevent user paying for a level that has been deleted) if (!SwpmUtils::membership_level_id_exists($membership_level_id)) { return '

    '.__('Error! The membership level specified in this button does not exist. You may have deleted this membership level. Edit the button and use the correct membership level.', 'simple-membership').'

    '; } //Get the Item name for this button. This will be used as the item name in the IPN. $button_cpt = get_post($button_id); //Retrieve the CPT for this button $item_name = htmlspecialchars($button_cpt->post_title); //User's IP address $user_ip = SwpmUtils::get_user_ip_address(); //Custom field data $custom_field_value = 'subsc_ref=' . $membership_level_id; $custom_field_value .= '&user_ip=' . $user_ip; if (SwpmMemberUtils::is_member_logged_in()) { $member_id = SwpmMemberUtils::get_logged_in_members_id(); $custom_field_value .= '&swpm_id=' . $member_id; //$member_first_name = SwpmMemberUtils::get_member_field_by_id($member_id, 'first_name'); //$member_last_name = SwpmMemberUtils::get_member_field_by_id($member_id, 'last_name'); //$member_email = SwpmMemberUtils::get_member_field_by_id($member_id, 'email'); } $custom_field_value = apply_filters('swpm_custom_field_value_filter', $custom_field_value); /***************************************** * Settings and Button Specific Configuration *****************************************/ $settings = SwpmSettings::get_instance(); $live_client_id = $settings->get_value('paypal-live-client-id'); $sandbox_client_id = $settings->get_value('paypal-sandbox-client-id'); $sandbox_enabled = $settings->get_value('enable-sandbox-testing'); $is_live_mode = $sandbox_enabled ? 0 : 1; $currency = get_post_meta( $button_id, 'payment_currency', true ); $disable_funding_card = get_post_meta( $button_id, 'pp_subscription_new_disable_funding_card', true ); $disable_funding_credit = get_post_meta( $button_id, 'pp_subscription_new_disable_funding_credit', true ); $disable_funding_venmo = get_post_meta( $button_id, 'pp_subscription_new_disable_funding_venmo', true ); $disable_funding = array(); if( !empty($disable_funding_card)){ $disable_funding[] = 'card'; } if( !empty($disable_funding_credit)){ $disable_funding[] = 'credit'; } if( !empty($disable_funding_venmo)){ $disable_funding[] = 'venmo'; } $btn_type = get_post_meta($button_id, 'pp_subscription_new_btn_type', true); $btn_shape = get_post_meta($button_id, 'pp_subscription_new_btn_shape', true); $btn_layout = get_post_meta($button_id, 'pp_subscription_new_btn_layout', true); $btn_color = get_post_meta($button_id, 'pp_subscription_new_btn_color', true); $btn_width = get_post_meta($button_id, 'pp_subscription_new_btn_width', true); $btn_height = get_post_meta($button_id, 'pp_subscription_new_btn_height', true); $btn_sizes = array( 'small' => 25, 'medium' => 35, 'large' => 45, 'xlarge' => 55 ); $btn_height = isset( $btn_sizes[ $btn_height ] ) ? $btn_sizes[ $btn_height ] : 35; $return_url = get_post_meta($button_id, 'return_url', true); $txn_success_message = __('Transaction completed successfully!', 'simple-membership'); /********************** * PayPal SDK Settings **********************/ //Configure the paypal SDK settings and enqueue the code for SDK loading. $settings_args_sub = array( 'is_live_mode' => $is_live_mode, 'live_client_id' => $live_client_id, 'sandbox_client_id' => $sandbox_client_id, 'currency' => $currency, 'disable-funding' => $disable_funding, /*array('card', 'credit', 'venmo'),*/ 'intent' => 'subscription', /* It is used to set the "intent" parameter in the JS SDK */ 'is_subscription' => 1, /* It is used to set the "vault" parameter in the JS SDK */ ); //Initialize and set the settings args that will be used to load the JS SDK for subscription buttons. $pp_js_button_subscription = SWPM_PayPal_JS_Button_Embed::get_instance(); $pp_js_button_subscription->set_settings_args_for_subscriptions( $settings_args_sub ); //Load the JS SDK for Subscriptions on footer (so it only loads once per page) add_action( 'wp_footer', array($pp_js_button_subscription, 'load_paypal_sdk_for_subscriptions') ); //The on page embed button id is used to identify the button on the page. Useful when there are multiple buttons (of the same item/product) on the same page. $on_page_embed_button_id = $pp_js_button_subscription->get_next_button_id(); //Create nonce for this button. $nonce = wp_create_nonce($on_page_embed_button_id); $swpm_button_wrapper_id = 'swpm-button-wrapper-'.$button_id; $output = ''; ob_start(); ?>
    Error! swpm_render_pp_buy_now_button_sc_output() function requires the button ID value to be passed to it.

    '; } //Check new_window parameter $window_target = isset($args['new_window']) ? 'target="_blank"' : ''; $settings = SwpmSettings::get_instance(); $button_cpt = get_post($button_id); //Retrieve the CPT for this button $membership_level_id = get_post_meta($button_id, 'membership_level_id', true); //Verify that this membership level exists (to prevent user paying for a level that has been deleted) if(!SwpmUtils::membership_level_id_exists($membership_level_id)){ return '

    Error! The membership level specified in this button does not exist. You may have deleted this membership level. Edit the button and use the correct membership level.

    '; } $paypal_email = get_post_meta($button_id, 'paypal_email', true); $payment_amount = get_post_meta($button_id, 'payment_amount', true); if (!is_numeric($payment_amount)) { return '

    Error! The payment amount value of the button must be a numeric number. Example: 49.50

    '; } $payment_amount = round($payment_amount, 2); //round the amount to 2 decimal place. $payment_currency = get_post_meta($button_id, 'payment_currency', true); $sandbox_enabled = $settings->get_value('enable-sandbox-testing'); $notify_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL . '/?swpm_process_ipn=1'; $return_url = get_post_meta($button_id, 'return_url', true); if (empty($return_url)) { $return_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL; } $cancel_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL; $user_ip = SwpmUtils::get_user_ip_address(); $_SESSION['swpm_payment_button_interaction'] = $user_ip; //Custom field data $custom_field_value = 'subsc_ref=' . $membership_level_id; $custom_field_value .= '&user_ip=' . $user_ip; if (SwpmMemberUtils::is_member_logged_in()) { $custom_field_value .= '&swpm_id=' . SwpmMemberUtils::get_logged_in_members_id(); } $custom_field_value = apply_filters('swpm_custom_field_value_filter', $custom_field_value); /* === PayPal Buy Now Button Form === */ $output = ''; $output .= '
    '; $uniqid=uniqid(); //apply filter to output additional form fields $coupon_input=''; $coupon_input = apply_filters('swpm_payment_form_additional_fields',$coupon_input,$button_id,$uniqid); if (!empty($coupon_input)) { $output.=$coupon_input; } if ($sandbox_enabled) { $action_url='https://www.sandbox.paypal.com/cgi-bin/webscr'; } else { $action_url='https://www.paypal.com/cgi-bin/webscr'; } $output.= '
    '; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; //Do not prompt for an address $output .= ''; $output .= ''; $output .= ''; $custom_field_value = urlencode($custom_field_value);//URL encode the custom field value so nothing gets lost when it is passed around. $output .= ''; $checkout_logo_image_url = get_post_meta($button_id, 'checkout_logo_image_url', true); if (!empty($checkout_logo_image_url)) { $output .= ''; } //Filter to add additional payment input fields to the form (example: langauge code or country code etc). $output .= apply_filters('swpm_pp_payment_form_additional_fields', ''); $button_image_url = get_post_meta($button_id, 'button_image_url', true); if (!empty($button_image_url)) { $output .= ''; } else { $button_text = (isset($args['button_text'])) ? $args['button_text'] : __('Buy Now', 'simple-membership'); $output .= ''; } $output .= '
    '; //End .form $output .= '
    '; //End .swpm_button_wrapper return $output; } /* * ************************************************ * PayPal subscription button shortcode handler * *********************************************** */ add_filter('swpm_payment_button_shortcode_for_pp_subscription', 'swpm_render_pp_subscription_button_sc_output', 10, 2); function swpm_render_pp_subscription_button_sc_output($button_code, $args) { $button_id = isset($args['id']) ? $args['id'] : ''; if (empty($button_id)) { return '

    Error! swpm_render_pp_subscription_button_sc_output() function requires the button ID value to be passed to it.

    '; } //Check new_window parameter $window_target = isset($args['new_window']) ? 'target="_blank"' : ''; $settings = SwpmSettings::get_instance(); $button_cpt = get_post($button_id); //Retrieve the CPT for this button $membership_level_id = get_post_meta($button_id, 'membership_level_id', true); //Verify that this membership level exists (to prevent user paying for a level that has been deleted) if(!SwpmUtils::membership_level_id_exists($membership_level_id)){ return '

    Error! The membership level specified in this button does not exist. You may have deleted this membership level. Edit the button and use the correct membership level.

    '; } $paypal_email = get_post_meta($button_id, 'paypal_email', true); $payment_currency = get_post_meta($button_id, 'payment_currency', true); //Subscription payment details $billing_amount = get_post_meta($button_id, 'billing_amount', true); if (!is_numeric($billing_amount)) { return '

    Error! The billing amount value of the button must be a numeric number. Example: 49.50

    '; } $billing_amount = round($billing_amount, 2); //round the amount to 2 decimal place. $billing_cycle = get_post_meta($button_id, 'billing_cycle', true); $billing_cycle_term = get_post_meta($button_id, 'billing_cycle_term', true); $billing_cycle_count = get_post_meta($button_id, 'billing_cycle_count', true); $billing_reattempt = get_post_meta($button_id, 'billing_reattempt', true); //Trial billing details $trial_billing_amount = get_post_meta($button_id, 'trial_billing_amount', true); if (!empty($trial_billing_amount)) { if(!is_numeric($trial_billing_amount)){ return '

    Error! The trial billing amount value of the button must be a numeric number. Example: 19.50

    '; } } $trial_billing_cycle = get_post_meta($button_id, 'trial_billing_cycle', true); $trial_billing_cycle_term = get_post_meta($button_id, 'trial_billing_cycle_term', true); $sandbox_enabled = $settings->get_value('enable-sandbox-testing'); $notify_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL . '/?swpm_process_ipn=1'; $return_url = get_post_meta($button_id, 'return_url', true); if (empty($return_url)) { $return_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL; } $cancel_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL; $user_ip = SwpmUtils::get_user_ip_address(); $_SESSION['swpm_payment_button_interaction'] = $user_ip; //Custom field data $custom_field_value = 'subsc_ref=' . $membership_level_id; $custom_field_value .= '&user_ip=' . $user_ip; if (SwpmMemberUtils::is_member_logged_in()) { $custom_field_value .= '&swpm_id=' . SwpmMemberUtils::get_logged_in_members_id(); } $custom_field_value = apply_filters('swpm_custom_field_value_filter', $custom_field_value); /* === PayPal Subscription Button Form === */ $output = ''; $output .= '
    '; if ($sandbox_enabled) { $output .= '
    '; } else { $output .= ''; } $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; //Check trial billing if (!empty($trial_billing_cycle)) { $output .= ''; } //Main subscription billing if (!empty($billing_cycle)) { $output .= ''; } //Re-attempt on failure if ($billing_reattempt != '') { $output .= ''; } //Reccurring times if ($billing_cycle_count > 1) { //do not include srt value if billing cycle count set to 1 or a negetive number. $output .= ''; } else if (empty($billing_cycle_count)) { $output .= ''; } //Other required data $output .= ''; //Do not prompt for an address $output .= ''; $output .= ''; $output .= ''; $custom_field_value = urlencode($custom_field_value);//URL encode the custom field value so nothing gets lost when it is passed around. $output .= ''; $checkout_logo_image_url = get_post_meta($button_id, 'checkout_logo_image_url', true); if (!empty($checkout_logo_image_url)) { $output .= ''; } //Filter to add additional payment input fields to the form (example: langauge code or country code etc). $output .= apply_filters('swpm_pp_payment_form_additional_fields', ''); //Submit button $button_image_url = get_post_meta($button_id, 'button_image_url', true); if (!empty($button_image_url)) { $output .= ''; } else { $button_text = (isset($args['button_text'])) ? $args['button_text'] : __('Subscribe Now', 'simple-membership'); $output .= ''; } $output .= '
    '; //End .form $output .= '
    '; //End .swpm_button_wrapper return $output; } payments/payment-gateway/paypal_smart_checkout_button_shortcode_view.php000064400000026675147206770760023351 0ustar00'.__('Error! swpm_render_pp_smart_checkout_button_sc_output() function requires the button ID value to be passed to it.', 'simple-membership').'

    '; } //Check new_window parameter $button_text = (isset($args['button_text'])) ? sanitize_text_field($args['button_text']) : __('Buy Now', 'simple-membership'); $billing_address = isset($args['billing_address']) ? '1' : ''; ; //By default don't show the billing address in the checkout form. $item_logo = ''; //Can be used to show an item logo or thumbnail in the checkout form. $settings = SwpmSettings::get_instance(); $button_cpt = get_post($button_id); //Retrieve the CPT for this button $item_name = htmlspecialchars($button_cpt->post_title); $membership_level_id = get_post_meta($button_id, 'membership_level_id', true); //Verify that this membership level exists (to prevent user paying for a level that has been deleted) if (!SwpmUtils::membership_level_id_exists($membership_level_id)) { return '

    '.__('Error! The membership level specified in this button does not exist. You may have deleted this membership level. Edit the button and use the correct membership level.', 'simple-membership').'

    '; } //Payment amount and currency $payment_amount = get_post_meta($button_id, 'payment_amount', true); if (!is_numeric($payment_amount)) { return '

    '.__('Error! The payment amount value of the button must be a numeric number. Example: 49.50 ', 'simple-membership').'

    '; } $payment_amount = round($payment_amount, 2); //round the amount to 2 decimal place. $payment_amount_formatted = number_format($payment_amount, 2, '.', ''); $payment_currency = get_post_meta($button_id, 'payment_currency', true); //Create the items_list for passing to PayPal API $items_list = "{name: '".esc_attr($item_name)."', quantity: '1', price: '".esc_attr($payment_amount)."', currency: '".esc_attr($payment_currency)."'}"; //Return, cancel, notifiy URLs $return_url = get_post_meta($button_id, 'return_url', true); if (empty($return_url)) { $return_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL; } //User's IP address $user_ip = SwpmUtils::get_user_ip_address(); $_SESSION['swpm_payment_button_interaction'] = $user_ip; //Custom field data $custom_field_value = 'subsc_ref=' . $membership_level_id; $custom_field_value .= '&user_ip=' . $user_ip; if (SwpmMemberUtils::is_member_logged_in()) { $member_id = SwpmMemberUtils::get_logged_in_members_id(); $custom_field_value .= '&swpm_id=' . $member_id; $member_first_name = SwpmMemberUtils::get_member_field_by_id($member_id, 'first_name'); $member_last_name = SwpmMemberUtils::get_member_field_by_id($member_id, 'last_name'); $member_email = SwpmMemberUtils::get_member_field_by_id($member_id, 'email'); } $custom_field_value = apply_filters('swpm_custom_field_value_filter', $custom_field_value); //Sandbox settings $sandbox_enabled = $settings->get_value('enable-sandbox-testing'); if ($sandbox_enabled) { $mode = "sandbox"; } else { $mode = "production"; } $btn_layout = get_post_meta($button_id, 'pp_smart_checkout_btn_layout', true); $btn_layout = empty($btn_layout) ? 'vertical' : sanitize_text_field($btn_layout); $btn_size = get_post_meta($button_id, 'pp_smart_checkout_btn_size', true); $btn_size = empty($btn_size) ? 'medium' : sanitize_text_field($btn_size); $btn_shape = get_post_meta($button_id, 'pp_smart_checkout_btn_shape', true); $btn_shape = empty($btn_shape) ? 'rect' : sanitize_text_field($btn_shape); $btn_color = get_post_meta($button_id, 'pp_smart_checkout_btn_color', true); $btn_color = empty($btn_color) ? 'gold' : sanitize_text_field($btn_color); $pm_str = ''; $pm_credit = get_post_meta($button_id, 'pp_smart_checkout_payment_method_credit', true); $pm_str .= empty($pm_credit) ? '' : ', paypal.FUNDING.CREDIT'; $pm_elv = get_post_meta($button_id, 'pp_smart_checkout_payment_method_elv', true); $pm_str .= empty($pm_elv) ? '' : ', paypal.FUNDING.ELV'; $uniqid = uniqid(); // Get unique ID to ensure several buttons can be added to one page without conflicts $output = ''; ob_start(); $ppCheckoutJs = ''; //check if checkout.js was already included //including it several times on one page causes JS fatal error if (!defined('SWPM-PP-SMART-CHECKOUT-SCRIPT-INCLUDED')) { //it wasn't. Let's include it and define an indicator that it is included now define('SWPM-PP-SMART-CHECKOUT-SCRIPT-INCLUDED', 1); echo $ppCheckoutJs; } ?>
    '; echo '

    The Stripe payment gateway libary requires at least PHP 5.6.0. Your server is using a very old version of PHP that Stripe does not support.

    '; echo '

    Request your hosting provider to upgrade your PHP to a more recent version then you will be able to use the Stripe gateway.

    '; echo ''; return; } ?>

     

    Select the currency for this payment button.

    Payment Settings tab.', 'simple-membership' ); ?>

    sanitize_text_field( $_REQUEST['button_name'] ), 'post_type' => 'swpm_payment_button', 'post_content' => '', 'post_status' => 'publish', ) ); $button_type = sanitize_text_field( $_REQUEST['button_type'] ); add_post_meta( $button_id, 'button_type', $button_type ); add_post_meta( $button_id, 'membership_level_id', sanitize_text_field( $_REQUEST['membership_level_id'] ) ); add_post_meta( $button_id, 'payment_amount', trim( sanitize_text_field( $_REQUEST['payment_amount'] ) ) ); add_post_meta( $button_id, 'payment_currency', sanitize_text_field( $_REQUEST['payment_currency'] ) ); //Stripe API Keys related data $stripe_test_secret_key = isset($_REQUEST['stripe_test_secret_key']) ? trim(sanitize_text_field( $_REQUEST['stripe_test_secret_key'] )) : ''; add_post_meta( $button_id, 'stripe_test_secret_key', $stripe_test_secret_key ); $stripe_test_publishable_key = isset($_REQUEST['stripe_test_publishable_key']) ? trim(sanitize_text_field( $_REQUEST['stripe_test_publishable_key'] )) : ''; add_post_meta( $button_id, 'stripe_test_publishable_key', $stripe_test_publishable_key ); $stripe_live_secret_key = isset($_REQUEST['stripe_live_secret_key']) ? trim(sanitize_text_field( $_REQUEST['stripe_live_secret_key'] )) : ''; add_post_meta( $button_id, 'stripe_live_secret_key', $stripe_live_secret_key ); $stripe_live_publishable_key = isset($_REQUEST['stripe_live_publishable_key']) ? trim(sanitize_text_field( $_REQUEST['stripe_live_publishable_key'] )) : ''; add_post_meta( $button_id, 'stripe_live_publishable_key', $stripe_live_publishable_key ); $allow_promotion_codes = isset($_REQUEST['allow_promotion_codes']) ? sanitize_text_field( $_REQUEST['allow_promotion_codes'] ) : ''; add_post_meta( $button_id, 'allow_promotion_codes', $allow_promotion_codes ); add_post_meta( $button_id, 'stripe_collect_address', isset( $_POST['collect_address'] ) ? '1' : '' ); add_post_meta( $button_id, 'stripe_automatic_tax', isset( $_POST['automatic_tax'] ) ? '1' : '' ); $stripe_use_global_keys = filter_input( INPUT_POST, 'stripe_use_global_keys', FILTER_SANITIZE_NUMBER_INT ); $stripe_use_global_keys = $stripe_use_global_keys ? true : false; add_post_meta( $button_id, 'stripe_use_global_keys', $stripe_use_global_keys ); add_post_meta( $button_id, 'return_url', trim( sanitize_text_field( $_REQUEST['return_url'] ) ) ); add_post_meta( $button_id, 'cancel_url', trim( sanitize_text_field( $_REQUEST['cancel_url'] ) ) ); add_post_meta( $button_id, 'button_image_url', esc_url( $_REQUEST['button_image_url'] ) ); //Redirect to the edit interface of this button with $button_id //$url = admin_url() . 'admin.php?page=simple_wp_membership_payments&tab=edit_button&button_id=' . $button_id . '&button_type=' . $button_type; //Redirect to the manage payment buttons interface $url = admin_url() . 'admin.php?page=simple_wp_membership_payments&tab=payment_buttons'; SwpmMiscUtils::redirect_to_url( $url ); } } /* * ********************************************************************** * End of new Stripe Buy now payment button stuff * ********************************************************************** */ /* * *************************************************************** * Render edit Stripe Buy now payment button interface * ************************************************************** */ add_action( 'swpm_edit_payment_button_for_stripe_sca_buy_now', 'swpm_edit_stripe_sca_buy_now_button' ); function swpm_edit_stripe_sca_buy_now_button() { //Retrieve the payment button data and present it for editing. $button_id = sanitize_text_field( $_REQUEST['button_id'] ); $button_id = absint( $button_id ); $button_type = sanitize_text_field( $_REQUEST['button_type'] ); $button = get_post( $button_id ); //Retrieve the CPT for this button $membership_level_id = get_post_meta( $button_id, 'membership_level_id', true ); $payment_amount = get_post_meta( $button_id, 'payment_amount', true ); $payment_currency = get_post_meta( $button_id, 'payment_currency', true ); $allow_promotion_codes = get_post_meta( $button_id, 'allow_promotion_codes', true ); if ( $allow_promotion_codes == '1' ) { $allow_promotion_codes = 'checked'; } else { $allow_promotion_codes = ''; } $stripe_test_secret_key = get_post_meta( $button_id, 'stripe_test_secret_key', true ); $stripe_test_publishable_key = get_post_meta( $button_id, 'stripe_test_publishable_key', true ); $stripe_live_secret_key = get_post_meta( $button_id, 'stripe_live_secret_key', true ); $stripe_live_publishable_key = get_post_meta( $button_id, 'stripe_live_publishable_key', true ); $collect_address = get_post_meta( $button_id, 'stripe_collect_address', true ); if ( $collect_address == '1' ) { $collect_address = ' checked'; } else { $collect_address = ''; } $automatic_tax = get_post_meta( $button_id, 'stripe_automatic_tax', true ); if ( $automatic_tax == '1' ) { $automatic_tax = ' checked'; } else { $automatic_tax = ''; } $use_global_keys = get_post_meta( $button_id, 'stripe_use_global_keys', true ); $use_global_keys = empty( $use_global_keys ) ? false : true; $return_url = get_post_meta( $button_id, 'return_url', true ); $cancel_url = get_post_meta( $button_id, 'cancel_url', true ); $button_image_url = get_post_meta( $button_id, 'button_image_url', true ); ?>

    />

    Payment Settings tab.','simple-membership' ); ?>

    />

    />

    />

    $button_id, 'post_title' => $button_name, 'post_type' => 'swpm_payment_button', ); wp_update_post( $button_post ); update_post_meta( $button_id, 'button_type', $button_type ); update_post_meta( $button_id, 'membership_level_id', sanitize_text_field( $_REQUEST['membership_level_id'] ) ); update_post_meta( $button_id, 'payment_amount', trim( sanitize_text_field( $_REQUEST['payment_amount'] ) ) ); update_post_meta( $button_id, 'payment_currency', sanitize_text_field( $_REQUEST['payment_currency'] ) ); update_post_meta( $button_id, 'allow_promotion_codes', isset( $_POST['allow_promotion_codes'] ) ? '1' : '' ); $stripe_test_secret_key = isset( $_POST['stripe_test_secret_key'] ) ? sanitize_text_field( stripslashes ( $_POST['stripe_test_secret_key'] ) ) : ''; $stripe_test_publishable_key = isset( $_POST['stripe_test_publishable_key'] ) ? sanitize_text_field( stripslashes ( $_POST['stripe_test_publishable_key'] ) ) : ''; if ( ! is_null( $stripe_test_secret_key ) ) { update_post_meta( $button_id, 'stripe_test_secret_key', trim( $stripe_test_secret_key ) ); } if ( ! is_null( $stripe_test_publishable_key ) ) { update_post_meta( $button_id, 'stripe_test_publishable_key', trim( $stripe_test_publishable_key ) ); } $stripe_live_secret_key = isset( $_POST['stripe_live_secret_key'] ) ? sanitize_text_field( stripslashes ( $_POST['stripe_live_secret_key'] ) ) : ''; $stripe_live_publishable_key = isset( $_POST['stripe_live_publishable_key'] ) ? sanitize_text_field( stripslashes ( $_POST['stripe_live_publishable_key'] ) ) : ''; if ( ! is_null( $stripe_live_secret_key ) ) { update_post_meta( $button_id, 'stripe_live_secret_key', trim( $stripe_live_secret_key ) ); } if ( ! is_null( $stripe_live_publishable_key ) ) { update_post_meta( $button_id, 'stripe_live_publishable_key', trim( $stripe_live_publishable_key ) ); } update_post_meta( $button_id, 'stripe_collect_address', isset( $_POST['collect_address'] ) ? '1' : '' ); update_post_meta( $button_id, 'stripe_automatic_tax', isset( $_POST['automatic_tax'] ) ? '1' : '' ); $stripe_use_global_keys = filter_input( INPUT_POST, 'stripe_use_global_keys', FILTER_SANITIZE_NUMBER_INT ); $stripe_use_global_keys = $stripe_use_global_keys ? true : false; update_post_meta( $button_id, 'stripe_use_global_keys', $stripe_use_global_keys ); update_post_meta( $button_id, 'return_url', trim( sanitize_text_field( $_REQUEST['return_url'] ) ) ); update_post_meta( $button_id, 'cancel_url', trim( sanitize_text_field( $_REQUEST['cancel_url'] ) ) ); update_post_meta( $button_id, 'button_image_url', esc_url( $_REQUEST['button_image_url'] ) ); echo '

    '.__('Payment button data successfully updated!', 'simple-membership').'

    '; } } /************************************************************************ * End of edit Stripe Buy now payment button stuff ************************************************************************/ payments/payment-gateway/admin_paypal_subscription_button.php000064400000107147147206770760021120 0ustar00
     

    sanitize_text_field($_REQUEST['button_name']), 'post_type' => 'swpm_payment_button', 'post_content' => '', 'post_status' => 'publish' ) ); $button_type = sanitize_text_field($_REQUEST['button_type']); add_post_meta($button_id, 'button_type', $button_type); add_post_meta($button_id, 'membership_level_id', sanitize_text_field($_REQUEST['membership_level_id'])); add_post_meta($button_id, 'payment_currency', sanitize_text_field($_REQUEST['payment_currency'])); add_post_meta($button_id, 'return_url', trim(sanitize_text_field($_REQUEST['return_url']))); add_post_meta($button_id, 'paypal_email', trim(sanitize_email($_REQUEST['paypal_email']))); add_post_meta($button_id, 'button_image_url', trim(sanitize_text_field($_REQUEST['button_image_url']))); add_post_meta($button_id, 'checkout_logo_image_url', trim(sanitize_text_field($_REQUEST['checkout_logo_image_url']))); //Subscription billing details add_post_meta($button_id, 'billing_amount', sanitize_text_field($_REQUEST['billing_amount'])); add_post_meta($button_id, 'billing_cycle', sanitize_text_field($_REQUEST['billing_cycle'])); add_post_meta($button_id, 'billing_cycle_term', sanitize_text_field($_REQUEST['billing_cycle_term'])); add_post_meta($button_id, 'billing_cycle_count', sanitize_text_field($_REQUEST['billing_cycle_count'])); add_post_meta($button_id, 'billing_reattempt', isset($_REQUEST['billing_reattempt']) ? '1' : ''); //Trial billing details add_post_meta($button_id, 'trial_billing_amount', sanitize_text_field($_REQUEST['trial_billing_amount'])); add_post_meta($button_id, 'trial_billing_cycle', sanitize_text_field($_REQUEST['trial_billing_cycle'])); add_post_meta($button_id, 'trial_billing_cycle_term', sanitize_text_field($_REQUEST['trial_billing_cycle_term'])); //Redirect to the edit interface of this button with $button_id $url = admin_url() . 'admin.php?page=simple_wp_membership_payments&tab=edit_button&button_id=' . $button_id . '&button_type=' . $button_type; SwpmMiscUtils::redirect_to_url($url); } } /* * ********************************************************************** * End of new PayPal subscription payment button stuff * ********************************************************************** */ /* * *************************************************************** * Render edit PayPal Subscription payment button interface * ************************************************************** */ add_action('swpm_edit_payment_button_for_pp_subscription', 'swpm_edit_pp_subscription_button'); function swpm_edit_pp_subscription_button() { //Retrieve the payment button data and present it for editing. $button_id = sanitize_text_field($_REQUEST['button_id']); $button_id = absint($button_id); $button_type = sanitize_text_field($_REQUEST['button_type']); $button = get_post($button_id); //Retrieve the CPT for this button $membership_level_id = get_post_meta($button_id, 'membership_level_id', true); //$payment_amount = get_post_meta($button_id, 'payment_amount', true); $payment_currency = get_post_meta($button_id, 'payment_currency', true); $return_url = get_post_meta($button_id, 'return_url', true); $paypal_email = get_post_meta($button_id, 'paypal_email', true); $button_image_url = get_post_meta($button_id, 'button_image_url', true); $checkout_logo_image_url = get_post_meta($button_id, 'checkout_logo_image_url', true); //Subscription billing details $billing_amount = get_post_meta($button_id, 'billing_amount', true); $billing_cycle = get_post_meta($button_id, 'billing_cycle', true); $billing_cycle_term = get_post_meta($button_id, 'billing_cycle_term', true); $billing_cycle_count = get_post_meta($button_id, 'billing_cycle_count', true); $billing_reattempt = get_post_meta($button_id, 'billing_reattempt', true); //Trial billing details $trial_billing_amount = get_post_meta($button_id, 'trial_billing_amount', true); $trial_billing_cycle = get_post_meta($button_id, 'trial_billing_cycle', true); $trial_billing_cycle_term = get_post_meta($button_id, 'trial_billing_cycle_term', true); ?>

    />

    .

    $button_id, 'post_title' => $button_name, 'post_type' => 'swpm_payment_button', ); wp_update_post($button_post); update_post_meta($button_id, 'button_type', $button_type); update_post_meta($button_id, 'membership_level_id', sanitize_text_field($_REQUEST['membership_level_id'])); update_post_meta($button_id, 'payment_currency', sanitize_text_field($_REQUEST['payment_currency'])); update_post_meta($button_id, 'return_url', trim(sanitize_text_field($_REQUEST['return_url']))); update_post_meta($button_id, 'paypal_email', trim(sanitize_email($_REQUEST['paypal_email']))); update_post_meta($button_id, 'button_image_url', trim(sanitize_text_field($_REQUEST['button_image_url']))); update_post_meta($button_id, 'checkout_logo_image_url', trim(sanitize_text_field($_REQUEST['checkout_logo_image_url']))); //Subscription billing details update_post_meta($button_id, 'billing_amount', sanitize_text_field($_REQUEST['billing_amount'])); update_post_meta($button_id, 'billing_cycle', sanitize_text_field($_REQUEST['billing_cycle'])); update_post_meta($button_id, 'billing_cycle_term', sanitize_text_field($_REQUEST['billing_cycle_term'])); update_post_meta($button_id, 'billing_cycle_count', sanitize_text_field($_REQUEST['billing_cycle_count'])); update_post_meta($button_id, 'billing_reattempt', isset($_REQUEST['billing_reattempt']) ? '1' : ''); //Trial billing details update_post_meta($button_id, 'trial_billing_amount', sanitize_text_field($_REQUEST['trial_billing_amount'])); update_post_meta($button_id, 'trial_billing_cycle', sanitize_text_field($_REQUEST['trial_billing_cycle'])); update_post_meta($button_id, 'trial_billing_cycle_term', sanitize_text_field($_REQUEST['trial_billing_cycle_term'])); echo '

    '.__('Payment button data successfully updated!', 'simple-membership').'

    '; } } /************************************************************************ * End of edit PayPal Subscription payment button stuff ************************************************************************/payments/payment-gateway/admin_paypal_buy_now_new_button.php000064400000076271147206770760020732 0ustar00 $button_name, 'post_type' => 'swpm_payment_button', 'post_content' => '', 'post_status' => 'publish' ) ); add_post_meta($button_id, 'button_type', sanitize_text_field($_REQUEST['button_type'])); add_post_meta($button_id, 'membership_level_id', sanitize_text_field($_REQUEST['membership_level_id'])); add_post_meta($button_id, 'payment_currency', trim(sanitize_text_field($_REQUEST['payment_currency']))); add_post_meta($button_id, 'payment_amount', trim(sanitize_text_field($_REQUEST['payment_amount']))); add_post_meta($button_id, 'pp_buy_now_new_btn_type', $btn_type); add_post_meta($button_id, 'pp_buy_now_new_btn_shape', $btn_shape); add_post_meta($button_id, 'pp_buy_now_new_btn_layout', $btn_layout); add_post_meta($button_id, 'pp_buy_now_new_btn_height', $btn_height); add_post_meta($button_id, 'pp_buy_now_new_btn_width', $btn_width); add_post_meta($button_id, 'pp_buy_now_new_btn_color', $btn_color); add_post_meta($button_id, 'pp_buy_now_new_disable_funding_card', $disable_funding_card); add_post_meta($button_id, 'pp_buy_now_new_disable_funding_credit', $disable_funding_credit); add_post_meta($button_id, 'pp_buy_now_new_disable_funding_venmo', $disable_funding_venmo); add_post_meta($button_id, 'return_url', trim(sanitize_text_field($_REQUEST['return_url']))); //Check if webhooks already configured for this site. If not, create necessary webhooks. SWPM_PayPal_Utility_Functions::check_and_create_webhooks_for_this_site(); //Redirect to the manage payment buttons interface $url = admin_url() . 'admin.php?page=simple_wp_membership_payments&tab=payment_buttons'; SwpmMiscUtils::redirect_to_url($url); } if (isset($_REQUEST['swpm_pp_buy_now_new_edit_submit'])) { //This is a PayPal Buy Now (New) button edit event. check_admin_referer( 'swpm_admin_add_edit_pp_buy_now_new_btn', 'swpm_admin_add_edit_pp_buy_now_new_btn' ); $button_id = sanitize_text_field($_REQUEST['button_id']); $button_id = absint($button_id); $button_post = array( 'ID' => $button_id, 'post_title' => $button_name, 'post_type' => 'swpm_payment_button', ); wp_update_post($button_post); update_post_meta($button_id, 'button_type', sanitize_text_field($_REQUEST['button_type'])); update_post_meta($button_id, 'membership_level_id', sanitize_text_field($_REQUEST['membership_level_id'])); update_post_meta($button_id, 'payment_currency', trim(sanitize_text_field($_REQUEST['payment_currency']))); update_post_meta($button_id, 'payment_amount', trim(sanitize_text_field($_REQUEST['payment_amount']))); update_post_meta($button_id, 'pp_buy_now_new_btn_type', $btn_type); update_post_meta($button_id, 'pp_buy_now_new_btn_shape', $btn_shape); update_post_meta($button_id, 'pp_buy_now_new_btn_layout', $btn_layout); update_post_meta($button_id, 'pp_buy_now_new_btn_height', $btn_height); update_post_meta($button_id, 'pp_buy_now_new_btn_width', $btn_width); update_post_meta($button_id, 'pp_buy_now_new_btn_color', $btn_color); update_post_meta($button_id, 'pp_buy_now_new_disable_funding_card', $disable_funding_card); update_post_meta($button_id, 'pp_buy_now_new_disable_funding_credit', $disable_funding_credit); update_post_meta($button_id, 'pp_buy_now_new_disable_funding_venmo', $disable_funding_venmo); update_post_meta($button_id, 'return_url', trim(sanitize_text_field($_REQUEST['return_url']))); echo '

    Payment button data successfully updated!

    '; } } //I've merged two (save and edit events) into one add_action('swpm_create_new_button_process_submission', 'swpm_save_edit_pp_buy_now_new_button_data'); add_action('swpm_edit_payment_button_process_submission', 'swpm_save_edit_pp_buy_now_new_button_data'); /************************************************************************************* * END of Process submission *************************************************************************************/ /***************************************************************************** * Start of render the PayPal Buy Now (New) payment button creation interface *****************************************************************************/ function render_save_edit_pp_buy_now_new_button_interface($bt_opts, $is_edit_mode = false) { $settings = SwpmSettings::get_instance(); $live_client_id = $settings->get_value('paypal-live-client-id'); $sandbox_client_id = $settings->get_value('paypal-sandbox-client-id'); if ( empty($live_client_id) && empty($sandbox_client_id) ) { //API credentials are not configured. Show a warning message and return. echo '
    '; echo __('You need to configure your PayPal API credentials first. ', 'simple-membership'); echo ''.__('Click here', 'simple-membership').' '. __('to configure your PayPal API credentials in the payment settings menu.', 'simple-membership'); echo '
    '; return; } ?>
     

    sanitize_text_field($_REQUEST['button_type']), 'pp_buy_now_new_btn_type' => 'buynow', /* set default button type */ 'pp_buy_now_new_btn_height' => 'medium', /* set default button height */ 'pp_buy_now_new_btn_color' => 'blue', /* set default button color */ 'pp_buy_now_new_disable_funding_credit' => '1', /* set credit option to be disabled by default */ ); render_save_edit_pp_buy_now_new_button_interface($bt_opts); } add_action('swpm_create_new_button_for_pp_buy_now_new', 'swpm_create_new_pp_buy_now_new_button'); /***************************************************************** * Render the edit new PayPal buy now payment button interface *************************************************************** */ function swpm_edit_pp_buy_now_new_button() { //Retrieve the payment button data and present it for editing. $button_id = sanitize_text_field($_REQUEST['button_id']); $button_id = absint($button_id); $button = get_post($button_id); //Retrieve the CPT for this button //$button_image_url = get_post_meta($button_id, 'button_image_url', true); $bt_opts = array( 'button_id' => $button_id, 'button_type' => sanitize_text_field($_REQUEST['button_type']), 'button_name' => $button->post_title, 'membership_level_id' => get_post_meta($button_id, 'membership_level_id', true), 'payment_currency' => get_post_meta($button_id, 'payment_currency', true), 'payment_amount' => get_post_meta($button_id, 'payment_amount', true), 'pp_buy_now_new_btn_type' => get_post_meta($button_id, 'pp_buy_now_new_btn_type', true), 'pp_buy_now_new_btn_shape' => get_post_meta($button_id, 'pp_buy_now_new_btn_shape', true), 'pp_buy_now_new_btn_layout' => get_post_meta($button_id, 'pp_buy_now_new_btn_layout', true), 'pp_buy_now_new_btn_height' => get_post_meta($button_id, 'pp_buy_now_new_btn_height', true), 'pp_buy_now_new_btn_width' => get_post_meta($button_id, 'pp_buy_now_new_btn_width', true), 'pp_buy_now_new_btn_color' => get_post_meta($button_id, 'pp_buy_now_new_btn_color', true), 'pp_buy_now_new_disable_funding_card' => get_post_meta($button_id, 'pp_buy_now_new_disable_funding_card', true), 'pp_buy_now_new_disable_funding_credit' => get_post_meta($button_id, 'pp_buy_now_new_disable_funding_credit', true), 'pp_buy_now_new_disable_funding_venmo' => get_post_meta($button_id, 'pp_buy_now_new_disable_funding_venmo', true), 'return_url' => get_post_meta($button_id, 'return_url', true), ); render_save_edit_pp_buy_now_new_button_interface($bt_opts, true); } add_action('swpm_edit_payment_button_for_pp_buy_now_new', 'swpm_edit_pp_buy_now_new_button'); /************************************************************************************* * END of render button configuration HTML *************************************************************************************/payments/payment-gateway/braintree_button_shortcode_view.php000064400000035274147206770760020736 0ustar00'.__('Error! swpm_render_braintree_buy_now_button_sc_output() function requires the button ID value to be passed to it.', 'simple-membership').'

    '; } //Get class option for button styling, set Stripe's default if none specified $class = isset($args['class']) ? sanitize_html_class($args['class']) : ''; //Check new_window parameter $window_target = isset($args['new_window']) ? 'target="_blank"' : ''; $button_text = (isset($args['button_text'])) ? sanitize_text_field($args['button_text']) : __('Buy Now', 'simple-membership'); $billing_address = isset($args['billing_address']) ? '1' : '';; //By default don't show the billing address in the checkout form. $item_logo = ''; //Can be used to show an item logo or thumbnail in the checkout form. $settings = SwpmSettings::get_instance(); $button_cpt = get_post($button_id); //Retrieve the CPT for this button $item_name = htmlspecialchars($button_cpt->post_title); $membership_level_id = get_post_meta($button_id, 'membership_level_id', true); //Verify that this membership level exists (to prevent user paying for a level that has been deleted) if (!SwpmUtils::membership_level_id_exists($membership_level_id)) { return '

    '.__('Error! The membership level specified in this button does not exist. You may have deleted this membership level. Edit the button and use the correct membership level.', 'simple-membership').'

    '; } //Payment amount and currency $payment_amount = get_post_meta($button_id, 'payment_amount', true); if (!is_numeric($payment_amount)) { return '

    '.__('Error! The payment amount value of the button must be a numeric number. Example: 49.50 ', 'simple-membership').'

    '; } $payment_amount = round($payment_amount, 2); //round the amount to 2 decimal place. $payment_currency = get_post_meta($button_id, 'currency_code', true); $payment_amount_formatted = SwpmMiscUtils::format_money($payment_amount, $payment_currency); //Return, cancel, notifiy URLs $return_url = get_post_meta($button_id, 'return_url', true); if (empty($return_url)) { $return_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL; } $notify_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL . '/?swpm_process_braintree_buy_now=1'; //We are going to use it to do post payment processing. //$button_image_url = get_post_meta($button_id, 'button_image_url', true);//Stripe doesn't currenty support button image for their standard checkout. //User's IP address $user_ip = SwpmUtils::get_user_ip_address(); $_SESSION['swpm_payment_button_interaction'] = $user_ip; //Custom field data $custom_field_value = 'subsc_ref=' . $membership_level_id; $custom_field_value .= '&user_ip=' . $user_ip; if (SwpmMemberUtils::is_member_logged_in()) { $member_id = SwpmMemberUtils::get_logged_in_members_id(); $custom_field_value .= '&swpm_id=' . $member_id; $member_first_name = SwpmMemberUtils::get_member_field_by_id($member_id, 'first_name'); $member_last_name = SwpmMemberUtils::get_member_field_by_id($member_id, 'last_name'); $member_email = SwpmMemberUtils::get_member_field_by_id($member_id, 'email'); } $custom_field_value = apply_filters('swpm_custom_field_value_filter', $custom_field_value); //Sandbox settings $sandbox_enabled = $settings->get_value('enable-sandbox-testing'); if ($sandbox_enabled) { $braintree_env = "sandbox"; } else { $braintree_env = "production"; } require_once(SIMPLE_WP_MEMBERSHIP_PATH . 'lib/braintree/lib/autoload.php'); try { Braintree_Configuration::environment($braintree_env); Braintree_Configuration::merchantId(get_post_meta($button_id, 'braintree_merchant_acc_id', true)); Braintree_Configuration::publicKey(get_post_meta($button_id, 'braintree_public_key', true)); Braintree_Configuration::privateKey(get_post_meta($button_id, 'braintree_private_key', true)); $clientToken = Braintree_ClientToken::generate(); } catch (Exception $e) { $e_class = get_class($e); $ret = __('Braintree Pay Now button error: ', 'simple-membership') . $e_class; if ($e_class == "Braintree\Exception\Authentication") $ret .= "
    " . __("API keys are incorrect. Double-check that you haven't accidentally tried to use your sandbox keys in production or vice-versa.", 'simple-membership'); return $ret; } $uniqid = uniqid(); // Get unique ID to ensure several buttons can be added to one page without conflicts /* === Braintree Buy Now Button Form === */ $output = ''; $output .= '
    '; $output .= "
    "; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; ob_start(); ?> '; $output .= ''; $output .= ""; $output .= ""; $output .= ""; $output .= ""; //Filter to add additional payment input fields to the form. $output .= apply_filters('swpm_braintree_payment_form_additional_fields', ''); $output .= "
    "; $output .= '
    '; //End .swpm_button_wrapper return $output; } payments/payment-gateway/admin_paypal_subscription_new_button.php000064400000122772147206770760021772 0ustar00 $button_name, 'post_type' => 'swpm_payment_button', 'post_content' => '', 'post_status' => 'publish' ) ); add_post_meta($button_id, 'button_type', sanitize_text_field($_REQUEST['button_type'])); add_post_meta($button_id, 'membership_level_id', sanitize_text_field($_REQUEST['membership_level_id'])); add_post_meta($button_id, 'payment_currency', trim(sanitize_text_field($_REQUEST['payment_currency']))); add_post_meta($button_id, 'recurring_billing_amount', trim(sanitize_text_field($_REQUEST['recurring_billing_amount']))); add_post_meta($button_id, 'recurring_billing_cycle', trim(sanitize_text_field($_REQUEST['recurring_billing_cycle']))); add_post_meta($button_id, 'recurring_billing_cycle_term', trim(sanitize_text_field($_REQUEST['recurring_billing_cycle_term']))); add_post_meta($button_id, 'recurring_billing_cycle_count', trim(sanitize_text_field($_REQUEST['recurring_billing_cycle_count']))); add_post_meta($button_id, 'recurring_billing_reattempt', isset($_REQUEST['recurring_billing_reattempt']) ? '1' : ''); add_post_meta($button_id, 'trial_billing_amount', trim(sanitize_text_field($_REQUEST['trial_billing_amount']))); add_post_meta($button_id, 'trial_billing_cycle', trim(sanitize_text_field($_REQUEST['trial_billing_cycle']))); add_post_meta($button_id, 'trial_billing_cycle_term', trim(sanitize_text_field($_REQUEST['trial_billing_cycle_term']))); add_post_meta($button_id, 'pp_subscription_new_btn_type', $btn_type); add_post_meta($button_id, 'pp_subscription_new_btn_shape', $btn_shape); add_post_meta($button_id, 'pp_subscription_new_btn_layout', $btn_layout); add_post_meta($button_id, 'pp_subscription_new_btn_height', $btn_height); add_post_meta($button_id, 'pp_subscription_new_btn_width', $btn_width); add_post_meta($button_id, 'pp_subscription_new_btn_color', $btn_color); add_post_meta($button_id, 'pp_subscription_new_disable_funding_card', $disable_funding_card); add_post_meta($button_id, 'pp_subscription_new_disable_funding_credit', $disable_funding_credit); add_post_meta($button_id, 'pp_subscription_new_disable_funding_venmo', $disable_funding_venmo); add_post_meta($button_id, 'return_url', trim(sanitize_text_field($_REQUEST['return_url']))); //Check if webhooks already configured for this site. If not, create necessary webhooks. SWPM_PayPal_Utility_Functions::check_and_create_webhooks_for_this_site(); //Redirect to the manage payment buttons interface $url = admin_url() . 'admin.php?page=simple_wp_membership_payments&tab=payment_buttons'; SwpmMiscUtils::redirect_to_url($url); } if (isset($_REQUEST['swpm_pp_subscription_new_edit_submit'])) { //This is a PayPal Subscription (New) button edit event. check_admin_referer( 'swpm_admin_add_edit_pp_subscription_new_btn', 'swpm_admin_add_edit_pp_subscription_new_btn' ); $button_id = sanitize_text_field($_REQUEST['button_id']); $button_id = absint($button_id); $button_post = array( 'ID' => $button_id, 'post_title' => $button_name, 'post_type' => 'swpm_payment_button', ); wp_update_post($button_post); update_post_meta($button_id, 'button_type', sanitize_text_field($_REQUEST['button_type'])); update_post_meta($button_id, 'membership_level_id', sanitize_text_field($_REQUEST['membership_level_id'])); if( SWPM_PayPal_Utility_Functions::has_plan_details_changed_for_button($button_id) ){ //Plan details have changed. Delete any existing plan (so a new one can be created next time this button is used). SwpmLog::log_simple_debug("PayPal Subscription button edit - billing plan details have been updated.", true); delete_post_meta( $button_id, 'pp_subscription_plan_id' ); } update_post_meta($button_id, 'payment_currency', trim(sanitize_text_field($_REQUEST['payment_currency']))); update_post_meta($button_id, 'recurring_billing_amount', trim(sanitize_text_field($_REQUEST['recurring_billing_amount']))); update_post_meta($button_id, 'recurring_billing_cycle', trim(sanitize_text_field($_REQUEST['recurring_billing_cycle']))); update_post_meta($button_id, 'recurring_billing_cycle_term', trim(sanitize_text_field($_REQUEST['recurring_billing_cycle_term']))); update_post_meta($button_id, 'recurring_billing_cycle_count', trim(sanitize_text_field($_REQUEST['recurring_billing_cycle_count']))); update_post_meta($button_id, 'recurring_billing_reattempt', isset($_REQUEST['recurring_billing_reattempt']) ? '1' : ''); update_post_meta($button_id, 'trial_billing_amount', trim(sanitize_text_field($_REQUEST['trial_billing_amount']))); update_post_meta($button_id, 'trial_billing_cycle', trim(sanitize_text_field($_REQUEST['trial_billing_cycle']))); update_post_meta($button_id, 'trial_billing_cycle_term', trim(sanitize_text_field($_REQUEST['trial_billing_cycle_term']))); update_post_meta($button_id, 'pp_subscription_new_btn_type', $btn_type); update_post_meta($button_id, 'pp_subscription_new_btn_shape', $btn_shape); update_post_meta($button_id, 'pp_subscription_new_btn_layout', $btn_layout); update_post_meta($button_id, 'pp_subscription_new_btn_height', $btn_height); update_post_meta($button_id, 'pp_subscription_new_btn_width', $btn_width); update_post_meta($button_id, 'pp_subscription_new_btn_color', $btn_color); update_post_meta($button_id, 'pp_subscription_new_disable_funding_card', $disable_funding_card); update_post_meta($button_id, 'pp_subscription_new_disable_funding_credit', $disable_funding_credit); update_post_meta($button_id, 'pp_subscription_new_disable_funding_venmo', $disable_funding_venmo); update_post_meta($button_id, 'return_url', trim(sanitize_text_field($_REQUEST['return_url']))); echo '

    Payment button data successfully updated!

    '; } } //I've merged two (save and edit events) into one add_action('swpm_create_new_button_process_submission', 'swpm_save_edit_pp_subscription_new_button_data'); add_action('swpm_edit_payment_button_process_submission', 'swpm_save_edit_pp_subscription_new_button_data'); /************************************************************************************* * END of Process submission *************************************************************************************/ /***************************************************************************** * Start of render the PayPal Subscription (New) payment button creation interface *****************************************************************************/ function render_save_edit_pp_subscription_new_button_interface($bt_opts, $is_edit_mode = false) { $settings = SwpmSettings::get_instance(); $live_client_id = $settings->get_value('paypal-live-client-id'); $sandbox_client_id = $settings->get_value('paypal-sandbox-client-id'); if ( empty($live_client_id) && empty($sandbox_client_id) ) { //API credentials are not configured. Show a warning message and return. echo '
    '; echo __('You need to configure your PayPal API credentials first. ', 'simple-membership'); echo ''.__('Click here', 'simple-membership').' ' . __('to configure your PayPal API credentials in the payment settings menu.', 'simple-membership'); echo '
    '; return; } ?>
     

    />

    sanitize_text_field($_REQUEST['button_type']), 'pp_subscription_new_btn_height' => 'medium', /* set default button height */ 'pp_subscription_new_btn_color' => 'blue', /* set default button color */ 'pp_subscription_new_disable_funding_credit' => '1', /* set credit option to be disabled by default */ ); render_save_edit_pp_subscription_new_button_interface($bt_opts); } add_action('swpm_create_new_button_for_pp_subscription_new', 'swpm_create_new_pp_subscription_new_button'); /***************************************************************** * Render the edit new PayPal subscription payment button interface *************************************************************** */ function swpm_edit_pp_subscription_new_button() { //Retrieve the payment button data and present it for editing. $button_id = sanitize_text_field($_REQUEST['button_id']); $button_id = absint($button_id); $button = get_post($button_id); //Retrieve the CPT for this button //$button_image_url = get_post_meta($button_id, 'button_image_url', true); $bt_opts = array( 'button_id' => $button_id, 'button_type' => sanitize_text_field($_REQUEST['button_type']), 'button_name' => $button->post_title, 'membership_level_id' => get_post_meta($button_id, 'membership_level_id', true), 'payment_currency' => get_post_meta($button_id, 'payment_currency', true), 'recurring_billing_amount' => get_post_meta($button_id, 'recurring_billing_amount', true), 'recurring_billing_cycle' => get_post_meta($button_id, 'recurring_billing_cycle', true), 'recurring_billing_cycle_term' => get_post_meta($button_id, 'recurring_billing_cycle_term', true), 'recurring_billing_cycle_count' => get_post_meta($button_id, 'recurring_billing_cycle_count', true), 'recurring_billing_reattempt' => get_post_meta($button_id, 'recurring_billing_reattempt', true), 'trial_billing_amount' => get_post_meta($button_id, 'trial_billing_amount', true), 'trial_billing_cycle' => get_post_meta($button_id, 'trial_billing_cycle', true), 'trial_billing_cycle_term' => get_post_meta($button_id, 'trial_billing_cycle_term', true), 'pp_subscription_new_btn_type' => get_post_meta($button_id, 'pp_subscription_new_btn_type', true), 'pp_subscription_new_btn_shape' => get_post_meta($button_id, 'pp_subscription_new_btn_shape', true), 'pp_subscription_new_btn_layout' => get_post_meta($button_id, 'pp_subscription_new_btn_layout', true), 'pp_subscription_new_btn_height' => get_post_meta($button_id, 'pp_subscription_new_btn_height', true), 'pp_subscription_new_btn_width' => get_post_meta($button_id, 'pp_subscription_new_btn_width', true), 'pp_subscription_new_btn_color' => get_post_meta($button_id, 'pp_subscription_new_btn_color', true), 'pp_subscription_new_disable_funding_card' => get_post_meta($button_id, 'pp_subscription_new_disable_funding_card', true), 'pp_subscription_new_disable_funding_credit' => get_post_meta($button_id, 'pp_subscription_new_disable_funding_credit', true), 'pp_subscription_new_disable_funding_venmo' => get_post_meta($button_id, 'pp_subscription_new_disable_funding_venmo', true), 'return_url' => get_post_meta($button_id, 'return_url', true), 'pp_subscription_plan_id' => get_post_meta($button_id, 'pp_subscription_plan_id', true), 'pp_subscription_plan_mode' => get_post_meta($button_id, 'pp_subscription_plan_mode', true), ); render_save_edit_pp_subscription_new_button_interface($bt_opts, true); } add_action('swpm_edit_payment_button_for_pp_subscription_new', 'swpm_edit_pp_subscription_new_button'); /************************************************************************************* * END of render button configuration HTML *************************************************************************************/payments/payment-gateway/stripe_sca_button_shortcode_view.php000064400000033063147206770760021111 0ustar00Error! swpm_render_stripe_sca_buy_now_button_sc_output() function requires the button ID value to be passed to it.

    '; } //Get class option for button styling, set Stripe's default if none specified $class = isset( $args['class'] ) ? sanitize_html_class($args['class']) : 'stripe-button-el'; //Check new_window parameter $window_target = isset( $args['new_window'] ) ? 'target="_blank"' : ''; $button_text = ( isset( $args['button_text'] ) ) ? sanitize_text_field( $args['button_text'] ) : __( 'Buy Now', 'simple-membership' ); //Check the optional 'payment_method_types' paramter to see if it is set. Example value: payment_method_types="card,us_bank_account". //It can be used to enable ACH payment option. $payment_method_types = isset( $args['payment_method_types'] ) ? $args['payment_method_types'] : ''; $item_logo = ''; //Can be used to show an item logo or thumbnail in the checkout form. $settings = SwpmSettings::get_instance(); $button_cpt = get_post( $button_id ); //Retrieve the CPT for this button $item_name = htmlspecialchars( $button_cpt->post_title ); $membership_level_id = get_post_meta( $button_id, 'membership_level_id', true ); //Verify that this membership level exists (to prevent user paying for a level that has been deleted) if ( ! \SwpmUtils::membership_level_id_exists( $membership_level_id ) ) { return '

    '.__('Error! The membership level specified in this button does not exist. You may have deleted this membership level. Edit the button and use the correct membership level.', 'simple-membership').'

    '; } //Payment amount and currency $payment_amount = get_post_meta( $button_id, 'payment_amount', true ); if ( ! is_numeric( $payment_amount ) ) { return '

    '.__('Error! The payment amount value of the button must be a numeric number. Example: 49.50 ', 'simple-membership').'

    '; } $payment_currency = get_post_meta( $button_id, 'payment_currency', true ); $payment_amount = round( $payment_amount, 2 ); //round the amount to 2 decimal place. $zero_cents = unserialize( SIMPLE_WP_MEMBERSHIP_STRIPE_ZERO_CENTS ); if ( in_array( $payment_currency, $zero_cents ) ) { //this is zero-cents currency, amount shouldn't be multiplied by 100 $price_in_cents = $payment_amount; } else { $price_in_cents = $payment_amount * 100; //The amount (in cents). This value is passed to Stripe API. } $payment_amount_formatted = SwpmMiscUtils::format_money( $payment_amount, $payment_currency ); //$button_image_url = get_post_meta($button_id, 'button_image_url', true);//Stripe doesn't currenty support button image for their standard checkout. //User's IP address $user_ip = SwpmUtils::get_user_ip_address(); $_SESSION['swpm_payment_button_interaction'] = $user_ip; //Sandbox settings $sandbox_enabled = $settings->get_value( 'enable-sandbox-testing' ); //API keys $api_keys = SwpmMiscUtils::get_stripe_api_keys_from_payment_button( $button_id, ! $sandbox_enabled ); $uniqid = md5( uniqid() ); $ref_id = 'swpm_' . $uniqid . '|' . $button_id; //Return, cancel, notifiy URLs $notify_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL . '/?swpm_process_stripe_sca_buy_now=1&ref_id=' . $ref_id; //We are going to use it to do post payment processing. $current_url = SwpmMiscUtils::get_current_page_url(); /* === Stripe Buy Now Button Form === */ $output = ''; $output .= '
    '; $output .= "
    "; $output .= "
    "; //Handle script and style loading for the button if ( ! wp_script_is( 'swpm.stripe', 'registered' ) ) { //In some themes (block themes) this may not have been registered yet since that process can be delayed. So register it now before doing inline script to it. wp_register_script("swpm.stripe", "https://js.stripe.com/v3/", array("jquery"), SIMPLE_WP_MEMBERSHIP_VER); } wp_enqueue_script("swpm.stripe"); wp_enqueue_style("swpm.stripe.style"); //initializing stripe for each button, right after loading stripe script $stripe_js_obj="stripe_".$button_id; wp_add_inline_script("swpm.stripe","var ".$stripe_js_obj." = Stripe('".esc_js( $api_keys['public'] )."');"); ob_start(); ?> '; //apply filter to output additional form fields $coupon_input = ''; $coupon_input = apply_filters( 'swpm_payment_form_additional_fields', $coupon_input, $button_id, $uniqid ); if ( ! empty( $coupon_input ) ) { $output .= $coupon_input; } $button_image_url = get_post_meta( $button_id, 'button_image_url', true ); if ( ! empty( $button_image_url ) ) { $output .= ''; } else { $output .= ""; } //Filter to add additional payment input fields to the form. $output .= apply_filters( 'swpm_stripe_payment_form_additional_fields', '' ); $output .= ''; $output .= '
    '; //End .swpm_button_wrapper return $output; } add_filter( 'swpm_payment_button_shortcode_for_stripe_sca_subscription', 'swpm_render_stripe_sca_subscription_button_sc_output', 10, 2 ); function swpm_render_stripe_sca_subscription_button_sc_output( $button_code, $args ) { $button_id = isset( $args['id'] ) ? sanitize_html_class($args['id']) : ''; if ( empty( $button_id ) ) { return '

    '.__('Error! swpm_render_stripe_sca_buy_now_button_sc_output() function requires the button ID value to be passed to it.', 'simple-membership').'

    '; } //Get class option for button styling, set Stripe's default if none specified $class = isset( $args['class'] ) ? sanitize_html_class($args['class']) : 'stripe-button-el'; //Check new_window parameter $window_target = isset( $args['new_window'] ) ? 'target="_blank"' : ''; $button_text = ( isset( $args['button_text'] ) ) ? esc_attr( $args['button_text'] ) : __( 'Buy Now' , 'simple-membership'); //Check the optional 'payment_method_types' paramter to see if it is set. Example value: payment_method_types="card,us_bank_account". //It can be used to enable ACH payment option. $payment_method_types = isset( $args['payment_method_types'] ) ? $args['payment_method_types'] : ''; $item_logo = ''; //Can be used to show an item logo or thumbnail in the checkout form. $settings = SwpmSettings::get_instance(); $button_cpt = get_post( $button_id ); //Retrieve the CPT for this button $item_name = htmlspecialchars( $button_cpt->post_title ); $membership_level_id = get_post_meta( $button_id, 'membership_level_id', true ); //Verify that this membership level exists (to prevent user paying for a level that has been deleted) if ( ! \SwpmUtils::membership_level_id_exists( $membership_level_id ) ) { return '

    '.__('Error! The membership level specified in this button does not exist. You may have deleted this membership level. Edit the button and use the correct membership level.', 'simple-membership').'

    '; } //$button_image_url = get_post_meta($button_id, 'button_image_url', true);//Stripe doesn't currenty support button image for their standard checkout. //User's IP address $user_ip = SwpmUtils::get_user_ip_address(); $_SESSION['swpm_payment_button_interaction'] = $user_ip; //Custom field data $custom_field_value = 'subsc_ref=' . $membership_level_id; $custom_field_value .= '&user_ip=' . $user_ip; if ( SwpmMemberUtils::is_member_logged_in() ) { $custom_field_value .= '&swpm_id=' . SwpmMemberUtils::get_logged_in_members_id(); } $custom_field_value = apply_filters( 'swpm_custom_field_value_filter', $custom_field_value ); //Sandbox settings $sandbox_enabled = $settings->get_value( 'enable-sandbox-testing' ); //API keys $api_keys = SwpmMiscUtils::get_stripe_api_keys_from_payment_button( $button_id, ! $sandbox_enabled ); //Billing address $billing_address = isset( $args['billing_address'] ) ? '1' : ''; //By default don't show the billing address in the checkout form. //if billing_address parameter is not present in the shortcode, let's check button option if ( $billing_address === '' ) { $collect_address = get_post_meta( $button_id, 'stripe_collect_address', true ); if ( $collect_address === '1' ) { //Collect Address enabled in button settings $billing_address = 1; } } $uniqid = md5( uniqid() ); $ref_id = 'swpm_' . $uniqid . '|' . $button_id; //Return, cancel, notifiy URLs $notify_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL . '/?swpm_process_stripe_sca_subscription=1&ref_id=' . $ref_id; //We are going to use it to do post payment processing. $current_url = SwpmMiscUtils::get_current_page_url(); $plan_id = get_post_meta( $button_id, 'stripe_plan_id', true ); /* === Stripe SCA Subscription Button Form === */ $output = ''; $output .= '
    '; $output .= "
    "; $output .= "
    "; //Handle script and style loading for the button if ( ! wp_script_is( 'swpm.stripe', 'registered' ) ) { //In some themes (block themes) this may not have been registered yet since that process can be delayed. So register it now before doing inline script to it. wp_register_script("swpm.stripe", "https://js.stripe.com/v3/", array("jquery"), SIMPLE_WP_MEMBERSHIP_VER); } wp_enqueue_script("swpm.stripe"); wp_enqueue_style("swpm.stripe.style"); //initializing stripe for each button, right after loading stripe script $stripe_js_obj="stripe_".$button_id; wp_add_inline_script("swpm.stripe","var ".$stripe_js_obj." = Stripe('".esc_js( $api_keys['public'] )."');"); ob_start(); ?> '; //apply filter to output additional form fields $coupon_input = ''; $coupon_input = apply_filters( 'swpm_payment_form_additional_fields', $coupon_input, $button_id, $uniqid ); if ( ! empty( $coupon_input ) ) { $output .= $coupon_input; } $button_image_url = get_post_meta( $button_id, 'button_image_url', true ); if ( ! empty( $button_image_url ) ) { $output .= ''; } else { $output .= ""; } //Filter to add additional payment input fields to the form. $output .= apply_filters( 'swpm_stripe_payment_form_additional_fields', '' ); $output .= ''; $output .= '
    '; //End .swpm_button_wrapper return $output;} payments/payment-gateway/admin_braintree_buy_now_button.php000064400000042645147206770760020544 0ustar00
    View the documentation  to learn how to create and use a Braintree Buy Now payment button.

    This is the ID of this payment button. It is automatically generated for you and it cannot be changed.

    Give this membership payment button a name. Example: Gold membership payment

    Select the membership level this payment button is for.

    Enter payment amount. Example values: 10.00 or 19.50 or 299.95 etc (do not put currency symbol).

    Enter you Braintree Merchant ID.

    Enter your Braintree public key.

    Enter your Braintree private key.

    Enter your Braintree Merchant Account ID (This is different than the Merchant ID you specified above). Please note currency depends on the Merchant Account ID you specify. Leave empty to use the default one.
    The currency for this button is set to:

    This is the URL the user will be redirected to after a successful payment. Enter the URL of your Thank You page here.

    = 0) { //The server is using at least PHP version 5.4.0 //Can use Braintree gateway library } else { //This server can't handle Braintree library echo '
    '; echo '

    The Braintree payment gateway library requires at least PHP 5.4.0. Your server is using a very old version of PHP that Braintree does not support.

    '; echo '

    Request your hosting provider to upgrade your PHP to a more recent version then you will be able to use the Braintree gateway.

    '; echo '

    '; return; } $bt_opts = array( 'button_type' => sanitize_text_field($_REQUEST['button_type']), ); render_save_edit_braintree_button_interface($bt_opts); } /* * *************************************************************** * Render edit Braintree Buy now payment button interface * ************************************************************** */ add_action('swpm_edit_payment_button_for_braintree_buy_now', 'swpm_edit_braintree_buy_now_button'); function swpm_edit_braintree_buy_now_button() { //Retrieve the payment button data and present it for editing. $button_id = sanitize_text_field($_REQUEST['button_id']); $button_id = absint($button_id); $button = get_post($button_id); //Retrieve the CPT for this button //$button_image_url = get_post_meta($button_id, 'button_image_url', true); $bt_opts = array( 'button_id' => $button_id, 'button_type' => sanitize_text_field($_REQUEST['button_type']), 'button_name' => $button->post_title, 'membership_level_id' => get_post_meta($button_id, 'membership_level_id', true), 'payment_amount' => get_post_meta($button_id, 'payment_amount', true), 'braintree_merchant_acc_id' => get_post_meta($button_id, 'braintree_merchant_acc_id', true), 'braintree_merchant_acc_name' => get_post_meta($button_id, 'braintree_merchant_acc_name', true), 'braintree_public_key' => get_post_meta($button_id, 'braintree_public_key', true), 'braintree_private_key' => get_post_meta($button_id, 'braintree_private_key', true), 'return_url' => get_post_meta($button_id, 'return_url', true), 'currency_code' => get_post_meta($button_id, 'currency_code', true), ); render_save_edit_braintree_button_interface($bt_opts, true); } /* * Process submission and save the new or edit Braintree Buy now payment button data */ // This function tries to get Merchant Account currency function swpm_get_braintree_default_currency($params) { $settings = SwpmSettings::get_instance(); $sandbox_enabled = $settings->get_value('enable-sandbox-testing'); if ($sandbox_enabled) { $braintree_env = "sandbox"; } else { $braintree_env = "production"; } require_once(SIMPLE_WP_MEMBERSHIP_PATH . 'lib/braintree/lib/autoload.php'); try { Braintree_Configuration::environment($braintree_env); Braintree_Configuration::merchantId($params['merc_id']); Braintree_Configuration::publicKey($params['public_key']); Braintree_Configuration::privateKey($params['private_key']); $merchantAccount = Braintree_MerchantAccount::find($params['merc_name']); } catch (Exception $e) { // Something went wrong. We actually don't care what exactly happened, so we just return '' return ''; } return $merchantAccount->currencyIsoCode; } add_action('swpm_create_new_button_process_submission', 'swpm_save_edit_braintree_buy_now_button_data'); add_action('swpm_edit_payment_button_process_submission', 'swpm_save_edit_braintree_buy_now_button_data'); //I've merged two (save and edit events) into one function swpm_save_edit_braintree_buy_now_button_data() { if (isset($_REQUEST['swpm_braintree_buy_now_save_submit'])) { //This is a Braintree buy now button save event. check_admin_referer( 'swpm_admin_add_edit_braintree_buy_now_btn', 'swpm_admin_add_edit_braintree_buy_now_btn' ); $button_id = wp_insert_post( array( 'post_title' => sanitize_text_field($_REQUEST['button_name']), 'post_type' => 'swpm_payment_button', 'post_content' => '', 'post_status' => 'publish' ) ); $button_type = sanitize_text_field($_REQUEST['button_type']); add_post_meta($button_id, 'button_type', $button_type); add_post_meta($button_id, 'membership_level_id', sanitize_text_field($_REQUEST['membership_level_id'])); add_post_meta($button_id, 'payment_amount', trim(sanitize_text_field($_REQUEST['payment_amount']))); add_post_meta($button_id, 'braintree_merchant_acc_name', trim(sanitize_text_field($_REQUEST['braintree_merchant_acc_name']))); add_post_meta($button_id, 'braintree_merchant_acc_id', trim(sanitize_text_field($_REQUEST['braintree_merchant_acc_id']))); add_post_meta($button_id, 'braintree_public_key', trim(sanitize_text_field($_REQUEST['braintree_public_key']))); add_post_meta($button_id, 'braintree_private_key', trim(sanitize_text_field($_REQUEST['braintree_private_key']))); add_post_meta($button_id, 'return_url', trim(sanitize_text_field($_REQUEST['return_url']))); //add_post_meta($button_id, 'button_image_url', trim(sanitize_text_field($_REQUEST['button_image_url']))); //Let's try to get currency code for current Merchant Account $params = array( 'merc_name' => trim(sanitize_text_field($_REQUEST['braintree_merchant_acc_name'])), 'merc_id' => trim(sanitize_text_field($_REQUEST['braintree_merchant_acc_id'])), 'public_key' => trim(sanitize_text_field($_REQUEST['braintree_public_key'])), 'private_key' => trim(sanitize_text_field($_REQUEST['braintree_private_key'])), ); $currency_code = swpm_get_braintree_default_currency($params); add_post_meta($button_id, 'currency_code', $currency_code); //Redirect to the manage payment buttons interface $url = admin_url() . 'admin.php?page=simple_wp_membership_payments&tab=payment_buttons'; SwpmMiscUtils::redirect_to_url($url); } if (isset($_REQUEST['swpm_braintree_buy_now_edit_submit'])) { //This is a Braintree buy now button edit event. check_admin_referer( 'swpm_admin_add_edit_braintree_buy_now_btn', 'swpm_admin_add_edit_braintree_buy_now_btn' ); $button_id = sanitize_text_field($_REQUEST['button_id']); $button_id = absint($button_id); $button_type = sanitize_text_field($_REQUEST['button_type']); $button_name = sanitize_text_field($_REQUEST['button_name']); $button_post = array( 'ID' => $button_id, 'post_title' => $button_name, 'post_type' => 'swpm_payment_button', ); wp_update_post($button_post); $prev_merc_acc_name = get_post_meta($button_id, 'braintree_merchant_acc_name', true); $new_merc_acc_name = trim(sanitize_text_field($_REQUEST['braintree_merchant_acc_name'])); update_post_meta($button_id, 'button_type', $button_type); update_post_meta($button_id, 'membership_level_id', sanitize_text_field($_REQUEST['membership_level_id'])); update_post_meta($button_id, 'payment_amount', trim(sanitize_text_field($_REQUEST['payment_amount']))); update_post_meta($button_id, 'braintree_merchant_acc_name', trim(sanitize_text_field($_REQUEST['braintree_merchant_acc_name']))); update_post_meta($button_id, 'braintree_merchant_acc_id', trim(sanitize_text_field($_REQUEST['braintree_merchant_acc_id']))); update_post_meta($button_id, 'braintree_public_key', trim(sanitize_text_field($_REQUEST['braintree_public_key']))); update_post_meta($button_id, 'braintree_private_key', trim(sanitize_text_field($_REQUEST['braintree_private_key']))); update_post_meta($button_id, 'return_url', trim(sanitize_text_field($_REQUEST['return_url']))); //update_post_meta($button_id, 'button_image_url', trim(sanitize_text_field($_REQUEST['button_image_url']))); if ($prev_merc_acc_name != $new_merc_acc_name) { //Looks like Merchant Account Name was modified, so let's try to request new currency code $params = array( 'merc_name' => trim(sanitize_text_field($_REQUEST['braintree_merchant_acc_name'])), 'merc_id' => trim(sanitize_text_field($_REQUEST['braintree_merchant_acc_id'])), 'public_key' => trim(sanitize_text_field($_REQUEST['braintree_public_key'])), 'private_key' => trim(sanitize_text_field($_REQUEST['braintree_private_key'])), ); $currency_code = swpm_get_braintree_default_currency($params); update_post_meta($button_id, 'currency_code', $currency_code); } echo '

    Payment button data successfully updated!

    '; } }payments/payment-gateway/paypal_advanced_buy_now_button_shortcode_view.php000064400000040736147206770760023637 0ustar00Error! swpm_render_pp_buy_now_new_button_sc_output() function requires the button ID value to be passed to it.

    '; // } $button_id = '4638'; //Membership level for this button $membership_level_id = get_post_meta( $button_id, 'membership_level_id', true ); //Verify that this membership level exists (to prevent user paying for a level that has been deleted) if (! SwpmUtils::membership_level_id_exists( $membership_level_id )) { return '

    Error! The membership level specified in this button does not exist. You may have deleted this membership level. Edit the button and use the correct membership level.

    '; } //Payment amount $payment_amount = get_post_meta( $button_id, 'payment_amount', true ); //Get the Item name for this button. This will be used as the item name in the IPN. $button_cpt = get_post( $button_id ); //Retrieve the CPT for this button $item_name = htmlspecialchars( $button_cpt->post_title ); $item_name = substr($item_name, 0, 127);//Limit the item name to 127 characters (PayPal limit) //User's IP address $user_ip = SwpmUtils::get_user_ip_address(); //Custom field data $custom_field_value = 'subsc_ref=' . $membership_level_id; $custom_field_value .= '&user_ip=' . $user_ip; if (SwpmMemberUtils::is_member_logged_in()) { $member_id = SwpmMemberUtils::get_logged_in_members_id(); $custom_field_value .= '&swpm_id=' . $member_id; //$member_first_name = SwpmMemberUtils::get_member_field_by_id($member_id, 'first_name'); //$member_last_name = SwpmMemberUtils::get_member_field_by_id($member_id, 'last_name'); //$member_email = SwpmMemberUtils::get_member_field_by_id($member_id, 'email'); } $custom_field_value = apply_filters( 'swpm_custom_field_value_filter', $custom_field_value ); /***************************************** * Settings and Button Specific Configuration *****************************************/ $settings = SwpmSettings::get_instance(); $live_client_id = $settings->get_value( 'paypal-live-client-id' ); $sandbox_client_id = $settings->get_value( 'paypal-sandbox-client-id' ); $sandbox_enabled = $settings->get_value( 'enable-sandbox-testing' ); $is_live_mode = $sandbox_enabled ? 0 : 1; $environment_mode = $sandbox_enabled ? 'sandbox' : 'production'; $currency = get_post_meta( $button_id, 'payment_currency', true ); $disable_funding_card = get_post_meta( $button_id, 'pp_buy_now_new_disable_funding_card', true ); $disable_funding_credit = get_post_meta( $button_id, 'pp_buy_now_new_disable_funding_credit', true ); $disable_funding_venmo = get_post_meta( $button_id, 'pp_buy_now_new_disable_funding_venmo', true ); $disable_funding = array(); if (! empty( $disable_funding_card )) { $disable_funding[] = 'card'; } if (! empty( $disable_funding_credit )) { $disable_funding[] = 'credit'; } if (! empty( $disable_funding_venmo )) { $disable_funding[] = 'venmo'; } $btn_type = get_post_meta( $button_id, 'pp_buy_now_new_btn_type', true ); $btn_shape = get_post_meta( $button_id, 'pp_buy_now_new_btn_shape', true ); $btn_layout = get_post_meta( $button_id, 'pp_buy_now_new_btn_layout', true ); $btn_color = get_post_meta( $button_id, 'pp_buy_now_new_btn_color', true ); $btn_width = get_post_meta( $button_id, 'pp_buy_now_new_btn_width', true ); $btn_height = get_post_meta( $button_id, 'pp_buy_now_new_btn_height', true ); $btn_sizes = array( 'small' => 25, 'medium' => 35, 'large' => 45, 'xlarge' => 55 ); $btn_height = isset( $btn_sizes[ $btn_height ] ) ? $btn_sizes[ $btn_height ] : 35; $return_url = get_post_meta( $button_id, 'return_url', true ); $txn_success_message = __( 'Transaction completed successfully!', 'simple-membership' ); /********************** * PayPal SDK Settings **********************/ //Configure the paypal SDK settings and enqueue the code for SDK loading. $settings_args = array( 'is_live_mode' => $is_live_mode, 'live_client_id' => $live_client_id, 'sandbox_client_id' => $sandbox_client_id, 'currency' => $currency, 'disable-funding' => $disable_funding, /*array('card', 'credit', 'venmo'),*/ 'intent' => 'capture', /* It is used to set the "intent" parameter in the JS SDK */ 'is_subscription' => 0, /* It is used to set the "vault" parameter in the JS SDK */ ); //Initialize and set the settings args that will be used to load the JS SDK. $pp_js_button = SWPM_PayPal_JS_Button_Embed::get_instance(); $pp_js_button->set_settings_args( $settings_args ); //Load the JS SDK on footer (so it only loads once per page) //Do not load this version of the JS SDK for ACDC buttons. //add_action( 'wp_footer', array( $pp_js_button, 'load_paypal_sdk' ) ); //The on page embed button id is used to identify the button on the page. Useful when there are multiple buttons (of the same item/product) on the same page. $on_page_embed_button_id = $pp_js_button->get_next_button_id(); //Create nonce for this button. $wp_nonce = wp_create_nonce( $on_page_embed_button_id ); //TODO - Remove this later. This is just for testing. //Force Cache Delete on page load. Delete the bearer token from cache to make sure it generates a new one. //SWPM_PayPal_Bearer::delete_cached_token();//Testing purpose only. $pp_acdc = new SWPM_PayPal_ACDC_Related(); $client_token = $pp_acdc->generate_client_token( $environment_mode ); $currency = isset( $currency ) ? $currency : 'USD'; $sdk_src_url = SWPM_PayPal_ACDC_Related::get_sdk_src_url_for_acdc( $environment_mode, $currency ); //return "";//TODO - remove later. //TODO - Remove this later. This is just for testing. //Force Cache Delete on page load. Delete the bearer token from cache to make sure it generates a new one. //$paypal_cache = SWPM_PayPal_Cache::get_instance(); //$paypal_cache->delete( SWPM_PayPal_Bearer::BEARER_CACHE_KEY );//Delete to reset the cache to make sure it generates a new one. // $merchant_id = SWPM_PayPal_Utility_Functions::get_seller_merchant_id_by_environment_mode( $environment_mode ); // echo '
    ------------Debug data Start------------
    '; // echo '
    PayPal Button Container ID: ' . $on_page_embed_button_id; // echo '
    Client ID: ' . $sandbox_client_id; // echo '
    Merchant ID: ' . $merchant_id; // echo '
    ------------Debug data End------------
    '; //TODO - Hardcoding the SDK SRC URL for testing purpose. //$sdk_src_url = 'https://www.paypal.com/sdk/js?components=buttons,card-fields&client-id=AWhSWfRz8trG53XGB_NojvmgFCJErbtqfyKsggUIK4N2of5c9pktXmgOksLM0pztnnmaGxXgYBg4Qatq';//Vidya's client-ID //$sdk_src_url = 'https://www.paypal.com/sdk/js?components=buttons,card-fields&client-id=AXXepw7uhkLrtey3bJFpNZQIigy15JsCfSBbZEno-lJiNs5Fqf2-_uqxGH6i8U-1Zc6k6QjSKVm48Wrg';//New account client-ID //$sdk_src_url = 'https://www.paypal.com/sdk/js?components=buttons,hosted-fields&client-id=AQ1G2q1dWrcPZzrioplED3qB0forkMUhS12VPcVoEvxSCHce7iNpAGgI12nUPNVgcQY7AuGp8iL6jAQQ'; //$sdk_src_url = 'https://www.paypal.com/sdk/js?components=buttons,hosted-fields&client-id=AeO65uHbDsjjFBdx3DO6wffuH2wIHHRDNiF5jmNgXOC8o3rRKkmCJnpmuGzvURwqpyIv-CUYH9cwiuhX'; //$sdk_src_url = 'https://www.paypal.com/sdk/js?components=buttons,hosted-fields&client-id=AeO65uHbDsjjFBdx3DO6wffuH2wIHHRDNiF5jmNgXOC8o3rRKkmCJnpmuGzvURwqpyIv-CUYH9cwiuhX¤cy=USD&intent=capture'; //$sdk_src_url = 'https://www.paypal.com/sdk/js?components=buttons,hosted-fields&client-id=AQ1G2q1dWrcPZzrioplED3qB0forkMUhS12VPcVoEvxSCHce7iNpAGgI12nUPNVgcQY7AuGp8iL6jAQQ&merchant-id=6P8SX89ESHD56¤cy=USD&intent=capture'; //echo '

    SDK Source URL: ' . $sdk_src_url . '

    '; //Get the bearer/access token. // $bearer = SWPM_PayPal_Bearer::get_instance(); // $bearer_access_token = $bearer->get_bearer_token( $environment_mode ); // echo '

    Bearer Access Token: ' . $bearer_access_token . '

    '; //$client_token = $bearer_access_token;//Testing with bearer access token //Commented code /* * * $sdk_src_url = 'https://www.paypal.com/sdk/js?components=buttons,hosted-fields&client-id=AQ1G2q1dWrcPZzrioplED3qB0forkMUhS12VPcVoEvxSCHce7iNpAGgI12nUPNVgcQY7AuGp8iL6jAQQ&merchant-id=6P8SX89ESHD56¤cy=USD&intent=capture'; */ $output = ''; ob_start(); ?>
    '; echo $error_message; echo '
    '; return; } SimpleWpMembership::enqueue_validation_scripts(); $settings = SwpmSettings::get_instance(); $force_strong_pass = $settings->get_value('force-strong-passwords'); if (!empty($force_strong_pass)) { $pass_class = apply_filters("swpm_registration_strong_pass_validation", "validate[required,custom[strongPass],minSize[8]]"); } else { $pass_class = ""; } //CSS class for the pass reset submit button $pass_reset_submit_class = 'swpm-pw-reset-submit'; $render_new_form_ui = SwpmSettings::get_instance()->get_value('use-new-form-ui'); if ( !empty( $render_new_form_ui ) ){ $pass_reset_submit_class .= ' swpm-submit-btn-default-style'; } ?> admin_add_ons_page.php000064400000040104147206770760011047 0ustar00' . "\n"; ?>

    'After Login Redirection', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-login-redirection.png', 'description' => 'Allows you to configure after login redirection to a specific page based on the member\'s level', 'page_url' => 'https://simple-membership-plugin.com/configure-login-redirection-members/', ); array_push($addons_data, $addon_1); $addon_2 = array( 'name' => 'MailChimp Integration', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/mailchimp-integration.png', 'description' => 'Allows you to signup the member to your MailChimp list after registration', 'page_url' => 'https://simple-membership-plugin.com/signup-members-mailchimp-list/', ); array_push($addons_data, $addon_2); $addon_3 = array( 'name' => 'Form Shortcode', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/form-shortcode-generator.png', 'description' => 'Simple Membership Addon to generate form shortcode for specific membership level.', 'page_url' => 'https://simple-membership-plugin.com/simple-membership-registration-form-shortcode-generator/', ); array_push($addons_data, $addon_3); $addon_4 = array( 'name' => 'Member Directory Listing', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-member-directory-listing-addon.png', 'description' => 'Allows you to create a list of all the users on your site, with pagination and search option.', 'page_url' => 'https://simple-membership-plugin.com/simple-membership-member-directory-listing-addon/', ); array_push($addons_data, $addon_4); $addon_5 = array( 'name' => 'Form Builder', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-form-builder.png', 'description' => 'Allows you to fully customize the fields that appear on the registration and edit profile forms of your membership site', 'page_url' => 'https://simple-membership-plugin.com/simple-membership-form-builder-addon/', ); array_push($addons_data, $addon_5); $addon_6 = array( 'name' => 'Custom Messages', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-custom-messages.png', 'description' => 'Custom Messages addon allows you to customize the content protection message that gets output from the membership plugin', 'page_url' => 'https://simple-membership-plugin.com/simple-membership-custom-messages-addon/', ); array_push($addons_data, $addon_6); $addon_7 = array( 'name' => 'WooCommerce Payments', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-woocommerce-addon.png', 'description' => 'This addon can be used to accept membership payment via the WooCommerce plugin', 'page_url' => 'https://simple-membership-plugin.com/woocommerce-simple-membership-plugin-integration/', ); array_push($addons_data, $addon_7); $addon_8 = array( 'name' => 'WP Express Checkout', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/wp-express-checkout-integration.png', 'description' => 'Allows you to integrate with the Express Checkout plugin to accept membership payments.', 'page_url' => 'https://simple-membership-plugin.com/wp-express-checkout-plugin-integration-for-membership-payment/', ); array_push($addons_data, $addon_8); $addon_9 = array( 'name' => 'Affiliates Manager', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/affiliates-manager-integration.png', 'description' => 'Allows you to integrate with the Affiliates Manager plugin so you can reward affiliates for sending paid members your way.', 'page_url' => 'https://wpaffiliatemanager.com/affiliates-manager-and-simple-membership-integration/', ); array_push($addons_data, $addon_9); $addon_10 = array( 'name' => 'Affiliate Platform', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/affiliate-platform-integration.png', 'description' => 'Allows you to integrate with the Affiliate Platform plugin so you can reward affiliates for sending paid members your way.', 'page_url' => 'https://simple-membership-plugin.com/simple-membership-and-wp-affiliate-platform-integration/', ); array_push($addons_data, $addon_10); $addon_11 = array( 'name' => 'bbPress Integration', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-bbpress-integration.png', 'description' => 'Adds bbPress forum integration with the simple membership plugin to offer members only forum functionality.', 'page_url' => 'https://simple-membership-plugin.com/simple-membership-bbpress-forum-integration-addon/', ); array_push($addons_data, $addon_11); $addon_12 = array( 'name' => 'Google reCAPTCHA', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/google-recaptcha-addon.png', 'description' => 'Allows you to add Google reCAPTCHA to your membership registration form/page.', 'page_url' => 'https://simple-membership-plugin.com/simple-membership-and-google-recaptcha-integration/', ); array_push($addons_data, $addon_12); $addon_13 = array( 'name' => 'Full Page Protection', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/full-page-protection-addon.png', 'description' => 'Allows you to protect the full post or page (header to footer).', 'page_url' => 'https://simple-membership-plugin.com/full-page-protection-addon-simple-membership/', ); array_push($addons_data, $addon_13); $addon_14 = array( 'name' => 'Protect Older Posts', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-older-posts-protection.png', 'description' => 'The protect older posts addon allows you to control protection of posts that were published before a member\'s access start date.', 'page_url' => 'https://simple-membership-plugin.com/simple-membership-protect-older-posts-addon/', ); array_push($addons_data, $addon_14); $addon_15 = array( 'name' => 'Custom Post Protection', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/custom-post-type-protection-enhanced.png', 'description' => 'Offers a better solution for protecting custom post type posts.', 'page_url' => 'https://simple-membership-plugin.com/simple-membership-addon-better-custom-post-type-protection/', ); array_push($addons_data, $addon_15); $addon_16 = array( 'name' => 'Partial Protection', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-partial-protection-addon.png', 'description' => 'Allows you to apply partial or section protection to posts and pages.', 'page_url' => 'https://simple-membership-plugin.com/apply-partial-section-protection/', ); array_push($addons_data, $addon_16); $addon_17 = array( 'name' => 'Member Data Exporter', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-data-exporter-addon.png', 'description' => 'Allows you to export all the members profile data and payments data to a CSV file.', 'page_url' => 'https://simple-membership-plugin.com/simple-membership-member-data-exporter-addon/', ); array_push($addons_data, $addon_17); $addon_18 = array( 'name' => 'Bulk Member Importer', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-bulk-member-importer-from-csv-addon.png', 'description' => 'Allows you to bulk import all your members info from a CSV file.', 'page_url' => 'https://simple-membership-plugin.com/simple-membership-bulk-import-member-data-csv-file/', ); array_push($addons_data, $addon_18); $addon_19 = array( 'name' => 'Display Member Payments', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-member-payments-addon.png', 'description' => 'This addon allows you to display the member payments on a page using a shortcode.', 'page_url' => 'https://simple-membership-plugin.com/simple-membership-member-payments-listing-addon/', ); array_push($addons_data, $addon_19); $addon_20 = array( 'name' => 'AWeber Integration', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-aweber-integration-addon.png', 'description' => 'You can automatically signup your members to a specific list in your AWeber account when they register.', 'page_url' => 'https://simple-membership-plugin.com/simple-membership-aweber-integration-addon/', ); array_push($addons_data, $addon_20); $addon_21 = array( 'name' => 'WP User Import', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/wp-user-import.png', 'description' => 'Addon for importing existing Wordpress users to Simple Membership plugin', 'page_url' => 'https://simple-membership-plugin.com/import-existing-wordpress-users-simple-membership-plugin/', ); array_push($addons_data, $addon_21); $addon_22 = array( 'name' => 'ConvertKit Integration', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-convertkit-integration-addon.png', 'description' => 'Allows you to automatically signup your members to a sequence in your ConvertKit account', 'page_url' => 'https://simple-membership-plugin.com/simple-membership-convertkit-integration-addon/', ); array_push($addons_data, $addon_22); $addon_23 = array( 'name' => 'Google First Click Free', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/google-first-click-free-addon.png', 'description' => 'Allows you to integrate with the Google First Click Free feature.', 'page_url' => 'https://simple-membership-plugin.com/simple-membership-google-first-click-free-integration-addon', ); array_push($addons_data, $addon_23); $addon_24 = array( 'name' => 'Miscellaneous Shortcodes', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-misc-shortcodes-addon.png', 'description' => 'This addon has a collection of miscellaneous shortcodes', 'page_url' => 'https://simple-membership-plugin.com/simple-membership-miscellaneous-shortcodes-addon/', ); array_push($addons_data, $addon_24); $addon_25 = array( 'name' => 'Show Member Info', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/show-member-info.png', 'description' => 'Allows you to show various member info using shortcodes.', 'page_url' => 'https://simple-membership-plugin.com/simple-membership-addon-show-member-info/', ); array_push($addons_data, $addon_25); $addon_26 = array( 'name' => 'iDevAffiliate', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/idevaffiliate-integration.png', 'description' => 'Allows you to integrate with iDevAffiliates so you can reward affiliates for sending paid members your way.', 'page_url' => 'https://simple-membership-plugin.com/simple-membership-and-idevaffiliate-integration/', ); array_push($addons_data, $addon_26); $addon_27 = array( 'name' => 'Expiry Email Notification', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/email-notification-and-broadcast-addon.png', 'description' => 'Allows you to configure and send various expiry email notifications for members.', 'page_url' => 'https://simple-membership-plugin.com/simple-membership-email-notification-broadcast-addon/', ); array_push($addons_data, $addon_27); $addon_28 = array( 'name' => '2 Factor Authentication', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/2fa-addon-icon.png', 'description' => 'This addon adds the 2 factor authentication for member login to increase login security.', 'page_url' => 'https://simple-membership-plugin.com/swpm-two-factor-authentication-addon/', ); array_push($addons_data, $addon_28); $addon_29 = array( 'name' => 'MailerLite Integration', 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-mailerlite-integration.png', 'description' => 'Allows you to automatically signup your members to a group in your MailerLite account.', 'page_url' => 'https://simple-membership-plugin.com/simple-membership-mailerlite-integration-addon/', ); array_push($addons_data, $addon_29); /*** Show the addons list ***/ foreach ($addons_data as $addon) { $output .= '
    '; $output .= '
    '; $img_src = $addon['thumbnail']; $output .= '' . $addon['name'] . ''; $output .= '
    '; //end thumbnail $output .='
    '; $output .='
    '; $output .= '' . $addon['name'] . ''; $output .='
    '; //end name $output .='
    '; $output .= $addon['description']; $output .='
    '; //end description $output .=''; //end detils link $output .='
    '; //end body $output .= '
    '; //end canvas } echo $output; ?>
    login.php000064400000010407147206770760006407 0ustar00get_value('reset-page-url'); $join_url = $setting->get_value('join-us-page-url'); // Filter that allows changing of the default value of the username label on login form. $label_username_or_email = __( 'Username or Email', 'simple-membership' ); $swpm_username_label = apply_filters('swpm_login_form_set_username_label', $label_username_or_email); $display_password_toggle = $setting->get_value('password-visibility-login-form'); if ( empty( $display_password_toggle ) ){ $display_password_toggle = false; } else{ $display_password_toggle = true; } //CSS class for the login submit button $login_submit_class = 'swpm-login-form-submit'; $render_new_form_ui = SwpmSettings::get_instance()->get_value('use-new-form-ui'); if ( !empty( $render_new_form_ui ) ){ $login_submit_class .= ' swpm-submit-btn-default-style'; } $hide_join_us_link_enabled = SwpmSettings::get_instance()->get_value('hide-join-us-link'); ?> admin_category_list.php000064400000004005147206770760011314 0ustar00

    prepare_items(); ?> display(); ?>
    admin_member_form_common_js.php000064400000001040147206770760012776 0ustar00 loggedin.php000064400000005371147206770760007073 0ustar00get('member_id'), 'subscription_status') === 'inactive'; ?> '; //Show the edit profile link $edit_profile_page_url = SwpmSettings::get_instance()->get_value('profile-page-url'); if (!empty($edit_profile_page_url)) { //Show the edit profile link echo ''; } //Show the logout link ?>
    index.html000064400000000000147206770760006547 0ustar00admin_tools_settings.php000064400000013153147206770760011530 0ustar00' . SwpmUtils::_('The required pages have been re-created.') . ''; } ?>




    ' . SwpmUtils::_('Link(s) generated successfully. The following link(s) can be used to complete the registration.') . ''; } else { echo '
    ' . SwpmUtils::_('Registration completion links will appear below') . '
    '; } ?>
    $link) { ?>
    ' . SwpmUtils::_('A prompt to complete registration email was also sent.') . ''; } ?>

    setup.php000064400000000476147207027650006436 0ustar00

    __( 'Choose an Akismet plan', 'akismet' ), 'classes' => array( 'akismet-button', 'akismet-is-primary' ) ) ); ?>
    stats.php000064400000002057147207027650006431 0ustar00
    true ) ); ?>
    notice.php000064400000033233147207027650006554 0ustar00 array( 'href' => true, 'target' => true, ), ); $kses_allow_strong = array( 'strong' => true ); if ( ! isset( $type ) ) { $type = false; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited } /* * Some notices (plugin, spam-check, spam-check-cron-disabled, alert and usage-limit) are also shown elsewhere in wp-admin, so have different classes applied so that they match the standard WordPress notice format. */ ?>
    A
    Almost done - configure Akismet and say goodbye to spam', 'akismet' ), $kses_allow_strong ); ?>

    https://akismet.com/errors/' . esc_attr( $code ) . '' ); ?>

    gethostbynamel function. Akismet cannot work correctly until this is fixed. Please contact your web host or firewall administrator and give them this information about Akismet’s system requirements.', 'akismet' ), esc_url( 'https://akismet.com/akismet-hosting-faq/' ) ), array_merge( $kses_allow_link, $kses_allow_strong, array( 'code' => true ) ) ); ?>

    our guide about firewalls.', 'akismet' ), esc_url( 'https://akismet.com/akismet-hosting-faq/' ) ), $kses_allow_link ); ?>

    update your payment details.', 'akismet' ), esc_url( 'https://akismet.com/account/' ) ), $kses_allow_link ); ?>

    Akismet account page to reactivate your subscription.', 'akismet' ), esc_url( 'https://akismet.com/account/' ) ), $kses_allow_link ); ?>

    Akismet support for assistance.', 'akismet' ), esc_url( 'https://akismet.com/contact/' ) ), $kses_allow_link ); ?>

    contributing a token amount.', 'akismet' ), esc_url( 'https://akismet.com/pricing' ) ), $kses_allow_link ); ?>

    Akismet support for assistance.', 'akismet' ), esc_url( 'https://akismet.com/contact/' ) ), $kses_allow_link ); ?>

    choose a plan to get started with Akismet.', 'akismet' ), esc_url( 'https://akismet.com/pricing' ) ), $kses_allow_link ); ?>

    get_var( "SELECT comment_ID FROM {$wpdb->comments} WHERE comment_approved = '0' LIMIT 1" ); if ( $at_least_one_comment_in_moderation ) { $check_pending_link = 'edit-comments.php?akismet_recheck=' . wp_create_nonce( 'akismet_recheck' ); } ?>

    check pending comments?', 'akismet' ), esc_url( $check_pending_link ) ), $kses_allow_link ); ?>

    contact Akismet support.', 'akismet' ), 'https://akismet.com/contact/' ), $kses_allow_link ); ?>

    our guide about firewalls and check your server configuration.', 'akismet' ), 'https://blog.akismet.com/akismet-hosting-faq/' ), $kses_allow_link ); ?>

    '; echo esc_html( __( 'Learn more about usage limits.', 'akismet' ) ); echo ''; break; case 'SECOND_MONTH_OVER_LIMIT': echo esc_html( __( 'Your Akismet usage has been over your plan’s limit for two consecutive months. Next month, we will restrict your account after you reach the limit. Please consider upgrading your plan.', 'akismet' ) ); echo ' '; echo ''; echo esc_html( __( 'Learn more about usage limits.', 'akismet' ) ); echo ''; break; case 'THIRD_MONTH_APPROACHING_LIMIT': echo esc_html( __( 'Your Akismet usage is nearing your plan’s limit for the third consecutive month. We will restrict your account after you reach the limit. Upgrade your plan so Akismet can continue blocking spam.', 'akismet' ) ); echo ' '; echo ''; echo esc_html( __( 'Learn more about usage limits.', 'akismet' ) ); echo ''; break; case 'THIRD_MONTH_OVER_LIMIT': case 'FOUR_PLUS_MONTHS_OVER_LIMIT': echo esc_html( __( 'Your Akismet usage has been over your plan’s limit for three consecutive months. We have restricted your account for the rest of the month. Upgrade your plan so Akismet can continue blocking spam.', 'akismet' ) ); echo ' '; echo ''; echo esc_html( __( 'Learn more about usage limits.', 'akismet' ) ); echo ''; break; default: } ?>

    logo.php000064400000001402147207027650006224 0ustar00 title.php000064400000000175147207027650006413 0ustar00

    activate.php000064400000000261147207027650007066 0ustar00

    get.php000064400000001771147207027650006054 0ustar00 0 ) { $submit_classes_attr = implode( ' ', $classes ); } ?>
    connect-jp.php000064400000011755147207027650007340 0ustar00

    status, array( 'no-sub', 'missing' ) ) ) { ?>

    user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>

    ' . esc_html( $akismet_user->user_login ) . '' ); ?>
    user_email ); ?>

    status == 'cancelled' ) { ?>

    user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>

    user_email ) ); ?>
    user_email ); ?>

    status == 'suspended' ) { ?>

    user_email ) ); ?>

    user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>

    ' . esc_html( $akismet_user->user_login ) . '' ); ?>
    user_email ); ?>


    config.php000064400000035701147207027650006542 0ustar00 array( 'href' => true, ), ); ?>
    $name ) ) ); ?>
    • spam ); ?> spam, 'akismet' ) ); ?>
    • spam ); ?> spam, 'akismet' ) ); ?>
    • accuracy ); ?>% missed_spam, 'akismet' ), number_format( $stat_totals['all']->missed_spam ) ) ) . ', '; /* translators: %s: number of false positive spam flagged by Akismet */ echo esc_html( sprintf( _n( '%s false positive', '%s false positives', $stat_totals['all']->false_positives, 'akismet' ), number_format( $stat_totals['all']->false_positives ) ) ); ?>

    %s', esc_url( admin_url( 'edit-comments.php?comment_status=spam' ) ), esc_html__( 'spam folder', 'akismet' ) ); // The _n() needs to be on one line so the i18n tooling can extract the translator comment. /* translators: %1$s: spam folder link, %2$d: delete interval in days */ $delete_message = _n( 'Spam in the %1$s older than %2$d day is deleted automatically.', 'Spam in the %1$s older than %2$d days is deleted automatically.', $delete_interval, 'akismet' ); printf( wp_kses( $delete_message, $kses_allow_link_href ), wp_kses( $spam_folder_link, $kses_allow_link_href ), esc_html( $delete_interval ) ); ?>

    next_billing_date ) : ?>
    status === 'active' ) : ?>
    ( $akismet_user->account_type === 'free-api-key' && $akismet_user->status === 'active' ? __( 'Upgrade', 'akismet' ) : __( 'Change', 'akismet' ) ), 'redirect' => 'upgrade', ) ); ?>
    start.php000064400000001460147207027650006425 0ustar00
    status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) { Akismet::view( 'connect-jp', compact( 'akismet_user' ) ); } else { Akismet::view( 'activate' ); } ?>
    enter.php000064400000002024147207027650006402 0ustar00

    predefined.php000064400000000476147207027650007403 0ustar00

    wp-config.php' ); ?>