This file contains hidden or 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
xhr: function() { | |
var xhr = new window.XMLHttpRequest(); | |
xhr.upload.addEventListener("progress", function(evt){ | |
if (evt.lengthComputable) { | |
var percentComplete = evt.loaded / evt.total; | |
percentComplete = (percentComplete.toFixed(2) * 100); | |
// add a progress bar container | |
if ( $('#upload-progress',container).length == 0 ) { | |
$(container).append('<div id="upload-progress" style="background: rgba(255, 186, 186, 0.32); width: 0; overflow: hidden; padding: 4px;"></div>'); | |
} |
This file contains hidden or 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 | |
/** | |
* WordPress Transients - Helper Class | |
* | |
* Makes it easier to store transients and call them and all in like 4 lines of code | |
* Helps you save large amounts of data (arrays) without the confusing proccess of | |
* chunking data into batches, and joining later upon getting all the data and also | |
* deleting all of these batches correctly. This class does it all for you. | |
* |
This file contains hidden or 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 | |
/** | |
* Plugin Name: Restrict mail TLD registration | |
* Plugin URI: http://samelh.com | |
* Description: Allow/disallow user registration for email TLD | |
* Author: Samuel Elh | |
* Author URI: http://samelh.com | |
* Version: 0.1 | |
*/ |
This file contains hidden or 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 | |
/** | |
* Plugin Name: No Spam Registration with JavaScript | |
* Plugin URI: http://blog.samelh.com | |
* Description: Prevents spam registration on your WordPress blog/website by adding a necessary form field with JavaScript on document load | |
* Author: Samuel Elh | |
* Author URI: http://samelh.com | |
* Version: 0.1 | |
*/ |
This file contains hidden or 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_action('admin_init', function() { | |
// Specify here the plugin name and that's all | |
$requested_name = 'AJAX File Upload'; | |
function se_plugin_has_update( $name ) { | |
if ( ! function_exists( 'get_plugin_updates' ) ) { | |
require_once ABSPATH . 'wp-admin/includes/update.php'; |
This file contains hidden or 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 | |
function se_bbpm_add_spam_check() { | |
/** | |
* add spam check for users with bbp_spectator and bbp_participant roles | |
* Add more roles in the $targetRoles line or replace existing ones to match | |
* your targeted users | |
*/ |
This file contains hidden or 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_action('bbpm_conversation_form_additional_fields', function() { | |
/** | |
* Follows is just an example on how to implement a simple captcha, | |
* You can set the answer in a cookie or database option and fetch | |
* it with a unique key, or store it somewhere else, use honeypot and | |
* spam hidden traps, reCaptcha, or simply a captcha image.. | |
*/ |
This file contains hidden or 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 | |
function se_bbpm_add_spam_check() { | |
/** | |
* add spam check for users with bbp_spectator and bbp_participant roles | |
* Add more roles in the $targetRoles line or replace existing ones to match | |
* your targeted users | |
*/ |
This file contains hidden or 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 | |
/* | |
Plugin Name: Users Table Last Seen | |
Plugin URI: http://samelh.com | |
Description: updates users last seen status each time they browse the front-end and adds last seen to users table with user last seen time difference | |
Author: Samuel Elh | |
Version: 0.1 | |
Author URI: http://samelh.com | |
*/ |