This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Exclude some extra dirs from the WordPress plugin check plugin. | |
*/ | |
function my_wp_plugin_check_ignore_directories( $dirs ) { | |
// For reference, the default dirs as of v1.0.1 | |
// $default_ignore_directories = array( | |
// '.git', | |
// 'vendor', | |
// 'node_modules', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add specific members-only categories back to main loop | |
* when filtering searches and archives. | |
* Updated for PMPro 3.0+. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Don't let existing members checkout for a free level. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_registration_checks_stop_free_checkouts( $okay ) { | |
global $pmpro_level; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Clean passwords out of access logs. | |
# Be sure to update the LOG_FILE line to match the location of your log file. | |
# This will edit your log files. You can back it up and then delete the backup if this works. | |
# This will also create a file scrubbed_emails.txt with a list of affected emails. | |
# This requires that both the password and password2 fields be in the logs. | |
# If you don't have password2 fields, edit the script to use the field that comes after password in your logs. | |
## | |
#!/bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Currently, the PMPro user fields GUI does not allow you to choose | |
* the checkbox_grouped field type. | |
* | |
* These fields can be added via custom code though. If you want to manage some | |
* aspects of the field in the GUI, you can create a multiselect field, | |
* then swap it to the checkbox group using this code. | |
* | |
* You can add this recipe to your site by creating a custom plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/includes/integrations/class-pmp.php b/includes/integrations/class-pmp.php | |
index 00a1c89..b133e69 100644 | |
--- a/includes/integrations/class-pmp.php | |
+++ b/includes/integrations/class-pmp.php | |
@@ -47,8 +47,7 @@ class Affiliate_WP_PMP extends Affiliate_WP_Base { | |
public function init() { | |
add_action( 'pmpro_added_order', array( $this, 'add_pending_referral' ), 10 ); | |
- add_action( 'pmpro_updated_order', array( $this, 'mark_referral_complete' ), 10 ); | |
- add_action( 'admin_init', array( $this, 'revoke_referral_on_refund_and_cancel' ), 10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Integrations: Paid Memberships Pro | |
* | |
* @package AffiliateWP | |
* @subpackage Integrations | |
* @copyright Copyright (c) 2016, Sandhills Development, LLC | |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License | |
* @since 1.8 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Tag inactive users. | |
* One time script. To run, visit /?delete_inactive_users=1 as an admin. | |
* An inactive user: | |
* - Has no logins within the last 2 years. | |
* - Has no paid orders. | |
* - Has no support tickets. | |
* ? Add inactive taxonomy to users? Then delete users in that taxonomy? | |
* Get users who are tagged for deletion: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find members with active paid memberships but their last order was > 12 months ago. | |
SELECT | |
m.user_id, | |
m.membership_id, | |
u.user_email, | |
MAX(o.timestamp) as last_order_timestamp | |
FROM | |
wp_pmpro_memberships_users m | |
LEFT JOIN wp_users u ON m.user_id = u.ID | |
JOIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Check if this class has already been loaded. | |
if ( class_exists( 'Rate_Limiter' ) ) { | |
return; | |
} | |
/** | |
* RateLimiter Class | |
* Limit the number of times a user can perform an action within a given period of time. | |
*/ |
NewerOlder