wp-blog-header.php): failed to open stream: No such file or directory in /home/

Need help with current error below. WP website is down and cannot even login to WP-admin. Anyone available to help resolve problem?

Warning: require(/home/mdvince/public_html/wp-blog-header.php): failed to open stream: No such file or directory in /home/mdvince/public_html/index.php on line 17

Fatal error: require(): Failed opening required ‘/home/mdvince/public_html/wp-blog-header.php’ (include_path=’.:/opt/alt/php74/usr/share/pear’) in /home/mdvince/public_html/index.php on line 17

Using Google Analytics in an enqueued JS file

I have a JS file custom-head.js that I have enqueued to run in the header as noted in functions.php here:

function enqueue_files() {      wp_enqueue_script( 'head_scripts', get_stylesheet_directory_uri() . '/js/custom-head.js', array('jquery'), null, false); } add_action( 'wp_enqueue_scripts', 'enqueue_files' ); 

Within that file I want to include my Google Analytics code. Yes, I realize I can add it to header.php or functions.php, but ideally I want to keep all of my scripts that are designed to be in the header in this one custom-head.js file.

//Global site tag (gtag.js) - Google Analytics jQuery(document).ready(function($  ) {     async src="https://www.googletagmanager.com/gtag/js?id=G-xxxxx"  //check if on the live domain versus dev if (document.location.hostname == 'website.com') {   window.dataLayer = window.dataLayer || [];   function gtag(){dataLayer.push(arguments);}   gtag('js', new Date());    gtag('config', 'G-xxxxx'); }  }); 

However, I am not getting the tag to fire correctly. Can you please advise on how to add these scripts?

MySQL: message “Incorrect key file for table” “try to repair it”

I’m using MySQL 5.7.10

I have a table like this, with 100M rows and a size of 16GB .

CREATE TABLE `my_table` (     `id` DOUBLE NOT NULL AUTO_INCREMENT,     `entity_id` DOUBLE NOT NULL,     `concept_id` VARCHAR(50) NOT NULL COLLATE 'utf8_spanish_ci',     `value` DOUBLE(15,6) NOT NULL,     `increment` DOUBLE(10,6) NULL DEFAULT NULL,     PRIMARY KEY (`id`),     INDEX `IDX_concept` (`concept_id`),     INDEX `IDX_entity` (`entity_id`) ) COLLATE='utf8_general_ci' ENGINE=InnoDB ROW_FORMAT=DYNAMIC AUTO_INCREMENT=118166425 

Once a month, I execute:

ALTER TABLE my_table ENGINE=InnoDB; 

My intention is to defrag the table, so the data are put together and the size keeps as low as possible.

This time, it failed and the failure message is: "Incorrect key file for table ‘my_table’; try to repair it".

I have made the following steps:

  1. Create a table like this: my_table2.
  2. Use mysqldump to dump my_table data in a file.
  3. Replace the create and the inserts to be done in "my_table2".
  4. Execute the file. my_table2 is created and each row in my_table exists in my_table2.
  5. Execute ALTER TABLE my_table2 ENGINE=InnoDB;

And it failed too, with the same message "Incorrect key file for table ‘my_table2’; try to repair it".

How could I fix the error? Thank you.

EDIT 1: I have executed CHECK TABLE for both tables, and the result is status OK, for both of them.

Server quit without updating PID file when trying to start MySQL server?

So I created my .bash_profile, opened it in a text editor and added:

export PATH=$  PATH:/usr/local/mysql/bin 

and then I saved it. Next, I tried running

sudo /usr/local/mysql/support-files/mysql.server start 

was told to enter my password (so I did), and then terminal said

Starting MySQL  

and then it kept printing dots until it said:

ERROR! The server quit without updating PID file (/usr/local/mysql/data/Nicks-MacBook-Pro.local.pid). 

The error logs look like:

2021-01-25T20:50:49.707062Z 0 [System] [MY-010116] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.23) starting as process 15092 2021-01-25T20:50:49.710232Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive 2021-01-25T20:50:49.834599Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2021-01-25T20:50:49.943719Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. 2021-01-25T20:50:50.037810Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock 2021-01-25T20:50:50.125494Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed. 2021-01-25T20:50:50.126128Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel. 2021-01-25T20:50:50.151069Z 0 [System] [MY-010931] [Server] /usr/local/mysql/bin/mysqld: ready for connections. Version: '8.0.23'  socket: '/tmp/mysql.sock'  port: 3306  MySQL Community Server - GPL. ~ ~ ~ ~ ~ (END) 

How do I fix this?

Upload file to Woocommerce Order

