I am developing a custom plugin on WordPress for a client. Just a simple question: when I am using update_post_meta() and update_user_meta(), do I need to use the WordPress sanitization functions? I was under the impression that I don't, since the documentation says that $meta_key and $meta_value should be raw.  Are there any other instances / WordPress features in a plugin wherein I will need to sanitize my data?
I want to make sure all of the data in my plugins/themes is handled securely  before entering the database and before being output to the browser. My problem is that there are situations where the API handles the sanitization for you -- like when saving post meta fields -- and others where the plugin/theme author is wholly responsible for doing it -- like when saving custom settings.  For the scope of this question, I'm not concerned about validating data at the domain level -- e.g., checking that an Age field on a form is between 0 and 120, or that an e-mail address is valid. I'm only concerned about security -- e.g., escaping SQL queries to avoid SQL injection when saving to the database, or sanitizing data that's output to HTML templates to avoid XSS.  For output sanitization, I know that you always need to use functions like esc_html() and esc_attr() when echo'ing variables into HTML templates. But, what about when using ? Do they all sanitize the output already? If so, for which context (general HTML, tag attributes, etc)? Some functions have variants for different contexts (like the_title_attribute(), but most don't.  For input sanitization, I know that I need to use $wpdb-&gt;prepare() when making manual queries, but what about when using the Settings API to create a plugin settings page, or saving post meta fields for a custom post type?  Right now I've just been digging through Core and reading tutorials every time I use a function to find out if it sanitizes or not, but that's error-prone and time consuming. I'm hoping to find some kind of comprehensive list of all the possible situations and whether or not the API handles it. e.g.,  API validates/sanitizes   Saving post meta with update_postmeta() Saving user meta with update_user_meta() Outputting a post title - use the contextually appropriate variant of the_title() etc   You have to manually validate/sanitize   Saving plugin options with the Settings API. Pass a callback as the 3rd parameter of register_setting(). Direct database queries: Wrap the query in $wpdb-&gt;prepare(). Outputting variables in HTML. Use esc_attr(), esc_html(), etc etc   I'd also be interested to understand why the API provides it in certain situations, but not others. I'm assuming it has something to do with the unknown nature of the data, but would love to hear a thorough explanation.
Why isn't a virus "alive"? The recent  about a new supermassive virus being discovered got me thinking about how we define viruses as non-living organisms whilst they are bigger than bacteria, and much more complex than we first gave them credit for.   What biological differences between viruses and cellular organisms have made viruses be deemed non-living? There is an "Informed" badge for reading the meta about page but it was awarded zero times and to make sure I tried reading the about page but did not receive it. If the badge is to be awarded here, then this should be 'fixed'. If not, it should be removed from the list of badges. If $f,g : [a,b] \to (0,\infty)$ are continuous functions, prove that there exists $c \in (a,b)$ such that: $$\int_{a}^{c} f(x) \ \mathrm dx = \int_{c}^{b} g(x) \ \mathrm dx$$ Number of bases of an n-dimensional vector space over q-element field. If I have an n-dimensional vector space over a field with q elements, how can I find the number of bases of this vector space? Getting the Volume of an Uneven Mesh How do you return to the default view (the one you see when blender starts)? Query Feature and Usage based entitlements license I need to query programmatically the Feature license and usage-based license which is available in UI. Could someone please highlight if we can query the same or is it available in UI only, Thanks. At some point, the filesystem on my digital audio player has become read-only. I cannot copy files into it or remove files on it.  Are there some possible reasons for the player's file system to change permissions in this way?  I tried using chmod:  $ sudo chmod a+rw SGTL\ MSCN/  chmod: changing permissions of `SGTL MSCN/': Read-only file system   SGTL MSCN is the mount point of the digital audio player.  What else can I try to make it writeable? If $\sin(a)\sin(b)\sin(c)+\cos(a)\cos(b)=1$ then find the value of $\sin(c)$ Suppose $K/F$ is an extension field, and $E_1$ and $E_2$ are two intermediate subfields of finite degree. Let $E$ be the subfields of $K$ generated by $E_1$ and $E_2$. I'm trying to prove that $$ [E:F]\leq[E_1:F][E_2:F].$$  Since $E_1$ and $E_2$ are finite extensions, I suppose they have bases $\{a_1,\dots,a_n\}$ and $\{b_1,\dots,b_m\}$, respectively. If $E_1=F$ or $E_2=F$, then the inequality is actually equality, so I suppose both are proper extension fields. I think $E=F(a_1,\dots,a_n,b_1,\dots,b_m)$. Since $\{a_1,\dots,a_n,b_1,\dots,b_m\}$ is a spanning set for $E$ over $F$,  $$[E:F]\leq n+m\leq nm=[E_1:F][E_2:F]$$ since $m,n&gt;1$.  Is this sufficient? I'm weirded out since the problem did not ask to show $[E:F]\leq [E_1:F]+[E_2:F]$ which I feel will generally be a better upper bound. More often that I like to admit I look for a file that contains some strings.  Currently I do:  grep -rl string1 | xargs grep -l string2 | xargs grep -l string3   Is there a tool that does this prettier?  This greps for string1 or string2 or string3.   grep -rl -e string1 -e string2 -e string3   I want files that contain string1 and string2 and string3 but not necessarily on the same line.  Maybe one of the modern greps (ag/ack/rg/sift) can do this? What is the difference between "is subject to" and "is subjected to"? I found the following sentence on the U.S. Customs and Border Protection website:     All persons, baggage, and other merchandise arriving in or leaving the   United States are subject to inspection and search by CBP officers.   I would like to know whether changing "subject" to "subjected" will change the meaning of the sentence. p-value approach - clarify teacher's solution? So I have a question with my teacher's solution below and I'm confused about one of the steps in their solution. I would appreciate some clarification.  Two brands of coffee were compared. Two independent random samples of 50 people each were asked to taste either Brand A or Brand B coffee, and indicate whether they liked it or not. Eighty four percent of the people who tasted Brand A liked it; the analogous sample proportion for Brand B was ninety percent.   (A) At α = 0.01, is there a significant difference in the proportions of individuals who like the two coffees? Use the p-value approach.   So I circled in blue a step where I'm confused about in the teacher's solution. I don't understand why P(Z&lt;-0.89) = 0.2061.   On the z-score table -0.89 is equal to 0.1867 so shouldn't it be that value instead? where did 0.2061 come from? Is it possible that the teacher made an error or am I not understanding something? I've been trying to work out what generic means but I'm not making much progress.   You can find an example of the usage of the word generic for example : "School on Generic Singularities in Geometry" or :  "Rigidity of generic singularities of mean curvature flow"  Here is what I have so far:  I found  which mentions   "... "generic" singularities, i.e., singularities that appear for almost all maps ..."  Just after that he mentions "generic maps" but does not elaborate on what it means. He mentions it later (kind of) by saying  "...The precise definition of a generic map is very delicate; for the moment, we say only that any map may be approached by a generic map (up to an approximation on the derivatives of order r), and that any map that is sufficiently close to a generic map, in the preceding sense, is itself generic. ..."  and later  on he gives a definition of "generic singularity of a singular set":  "... A critical point $x$ of $S_r$ will be called transversally critical, or, furthermore, generic, if the tangent planes to $ \overline{f}(\mathbb R^n) $ and $F_r$ are in general position at the point $\overline{f} (x)$ of the Grassmannian, which is assumed to be ordinary on $F_r$ . ..."  Does this mean that generic and transversally critical are synonyms?  I feel I still don't understand what generic means even after reading this definition and part of the article.      Please could someone help me understand what generic means? Prevent Serialization of Base Class Adding a Link to a Field in a Field Set? String queryFields = null;              for(Schema.FieldSetMember field : SObjectType.Task.FieldSets.Activity_Detail_Page.getFields()){                  queryFields = (queryFields == null ? field.getFieldPath() : queryFields+', '+field.getFieldPath());               }                String query = 'Select '+queryFields+' from Task where Id=\''+activityId+'\'';               task = Database.query(query);   i'll creating a field-set,now how do i add link on any field?  above code is  for dynamically query creation . below code of page   &lt;apex:pageBlock title="Activity" id="Block1"&gt;       &lt;apex:pageBlockSection title="Activity Detail"&gt;         &lt;apex:repeat value="{!$ObjectType.Task.FieldSets.Activity_Detail_Page}" var="field"&gt;             &lt;apex:outputField value="{!Task[field.fieldPath]}" /&gt;         &lt;/apex:repeat&gt;     &lt;/apex:pageBlockSection&gt; &lt;/apex:pageBlock&gt;    As per the image attached, I want to add a link in Rounded field that liks to account. Can any one help me? so I am creating a few posts about bearings and wheels, (story so far):      I have now got the wheels, bearings and freehub working.  Started riding to work this morning and I almost couldn't stop at a junction.  Thankfully wasn't going too fast.  I physically can not get the wheel to lock.  I have to use both brakes at full force to get the bike to roll to a stop.  If I only use one brake I would not stop at any junction in time.  Could the cause be any of the following:   Over greased bearings? Over greased axle? not tightened cone hubs enough? not tighted axle enough?   I do not have any grease on the disk brakes them selves.  Rather nervous getting on the bike now.  Don't seem to be doing too well with this bike home fixing thing.  over greased bearings?  EDIT  Forgot to mention that it is hydraulic disk brakes.  EDIT 2  So in the end I took it to the LBS as I didn't have much confidence in my self at this point.  They had to replace the front pads but where able to clean the rear and cleaned the rotors.  (I had tried to clean the rotors but obviously not vigorously enough).  He said it was a bit of a pain to do.  All is working again.  They double checked my wheels and said I had put them back together correctly which is reassuring.  Thanks for all the help What is the difference between HTML tags  and ? I would like to ask for some simple examples showing the uses of &lt;div&gt; and &lt;span&gt;.   I've seen them both used to mark a section of a page with an id or class, but I'm interested in knowing if there are times when one is preferred over the other. Do I have to re-enter the Schengen area to activate my second visa when traveling on back-to-back Schengen visas? I currently have a valid multiple entry Schengen visa that expires on Feb 10th (issued by the Spanish consulate). I need to visit the Czech Republic from Feb 9th to Feb 15th. For this, I am getting a visa starting Feb 11th from the Czech consulate as I was advised that I cannot have two simultaneous visas.   Is it possible for me to enter Czech republic on the current visa on Feb 9th, and stay past its expiry up to Feb 15th using the new visa without leaving the Czech Republic? Will there be any likely problem either while entering or exiting Schengen zone (I am entering Schengen in Frankfurt)? Can a massless rope accelerate?