php.ini – change for uploading large database

SQL ERROR: Script timeout passed, if you want to finish import, please resubmit same file and import will resume

php> php.ini

Find:
post_max_size = 8M
upload_max_filesize = 2M
max_execution_time = 30
max_input_time = 60
memory_limit = 8M

Change to:
post_max_size = 750M
upload_max_filesize = 750M
max_execution_time = 300
max_input_time = 540
memory_limit = 1000M

Refrence: http://askubuntu.com/questions/411505/script-timeout-passed-if-you-want-to-finish-import-please-resubmit-same-file-a

auto fill form field

name: <input id="de-name" type="text">
recomendation:	<input id="de-name" type="text">

/* auto field form field*/
jQuery(document).ready(function(){
	jQuery( "#de-name" ).keyup(function() {
		jQuery('#de-rec').val(jQuery('#de-name').val());
	});
});

count all meta values

function post_vierer(){
	global $wpdb;
	$result = $wpdb->get_results ("SELECT sum(meta_value) AS total FROM ".$wpdb->prefix."postmeta WHERE meta_key = 'post_views_count'");
	echo $result[0]->total;
}

Display
post_vierer();

Get a list of registered taxonomy

Get a list of registered taxonomy without link

 <?php
              	$terms = get_terms( 'features' );
				 if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){
					 echo '<ul>';
					 foreach ( $terms as $term ) {
					   echo '<li>' . $term->name . '</li>';
						
					 }
					 echo '</ul>';
				 }
			   ?>

Get a list of registered taxonomy with link

<?php
					$args = array( 'hide_empty' => 0 );
					$terms = get_terms( 'features', $args );
					if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
						$count = count( $terms );
						$i = 0;
						$term_list = '<p class="features-archive">';
						foreach ( $terms as $term ) {
							$i++;
							$term_list .= '<a href="' . get_term_link( $term ) . '" title="' . sprintf( __( 'View all post filed under %s', 'my_localization_domain' ), $term->name ) . '">' . $term->name . '</a>';
							if ( $count != $i ) {
								$term_list .= ' , ';
							}
							else {
								$term_list .= '</p>';
							}
					}
					echo $term_list;
				}
				?>

Get a list of registered taxonomy By ID in single post page

<?php 
				  foreach((get_the_terms($post->ID, 'html-tag')) as $term)
						 {
							$term_link = get_term_link( $term );
   							// If there was an error, continue to the next term.
    							if ( is_wp_error( $term_link ) ) {
        							continue;
    							}
							echo '<a href="' . esc_url( $term_link ) . '">' . $term->name . '</a>, ','';
						}
                  ?>

remove white space dreamweaver

find with: [rn]{2,}
replace with: n

Create log file

create file in root directory with this name “error_file.log”

add in wp-config.php
ini_set( “log_errors” , “1”);
ini_set( “error_log” , “error_file.log” );

Contact form 7 with proper subject

Add below line in from text box
[your-name]
harasdlariviere.com(Add your site domain)

change utf8mb while error in php myadmin

utf8mb4 to utf8

export database from custom file

export-mysql-database-sql-backup.php

<?php
//EXPORT_TABLES("your_host","db_user","db_pass","db_name" );
EXPORT_TABLES("127.0.0.1","swiftpub_cms","-;DTUXI$~ucc","swiftpub_cms" );  //or add 5th parameter(array) of specific tables: array("mytable1","mytable2","mytable3")

//https://github.com/tazotodua/useful-php-scripts
function EXPORT_TABLES($host,$user,$pass,$name,  $tables=false, $backup_name=false ){
	
	$mysqli = new mysqli($host,$user,$pass,$name); $mysqli->select_db($name); $mysqli->query("SET NAMES 'utf8'");
	$queryTables = $mysqli->query('SHOW TABLES'); while($row = $queryTables->fetch_row()) { $target_tables[] = $row[0]; }	if($tables !== false) { $target_tables = array_intersect( $target_tables, $tables); }
	foreach($target_tables as $table){
		
		$result	= $mysqli->query('SELECT * FROM '.$table);
		$fields_amount=$result->field_count;  $rows_num=$mysqli->affected_rows;
		
		$res = $mysqli->query('SHOW CREATE TABLE '.$table);
		
		if(!$res) {
	    	//echo $link->error;
		} else {
		    $TableMLine=$res->fetch_row();
		}

		$content = (!isset($content) ?  '' : $content) . "nn".$TableMLine[1].";nn";
		for ($i = 0, $st_counter = 0; $i < $fields_amount;   $i++, $st_counter=0) {
			while($row = $result->fetch_row())	{ //when started (and every after 100 command cycle):
				if ($st_counter%100 == 0 || $st_counter == 0 )	{$content .= "nINSERT INTO ".$table." VALUES";}
					$content .= "n(";
					for($j=0; $j<$fields_amount; $j++)  { $row[$j] = str_replace("n","\n", addslashes($row[$j]) ); if (isset($row[$j])){$content .= '"'.$row[$j].'"' ; }else {$content .= '""';}	   if ($j<($fields_amount-1)){$content.= ',';}		}
					$content .=")";
				//every after 100 command cycle [or at last line] ....p.s. but should be inserted 1 cycle eariler
				if ( (($st_counter+1)%100==0 && $st_counter!=0) || $st_counter+1==$rows_num) {$content .= ";";} else {$content .= ",";}	$st_counter=$st_counter+1;
			}
		} $content .="nnn";
	}
	$backup_name = $backup_name ? $backup_name : $name."___(".date('H-i-s')."_".date('d-m-Y').")__rand".rand(1,11111111).".sql";
	header('Content-Type: application/octet-stream');	header("Content-Transfer-Encoding: Binary"); header("Content-disposition: attachment; filename="".$backup_name.""");  echo $content; exit;
}
?>

font generator

https://web-font-generator.com