Link

Cache a large array: JSON, serialize or var_export?

http://techblog.procurios.nl/k/n618/news/view/34972/14863/cache-a-large-array-json-serialize-or-var_export.html

Link

Reset global variables that grow out of control during imports

https://developer.wordpress.org/reference/classes/wp_importer/stop_the_insanity/

AWS S3 Sync using Crontab

  1. Install AWS cli
    #Download cli script
    curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
    #unzip
    unzip awscli-bundle.zip
    #install
    ./awscli-bundle/install -b ~/bin/aws
    
  2. Create crontab script file : sync-s3.sh
    #/bin/bash
    export AWS_CONFIG_FILE="/root/.aws/config" #change it as per user
    export AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXXXHRQ
    export AWS_SECRET_ACCESS_KEY=XXXXXXXfHyR
    /usr/local/bin/aws s3 sync /var/www/testsite.com/htdocs/wp-content/uploads s3://my-imagestore/ --acl=public-read --debug
  3. Add crontab to sync s3 folder every 5 min : crontab -e
    */5 * * * * /bin/bash /root/sync-s3.sh >> /tmp/sync-s3.log

WordPress 4.3 Changes in Template Hierarchy

In WordPress  4.3 there is a new template file added in theme template hierarchy called singular.php . This will allow theme authors to use a common template for any singular post type.

It follows the rules of is_singular() and comes after single-{post-type}.php, single-post.php, single.php, andpage.php.

Template hierarchy for singular post types
Template hierarchy for singular post types

To learn more about WordPress theme template heirarchy : https://developer.wordpress.org/themes/basics/template-hierarchy/