I’ve these two database tables: User Tables Partner Tables User Tables will handle this kind of informations While Partner Tables will contains all the user meta information such as first name and last name, etc. When a user is register to the site I only want few fields which are, username, email addre…
Tag: php
Running a background task using Symfony Process without having to wait for the process to finish
After a user submits a form, I want to render a view file, and right after that I want to initiate a background task to process five MS Excel files (each may have up to 2000 rows) , but in way so that the user don’t have to wait for the process to finish in order to view the page.
Insecure PHP Login Form Exercise (Returns no errors, can’t figure it out.)
I have a Login script (it’s a basic demonstration exercise of PHP for the web class i’m in) that is insecure, but intentionally so. Advice regarding exploits will go unnoticed, as this is for testing …
WordPress add responsive srcset header image to theme
WP introduced support for srcset in version 4.4 for Thumbnails and Post images. But I can’t find a way to make the page header responsive. Here is how I embed the Page header: This loads the header image (which can be uploaded in the backend > Design > Customise) in an src. But I’d rather in…
php replace array value
I have following mysql query function: I get an array of objects with multiple keys: I am sending the whole array to the js via ajax. However, I want to change the date format to “ago” and send it to js. I have the “ago” function, but I am not sure how to target the date value and put …
how to convert from base64 to hexadecimal in php?
I was thinking to use this: The output for this example should always be 18 characters! But sometimes this output is less than 18. 24 (base64 characters) multiplied by 6 (bits per base64 character) equals to 144 (bits) divided by 8 (bits per ASCII character) equals to 18 ASCII characters. The problem is that …
WP_Ajax_UnitTestCase does not throw WPAjaxDieStopException
Ok so I am testing my ajax callbacks for my wordpress plugin. So I basically followed instructions here https://codesymphony.co/wp-ajax-plugin-unit-testing/ Here is my ajax callback function Here is my test Now here are the issues It doesn’t throw WPAjaxDieStopException exception like its suppose to whe…
How to display custom sidebar in specific WooCommerce category?
I have specific question about WooCommerce plugin. I am using WooCommerce Product Categories widget to show category menu on the left sidebar. On my website I have a category for special offers (which contains some subcategories and products) and I want other categories to be hidden from Woocommerce Product C…
WooCommerce hide order item meta from front end (not admin)
I have a couple of order item meta details that I would not like the customer to see (on the view orders page under account info). I have found a filter that will remove this data from the ADMIN (…
MySQL select user motto
I am stuck on this problem and I have been trying to solve for like 2 hours. I have a posts table which contains all posts. Each post has a column called ownerid which keeps the id of the owner of this post. And it also contains a column called groupid. What I want to have is to select all