I’m trying to add File Upload for checkout process. Here is my code:

Add input after order notes

add_filter( 'woocommerce_after_order_notes', 'upload_file_checkout' ); function upload_file_checkout() {      ?>          <p class="form-row" id="image" data-priority="">         <label for="image" class="">Image (JPG, PNG, PDF)</label>         <span class="woocommerce-input-wrapper">         <input type='file' name='image' accept='image/*,.pdf' multiple='false'>         </span>     </p>         <?php } 

Next, update order meta

add_action( 'woocommerce_checkout_update_order_meta', 'checkout_file_update_order_meta' ); function checkout_file_update_order_meta($  order_id) {              if ( isset( $  _POST['image'] ) ) {                  require_once( ABSPATH . 'wp-admin/includes/image.php' );         require_once( ABSPATH . 'wp-admin/includes/file.php' );         require_once( ABSPATH . 'wp-admin/includes/media.php' );                  $  attachment_id = media_handle_upload( 'image', $  order_id );          update_post_meta( $  order_id, '_image', $  attachment_id );      }      } 

And show the result in admin page

add_action( 'woocommerce_admin_order_data_after_billing_address', 'show_new_checkout_field_order', 10, 1 );     function show_new_checkout_field_order( $  order ) {        $  order_id = $  order->get_id();    echo '<p><strong>Image:</strong> ' . get_post_meta( $  order_id, '_image', true ) . '</p>'; } 

But this is not work. How can I fix it?

This is how I see this meta in DB after place an order

enter image description here

Writing mathematical expression in a file

I am trying to write a mathematical expression as variable = expression in the output file.

The current method that I am doing is through WriteString as

expr = -((a*b*y^2*(-1 + z)*z*(1 + a*b + z))/(1 + a*b)^2) +         (z*(1 + a*b - a*b*z + (z + a*b*z)^2))/(1 + a*b)^2 -         (y*z*((-1 + z)^2 + a*b*(2 - 3*z + z^2) + a^2*b^2*(1 - z + z^2)))/(1 + a*b)^2 expression = CForm[expr] /. {Power->pow}; (*expression = CForm[HornerForm[expr]] /. {Power->pow};*) str=OpenWrite["output.hh"]; WriteString[str," double variable = ", expression,";"]; (*WriteString[str," double variable = ", ExportString[expression,"Text"]];*) Close[str]; 

The output is

 cat output.hh  double variable = -(a*b*(-1 + z)*z*(1 + a*b + z)*pow(1 + a*b,-2)*pow(y,2)) - y*z*pow(1 + a*b,-2)*(pow(-1 + z,2) + a*b*(2 - 3*z + pow(z,2)) + pow(a,2)*pow(b,2)*(1 - z + pow(z,2))) + z*pow(1 + a*b,-2)*(1 + a*b - a*b*z + pow(z + a*b*z,2)); 

I want to break the line as the original expr (or after some user-specified column say 80) i.e.

 double variable = -(a*b*(-1 + z)*z*(1 + a*b + z)*pow(1 + a*b,-2)*pow(y,2)) -                    y*z*pow(1 + a*b,-2)*(pow(-1 + z,2) + a*b*(2 - 3*z + pow(z,2)) + pow(a,2)*pow(b,2)*(1 - z + pow(z,2))) +                     z*pow(1 + a*b,-2)*(1 + a*b - a*b*z + pow(z + a*b*z,2)); 

Although this might not lead to optimized expression for numerical evaluation, however it is wanted as beautification. Also how should one optimize expression for further processing to other languages. Any suggestion? Experimental`OptimizeExpression and HornerForm are some options. Any other recommendation? MathCode is much costly 😀

google search brings wordpress post file name next to dns [closed]

Google search results are structured. SEO works fine, the only "complaint" is that URLs are displayed in search results. Actually it brings the wordpress post file name next to dns. I understand that the URL of a document is usually displayed in a search result in Google below the document title.

As per this: https://developers.google.com/search/docs/beginner/seo-starter-guide?ref_topic=9268559#urls-are-displayed-in-search-results

best practices include to use words in URLs that are relevant to your site’s content and structure are friendlier for visitors navigating your site, etc.

But can we somehow remove this path+file name?

enter image description here

I want the game over screen on this super mario bros C++ remake to trigger arduino/batch file

I found a someone who has listed the source code in C++ for their remake of Super Mario and I would like to know how I could edit the code for the "Game over screen" to trigger my Arduino or batch file (which ever is easier). The link to this source code is below. I’m pretty new but am every interested in getting this done. Any information would help. Thank you so much!

Github project link