Monday, April 9, 2018

Get Private Key and certificate from pfx file


1.       Get Private Key and certificate from pfx file (for this we need to install the SSL certificate):

a.       open cmd and go to the installation directory of openSSL
C:\Users\admin>cd %Installed Path of openSSL%

b.       Run the following commands:
C:\OpenSSL-Win32>set openssl_Home=%Installed Path of openSSL%
C:\OpenSSL-Win32>set openssl_conf=%Installed Path of openSSL%\bin\openssl.cfg
C:\OpenSSL-Win32>set path=%Installed Path of openSSL%

c.       Go to bin directory:
C:\OpenSSL-Win32>cd bin

d.       Run the below command to convert pfx file
C:\OpenSSL-Win32\bin>openssl pkcs12 -in mydomain.pfx -nodes

Here you will get private key and certificate

Wednesday, April 4, 2018

WP Super Cache — Content Encoding Error

if you are getting the below error:












Steps to fix this:

Go to the advanced settings page and make sure compression is disabled. 

 Since the host already ‘gzip compresses’ enabled, asking Super Cache to do that for you again ends up giving out these weird encoding errors.

Content Encoding Error

The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

* Please contact the website owners to inform them of this problem.



WordPress - Add custom field automatically when post or page is publish


Wordpress - Add custom field automatically when post or page is publish
 
Adding this snippet to the functions.php of your wordpress theme will add a custom field to a post or page when published. Don’t forget to update the FIELD_NAME and the CUSTOM VALUE.

add_action('publish_page', 'add_custom_field_automatically');
add_action('publish_post', 'add_custom_field_automatically');

function add_custom_field_automatically($post_ID) {
    global $wpdb;
    if(!wp_is_post_revision($post_ID)) {
               add_post_meta($post_ID, 'FIELD_NAME', 'CUSTOM VALUE', true);
    }
}