First, Lets find out what version of PHP we're running (To find out if it's the default version).
To do that, Within the terminal, Fire this command:
which php
| <LocationMatch "^/(wp-login\.php|kanri\.php|wp-admin)"> | |
| order deny,allow | |
| deny from all | |
| allow from 1.0.16.0/20 | |
| allow from 1.0.64.0/18 | |
| allow from 1.1.64.0/18 | |
| allow from 1.5.0.0/16 | |
| allow from 1.21.0.0/17 | |
| allow from 1.21.128.0/18 |
| Plesk email users often get their passwords lost. | |
| Fortunately Parallels has implemented a command to see all passwords for all users in all domains: | |
| `/usr/local/psa/admin/bin/mail_auth_view` | |
| You can filter the output to see one account password (quotes must exist): | |
| `/usr/local/psa/admin/bin/mail_auth_view | grep "johnsmith@domain.tld"` |
| function enableCommentByCat() { | |
| global $wpdb; | |
| $getPosts = new WP_Query( array( 'category_name' => 'ten_category') ); | |
| if ( $getPosts->have_posts() ) { | |
| while ( $getPosts->have_posts() ) { | |
| $getPosts->the_post(); | |
| $postId = get_the_ID(); | |
| $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET comment_status = 'open' WHERE ID=$postId")); | |
| } | |
| } else { |
| <? | |
| /** | |
| * @param String $str The input string | |
| * @return String The string without accents | |
| */ | |
| function removeAccents( $str ) | |
| { | |
| $a = array('À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ð', | |
| 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', 'Ø', 'Ù', 'Ú', 'Û', 'Ü', 'Ý', 'ß', 'à', 'á', 'â', 'ã', | |
| 'ä', 'å', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ñ', 'ò', 'ó', 'ô', 'õ', |
| <?php | |
| // ======= PATHINFO ====== // | |
| $x = pathinfo($url); | |
| $x['dirname'] 🡺 https://example.com/subFolder | |
| $x['basename'] 🡺 myfile.php?var=blabla#555 // Unsecure! | |
| $x['extension'] 🡺 php?var=blabla#555 // Unsecure! | |
| $x['filename'] 🡺 myfile | |
| // ======= PARSE_URL ====== // | |
| $x = parse_url($url); |
| [ | |
| { | |
| "name": "(UTC -11:00) Pacific/Midway", | |
| "code": "Pacific/Midway" | |
| }, | |
| { | |
| "name": "(UTC -11:00) Pacific/Niue", | |
| "code": "Pacific/Niue" | |
| }, | |
| { |
| <?php | |
| function install_next_post_sc(){ | |
| $class = 'next_post_'; | |
| global $post; | |
| $categories = get_the_category($post->ID); | |
| if(!empty($categories)){ | |
| $category = $categories[0]->term_id; | |
| } else { | |
| $category = ''; | |
| } |
| <?php | |
| /** | |
| * Infinite next and previous post looping in WordPress | |
| */ | |
| if( get_adjacent_post(false, '', true) ) { | |
| previous_post_link('%link', '← Previous Post'); | |
| } else { | |
| $first = new WP_Query('posts_per_page=1&order=DESC'); $first->the_post(); | |
| echo '<a href="' . get_permalink() . '">← Previous Post</a>'; | |
| wp_reset_query(); |