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
| /* Add Google Tag Manager javascript code as close to | |
| the opening <head> tag as possible | |
| =====================================================*/ | |
| function add_gtm_head(){ | |
| ?> | |
| <!-- Google Tag Manager --> | |
| <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | |
| new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | |
| j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= |
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
| # see https://github.com/cmaessen/docker-php-sendmail for more information | |
| FROM php:5-fpm | |
| RUN apt-get update && apt-get install -q -y ssmtp mailutils && rm -rf /var/lib/apt/lists/* | |
| RUN docker-php-ext-install mysql mysqli sysvsem | |
| RUN pecl install xdebug-2.5.5 \ | |
| && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \ |
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 /** @noinspection SpellCheckingInspection */ | |
| /** | |
| * This file contains the WordPress code for rendering a Google Reviews badge. | |
| * | |
| * Usage: | |
| * | |
| * 1. Create a Google API Console account if you have not already done so. | |
| * 2. Register for the Google Places API. | |
| * 3. Create an API key. | |
| * 4. Ensure that the API key can be used from wherever this script will execute |
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
| function isOnScreen(elem) { | |
| // if the element doesn't exist, abort | |
| if( elem.length == 0 ) { | |
| return; | |
| } | |
| var $window = jQuery(window) | |
| var viewport_top = $window.scrollTop() | |
| var viewport_height = $window.height() | |
| var viewport_bottom = viewport_top + viewport_height | |
| var $elem = jQuery(elem) |
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
| // Create login form shortcode | |
| function tcl_add_login_shortcode() { | |
| add_shortcode( 'gated_resources', 'tcl_login_form_shortcode' ); | |
| } | |
| //Shortcode callback | |
| function tcl_login_form_shortcode() { | |
| if (is_user_logged_in()) ?> |
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
| //Basic "Down for Maintenance" template | |
| <!doctype html> | |
| <title>Down For Maintenance</title> | |
| <style> | |
| body { text-align: center; padding: 150px; } | |
| h1 { font-size: 50px; } | |
| body { font: 20px Helvetica, sans-serif; color: #333; } | |
| article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
| a { color: ##0085CA; text-decoration: none; } |
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: Multiple Roles per User | |
| * Description: Allows anyone who can edit users to set multiple roles per user. In a default WordPress environment that wouldn't have much of an effect, since the user would have the privileges of the top-privileged role that you assign to him. But if you have custom roles with custom privileges, this might be helpful. | |
| * Version: 1 | |
| * Author: nikolov.tmw | |
| * Author URI: http://paiyakdev.com/ | |
| * License: GPL2 | |
| */ |
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
| /** Security Headers */ | |
| add_action('send_headers', function(){ | |
| // Enforce the use of HTTPS | |
| header("Strict-Transport-Security: max-age=31536000; includeSubDomains"); | |
| // Prevent Clickjacking | |
| header("X-Frame-Options: SAMEORIGIN"); | |
| // Prevent XSS Attack | |
| header("Content-Security-Policy: default-src 'self' https://* http://*; connect-src 'self' https://* http://*; font-src 'self' https://* http://* blob: data:; frame-src 'self' https://* http://* blob: data:; img-src 'self' https://* http://* blob: data:; media-src 'self' https://* http://* blob: data:; object-src 'self' https://* http://* blob: data:; script-src 'self' https://* http://* 'unsafe-inline' 'unsafe-eval'; style-src 'self' https://* http://* 'unsafe-inline'; worker-src https://* http://* blob: data:"); |
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
| #ADD A NO-INDEX, NO-FOLLOW OPTION | |
| Header set X-Robots-Tag "noindex, follow" | |
| # MAINTENANCE-PAGE REDIRECT | |
| # ADD MAINTENANCE.HTML IN THE WEB ROOT | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine on | |
| RewriteCond %{REMOTE_ADDR} <your IP: !^1\.2\.3\.4> | |
| RewriteCond %{REQUEST_URI} !/maintenance.html$ [NC] | |
| RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC] |