1
vote
1answer
69 views

How to improve a file access permission/deny function?

I've quickly made a function to deny or allow access to files that are only used thru Ajax Calls. Key Generator /** * Generate a key for file access permission * * Function that returns a key to ...
2
votes
2answers
60 views

Is this function properly structured, leading to a secure row insertion?

I have the following function to insert a new row into a table: /** * Insert row into the designated table * * Function to add a new row into the designated table * * @param str $table ...
2
votes
1answer
70 views

How to optimize function that checks if a directory is empty when having over a million files inside?

I have the following function to confirm if a directory contains files: /** * Check if the directory is empty * * Function to ascertain if the specified directory contains files. * Comparing to ...
4
votes
1answer
184 views

Is this code efficient?

I was wondering if this was a decent way of handling this function. Please take a look. // Use Less Mixins from Theme Options to adjust Stylesheets before Parsing Less to CSS add_filter( 'less_vars', ...
17
votes
7answers
1k views

Is_numeric_array() missing!

I found that in PHP (or i probably can't find it) a proper is_numeric_array($array) function is missing. So i created one. The problem is that i don't think it's great and i don't know how to improve ...