Hiding content with OpenCrypt

If you’re using a WordPress website (such as www.digi-pole.com) and provide secure member content using the build system called ‘OpenCrypt‘, then whenever WordPress is updated, the modifications to the source code gets overwritted, and the hidden text is no longer hidden (although items stored in the secure members area is still secure).

The file you need to update is:

/wp-includes/post-template.php

Around line 302, you should see something along the lines of:

    if ( $preview ) // Preview fix for JavaScript bug with foreign languages.
        $output =    preg_replace_callback( ‘/\%u([0-9A-F]{4})/’, ‘_convert_urlencoded_to_entities’, $output );

    return $output;
}

This needs to be changed as follows (with the additions in red)

    if ( $preview ) // Preview fix for JavaScript bug with foreign languages.
        $output =    preg_replace_callback( ‘/\%u([0-9A-F]{4})/’, ‘_convert_urlencoded_to_entities’, $output );

   # OpenCrypt Modification
    require “opencrypt_plugin.php”;
    # OpenCrypt Modification

return $output;
}

 

 

Updating the tag cloud text size in WordPress

If you use a WordPress blog system for your website, something which of course is very useful, is the list of ‘tags’ (keywords) you can assign to each of your blog posts.

However, in the current versions of WordPress, whenever you do a WordPress update, it returns the tag cloud to the default settings (ie the size varies considerably, depending on the number of times the tag is used throughout your website):

/wp-includes/category-template.php

Then around line 613, you should see something like the following:

$defaults = array(
  'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45,
  'format' => 'flat', 'separator' => "n", 'orderby' => 'name', 'order' => 'ASC',
  'exclude' => '', 'include' => '', 'link' => 'view', 'taxonomy' => 'post_tag', 'echo' => true
 ;

Simply change the font size of ‘smallest’ and ‘largest’ to your preferred point sizes (the default is normally around 12pt)

I personally prefer to change the smallest to ‘1’, the largest to ‘1’, the unit to ’em’, and then change the ‘separator’ from “\n” to “,\n” (thus adding a comma immediate after each tag, and prior to a space before the next tag).

$defaults = array(
 'smallest' => 1, 'largest' => 1, 'unit' => 'em', 'number' => 45,
 'format' => 'flat', 'separator' => ",\n", 'orderby' => 'name', 'order' => 'ASC',
 'exclude' => '', 'include' => '', 'link' => 'view', 'taxonomy' => 'post_tag', 'post_type' => '', 'echo' => true
    );