How to show my application as referral in WordPress Stats

It is not possible to directly set a referrer. See: https://stackoverflow.com/questions/14235377/http-referer-and-bookmark You can still track this data by passing a parameter in the url and then listening for that parameter in WordPress. For example, you could set the parameter from_desktop in the url, so your url would look like www.example.com/page-slug/?from_desktop=1. Once you’ve got this going … Read more

Finding and removing unnecessary redirects

While in the process of implementing a CSP and defining the allowed sources, I was shocked to find the total number of resources ShareThis calls. At the time of writing this, I counted a total of 39 domains and subdomains it uses. Not a big surprise anymore why ShareThis was causing my slow page load … Read more

Rewrite Url to a SEO-friendly format

The easiest way to do this is with the built-in $wp_rewrite global. Something like this should give you a good start: function new_rewrite_rules(){ global $wp_rewrite; $keytag = ‘%user_id%’; $wp_rewrite->add_rewrite_tag($keytag, ‘(.+?)’, ‘user=”); $structure = $wp_rewrite->root . “username-$keytag/”; $rewrite = $wp_rewrite->generate_rewrite_rules($structure); if(!is_array($wp_rewrite->rules)) $wp_rewrite->rules = array(); $wp_rewrite->rules = $rewrite + $wp_rewrite->rules; return $wp_rewrite->rules; } You would then access … Read more

Rewrite rules goes away

properties_add_rewrite_rules should be hooked to init so it runs on every request. Rules can be flushed at any time- loading the permalinks settings page calls flush_rewrite_rules, and your rules weren’t added on that request, so they disappear.

Custom taxonomy Rewrite Rule

You could use 2 of WordPress’ built in functions to get the result you’re after. add_rewrite_tag() and add_rewrite_rule() There is an example of how to use these tags to get the result you want about halfway down this page https://codex.wordpress.org/Rewrite_API/add_rewrite_rule. Note: remember to flush your rewrite rules.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)