News

Article updates

Rewrite – Map URLs

This functionality is available for PRO version.

The Map URLs module can be used to change individual URLs to custom ones. The interface consists of 2 fields, an Url to replace and an Url replacement.

Any site URL’s can be mapped to something else. Any type of asset works with re-mapping e.g JavaScript, Cascading Style Sheets, Media Images etc. An url should always start with a slash.


/wp-content/plugins/qxshop/assets/js/frontend/qxshop.min.js

to


/ecommerce.min.js

Directories can also be re-mapped, they need to end in a forward slash


/wp-content/cache/

to


/static-data/

The plugin cache directory can be easily changed to something else using something like this


/wp-content/cache/wph/

to


/app-data/

On WordPress MultiSite environment, if using multiple domains and specific URLs need to be changed per domain base; the –domain-name– should be replaced with actual one:


//--domain-name--/wp-content/plugins/woocommerce/assets/js/frontend/cart.js

to


//--domain-name--/shopp.js

There are a few requirements for a replacement and replace Url for the module to process:

  • The resource must be on the same domain as the website or if run on MultiSite, the resources must match one of the existing domains.
  • The URLs can start or not with a domain. If starts with a domain, a double slash should be prepended per above example.
  • If the asset has already been rewritten by another module but still needs further modification, the default URL format must be used. This format can be observed in the outputted HTML when no rewrite has been applied.
  • If there are multiple instances of the same URL (e.g. image asset) all will be replaced with the new provided Url.
  • Any incomplete or invalid URL, either the replaced or replacement makes the entry obsolete and will be ignored.

Preserve specific text / html block within outputted code

This functionality is available for PRO version.

The WordPress WP Hide & Security Enhancer PRO achieve provided functionality through internal filters and rewrite code. This ensure a perfect compatibility is maintained across the site without requiring to change anything at the code level or to any of WordPress files/folders structure. Any updating functionality for wither WordPress plugins/themes or custom code is preserved and it will run the same as before.

Generally, the plugin do the replacements at the end of WordPress core code execution, it will replace any occurrence of specific urls and paths with new ones which are being translated through rewrite code. In some situations, specific links, texts and html blocks are required to stay as is. To achieve that, there’s an easy approach, the specified blocks need to be wrapped up in a specific HTML comment tags:

<!– WPH Preserve – Start –>
block to preserve
<!– WPH Preserve – Stop –>

The following example preserve the content as is for a textarea field. Any matching urls and texts which will match the textarea content will not be replaced.


<!-- WPH Preserve - Start --> 

<p><textarea id="export_settings" class="code" readonly="readonly" rows="12">This is a preserved URL https://wp-hide.com/skin-nsp/images/logo.png</textarea></p>

<!-- WPH Preserve - Stop -->

Rewrite – Uploads

The WordPress is not flexible at all when it come to media upload location. The default path is a standard format which appear like this, for any attachments (images, archives etc):

<img class="alignnone size-full" src="http://domain.com/wp-content/uploads/2016/11/106658.jpg" alt="" width="640" height="390" alt="" />

Viewing such a link, it’s pretty obliviously it’s a WordPress site, and the link points to the uploads folder.

New Uploads Path

Using this option the default media folder can be mapped to another path, totally arbitrary. Using a slug like “media” the links become like this:

<img class="alignnone size-full" src="http://domain.com/media/106658.jpg" alt="" width="640" height="390" alt="" />

Block uploads URL

Once the uploads URL being changed, this option helps to block any access to old URL’s format, which are still available, even if URL mapped to another structure. If this option turned on, all new images inserted within posts (or any custom post type) will use the new URL format.

Redirect old URLs

This functionality redirect all old URLs using format /wp-content/uploads/ to the new upload path, specified through New Uploads Path.
The redirect type is 301 – Moved Permanently, is recommended for SEO purposes.

Create a custom Module Component, extending the plugin functionality

As default the WP Hide & Security Enhancer WordPress plugin include many features and functionalities which should be more than enough for a regular site to hide everything about WordPress and theme / plugins related data. As the WordPress ecosystem is huge and as it getting more complex, certain aspects may become uncovered and need a bit of customization. While there is a high chance so it become available on a later plugin version, you can still extend the code and make things happen.

Scroll to top