Using next code in wp-config.php file is possible to allow WordPress use more memory for its processes and increase the process performance time:
| define('WP_MEMORY_LIMIT', '500M'); set_time_limit (300); // 300 secs = 5min. - in wp-config.php |
If its necessary to clean all HTML tags and JS scripts from any content next PHP function will do the job
Using JavaScript function ‘splice’ for removing items from JavaScript array
If we have associative PHP array and its necessary print it in JavaScript array, we ca use next PHP code:
| <script> <?php $any_array_keys = array_keys($any_associative_array); array_walk($any_array_keys, create_function('&$str', '$str = "\"$str\"";')); $any_array_keys= implode(',', $any_array_keys); ?> var woof_accept_array = ['min_price','orderby','woof_author',<?php echo $any_array_keys ?>]; </script> |
If its necessary to check is string we got is serialized array and unserialize it if its true
If its necessary, for example in any PHP loop (foreach) using any defined logic call specialized function with arguments by that logic – next code will do it:
| $json = call_user_func_array('json_encode', $args); |
If its necessary to stop execution of PHP process in WordPress and show to the user any message with the reason of it, next function will do it:
| function wp_die($message = '', $title = '', $args = array()) |
Apache .htaccess script for access restrictions
How to make parsing of link query by PHP