http://twitter.com/share?text=<TITLE>&url=<URL>
E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com
http://www.facebook.com/sharer.php?u=&p[title]=
| <?php | |
| // Customized the comment form fields ( not the comment text area ) | |
| add_filter('comment_form_default_fields', 'my_comment_form_args'); | |
| // Customizes the text area - you have to do this here, rather than in comment_form_default_fields | |
| add_filter('comment_form_field_comment', 'my_comment_form_field_comment'); | |
| // Customized the comment notes above the form fields | |
| add_filter( 'comment_form_defaults', 'my_comment_form_defaults' ); |
| <?php | |
| /* add this to your theme's functions.php file */ | |
| /* Add option for URL to column settings */ | |
| vc_add_param("vc_column", array( | |
| "type" => "vc_link", | |
| "class" => "", | |
| "heading" => "Column Link", |
| # command to generate dhparams.pen | |
| # openssl dhparam -out /etc/nginx/conf.d/dhparams.pem 2048 | |
| limit_conn_zone $binary_remote_addr zone=conn_limit_per_ip:10m; | |
| limit_req_zone $binary_remote_addr zone=req_limit_per_ip:10m rate=5r/s; | |
| limit_req_status 444; | |
| limit_conn_status 503; | |
| proxy_cache_path /var/lib/nginx/proxy levels=1:2 keys_zone=backcache:8m max_size=50m; | |
| proxy_cache_key "$scheme$request_method$host$request_uri$is_args$args"; |
| # wp-secure.conf | |
| # | |
| # | |
| # This file includes common security considerations for wordpress using nginx. | |
| # | |
| # The goal is to block actions which are usually dangerous to wordpress. | |
| # Additionally, we block direct access to PHP files and folders which should not | |
| # be accessed directly from a browser. | |
| # | |
| # Also have included exceptions for plugins that are known to require this access. |
http://bookofzeus.com/harden-ubuntu/initial-setup/system-updates/
Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get autoclean
| <?php | |
| function wp_log_http_requests( $response, $args, $url ) { | |
| // set your log file location here | |
| $logfile = plugin_dir_path( __FILE__ ) . '/http_requests.log'; | |
| // parse request and response body to a hash for human readable log output | |
| $log_response = $response; | |
| if ( isset( $args['body'] ) ) { |
| <?php | |
| /** | |
| * Plugin Name: Disable ACF on Frontend | |
| * Description: Disable ACF functions on the front-end of WordPress in order to provide a performance boost. | |
| * Version: 2.0 | |
| * Author: Lee Peterson | |
| * Author URI: http://www.leepeterson.me | |
| * License: MIT | |
| * License URI: http://www.opensource.org/licenses/mit-license.php | |
| */ |
| function cmb2_render_book_field_callback( $field, $value, $object_id, $object_type, $field_type_object ) { | |
| // make sure we specify each part of the value we need. | |
| $value = wp_parse_args($value, array( | |
| 'book-photo' => '', | |
| 'book-name' => '', | |
| 'book-price' => '', | |
| 'book-id' => '', | |
| )); | |
| ?> |
| <?php | |
| add_filter( 'the_content', 'crd_append_post_links' ); | |
| function crd_append_post_links( $content ) { | |
| if ( is_page() ) { | |
| $post_links_data = get_post_meta( get_the_ID() ); | |
| if ( isset( $post_links_data[ 'blog_group' ][ 0 ] ) ) { | |
| $blog_list = maybe_unserialize( $post_links_data[ 'blog_group' ][ 0 ] ); | |
| $posts_list = '<ul>'; | |
| foreach ( $blog_list as $post_info ) { |