Removing large amounts of rows from MySQL 5.7 table + ibdata increase question

I’m working with MySQL 5.7 on Windows.

I’ve got several tables to clean data from. Largest table’s ibd file is 300GB in size and it has almost 1.5 billion lines. I need to leave about 290 million rows in it. So a very large chunk needs to be removed.

From reading the docs there are 2 ways

  1. DELETE statement and OPTIMIZE TABLE after that
  2. copying data to a new table, dropping the old one and renaming the new one.

Second option seems much better in this case, but it there any potential issues to look our for? Downtime is not really an issue.

Another question, I saw that delete statement on big tables (deleting 1 million+ rows) can get stuck and then cause ibdata to grow (hundreds of MB), even though innodb_file_per_table option is on.

I assume that has to do with temporary tables somehow, but can’t find an explanation. Any ideas?

Option for removing block not appearing in custom gutenberg block

I’m developing a custom gutenberg block. I’m able to get the fields to appear and I’m able to interact with it when adding it to a page. But the menu that allows you to remove the block does not appear when it’s highlighted. I’m referring to the menu in the screenshot below

enter image description here

I’m using the esnext syntax and this is what my main block js file looks like

    import "./style.scss"; import "./editor.scss";  const { __, setLocaleData } = wp.i18n; const {     registerBlockType, } = wp.blocks; const {     RichText,     MediaUpload, } = wp.editor; const { Button } = wp.components;  registerBlockType( 'tc-blocks/hero-block', {     title: __( 'Hero Block', 'tc-blocks' ),     icon: 'index-card',     category: 'layout',     attributes: {         title: {             type: 'string',             source: 'attribute',             selector: 'h2',         },         mediaID: {             type: 'number',         },         mediaURL: {             type: 'string',             source: 'attribute',             selector: 'img',             attribute: 'src',         },     },     edit: ( props ) => {         const {             className,             attributes: {                 title,                 mediaID,                 mediaURL,             },             setAttributes,         } = props;         const onChangeTitle = ( value ) => {             setAttributes( { title: value } );         };          const onSelectImage = ( media ) => {             setAttributes( {                 mediaURL: media.url,                 mediaID:,             } );         };          return (             <div className={ className }>                 <RichText                     tagName="h2"                     placeholder={ __( 'Write Titleā€¦', 'tc-blocks' ) }                     value={ title }                     onChange={ onChangeTitle }                 />                 <div className="tc-image">                     <MediaUpload                         onSelect={ onSelectImage }                         allowedTypes="image"                         value={ mediaID }                         render={ ( { open } ) => (                             <Button className={ mediaID ? 'image-button' : 'button button-large' } onClick={ open }>                                 { ! mediaID ? __( 'Upload Image', 'tc-blocks' ) : <img src={ mediaURL } alt={ __( 'Upload Image', 'tc-blocks' ) } /> }                             </Button>                         ) }                     />                 </div>             </div>         );     },     save: ( props ) => {         const {             className,             attributes: {                 title,                 mediaURL,             },         } = props;         return (             <div className={ className }>                 <RichText.Content tagName="h2" value={ title } />                  {                     mediaURL && (                         <img className="tc-image" src={ mediaURL } alt={ __( 'Image', 'tc-blocks' ) } />                     )                 }             </div>         );     }, } ); 

Here’s how I’m registering the block type in my index.php file

function tc_blocks_hero_block_block_init() {     register_block_type_from_metadata( __DIR__ ); } add_action( 'init', 'tc_blocks_hero_block_block_init' ); 

And here’s my block.json file

{ "apiVersion": 2, "name": "tc-blocks/hero-block", "title": "Hero Block", "category": "widgets", "icon": "smiley", "description": "This is a header block built for a large hero image and text", "supports": {     "html": false }, "textdomain": "hero-block", "editorScript": "file:./build/index.js", "editorStyle": "file:./build/index.css", "style": "file:./build/style-index.css"  } 

I’ve compared my code to the gutenberg examples code found here but I can’t seem to find any major differences that would cause an issue and I don’t see any js errors in the console.

How do I get the remove block menu to appear in my custom block?

How to prevent WordPress Media Library from removing image?

I have a custom post type that must have its feature image. Its feature image also appears in the Media Library where user can delete the image/attachment file permanently. But I want to prevent user from deleting the feature image of my custom post type. So I use the following hook to intercept the ajax request, validate if user is deleting the image of my custom post type and stop the process by using wp_die().

add_filter('pre_delete_attachment', 'check_my_custom_post_type', 0, 2); function check_my_custom_post_type($  delete, $  post) {     if (Yes it is image of my custom type) {         wp_die('My message', 'My title', ['response' => 400]);     } } 

It works fine on the server side. The image of my custom post type cannot be deleted. But Media Library, on the client side, still removes the image from its views even the image on the server side has not been deleted and an exception 400 has been thrown.

How to prevent Media Library from removing images from its views on the client side if image has not been deleted on the server side?

Can Dispel Magic be used on a specific magical effect without removing other spells?

During tonight’s game, the party’s wizard became confused because of a failed save against Yeenoghu’s flail, which had the effect of:

The target must succeed on a DC17 Wisdom saving throw or be affected by the confusion spell until the start of Yeenoghu’s next turn.

The wizard was in this position because they’d had multiple buff spells placed on them like Shapechange, Haste, and something else.

However, being confused was a big problem that the party decided needed to go. So the cleric cast Dispel Magic with the intent to just target the magical effect of confusion caused by Yeenoghu.

Dispel Magic says:

Choose one creature, object, or magical effect within range. Any spell of 3rd level or lower on the target ends. For each spell of 4th level or higher on the target, make an ability check using your spellcasting ability. The DC equals 10 + the spell’s level. On a successful check, the spell ends.

With this in mind, the question I have is two-fold.

First all, is the confusion effect targetable by dispel magic? It seems like it should be because the effect is described to be like a specific spell’s effect.

Secondly, if the cleric casts dispel magic on the wizard to end the confusion, can they do so without risking removing all of the other buff spells?

PHP Codes to removing duplicate url from one list compared to other list

First i was trying to removing same urls from 2 different urls list and can’t found it so I’m deciding to make it using php to removing urls from List 1 if found on List 2 on the same filename.
With this codes you can make sure that there is no duplicated urls on the other urls list if you need to run multiple urls list on your GSA SER

To make this codes work, you need to identifying first the raw urls using GSA Platform Identified or GSA SER and then putting them to 2 different folder then setup the path

Feel free to modifying or improving this codes

$ files = glob('D:\GSA\List\GlobalList\*.txt');
$ comparepath = "D:\GSA\List\IndonesiaList";
//$ comparefile = "D:\htdocs\serpresults\betresultsEN.txt";
foreach ($ files as $ key => $ value)
    $ i = 0;
    $ file_path = pathinfo($ value);
    $ comparefile = $ comparepath."/".$ file_path['basename'];
    if (file_exists($ comparefile))
        echo "Removing duplicate from ".$ value." and ".$ comparefile." ";
        $ contenta = file($ value);
        $ contentb = file($ comparefile);
        if (!empty($ contenta) && !empty($ contentb))
            foreach ($ contenta as $ keyc => $ cvalue)
                $ grhost = parse_url($ cvalue, PHP_URL_HOST);
                if (!empty($ grhost))
                    if (empty(preg_grep("/\b$ grhost\b/i", $ contentb)))
                        //$ result = $ grscheme."://".$ grhost;
                        $ cleanurl[] = $ cvalue.PHP_EOL;
                        $ i++;
            //$ diff = array_diff($ contentb, $ contenta);
            $ cleanfile = fopen($ value, 'r+');
            $ cleanarr = implode($ cleanurl);
            ftruncate($ cleanfile, 0);
            rewind($ cleanfile);
            fwrite($ cleanfile, $ cleanarr);
            fclose($ cleanfile);
            unset($ contenta);
            unset($ contentb);
            unset($ cleanarr);
    echo "Found ".$ i." duplicate on ".$ value."\n";
    unset($ i);

Shield spell – removing the special effects of a hit


A Shield spell is cast as a reaction to an attack that hits. It applies its AC bonus even against the attack to which it is a reaction, meaning that it can make the attack that hit, retroactively miss and thereby not do damage.

Shield ‘interrupts’/potentially cancels its trigger, as stated in the DMG in the ‘Adjudicating Reaction Timing’ section.

Since the hit has retroactively become a miss, what happens to effects that were triggered by the hit in the first place? Are they undone as well, or do they persist?

This question has two answers of nearly equal popularity, with one arguing that other effects triggered by the hit still persist, and the other arguing that they do not. On the side of the argument that they do not occur is a (now-unofficial) tweet from Jeremy Crawford stating

If the attack has a special effect that relies on it hitting, that effect doesn’t occur if the attack is turned into a miss.

However, the discussion therein focusses on a narrow interpretation of ‘effects’ as discrete, measurable things that happen to specified targets – the hit on the caster of the Armor, and the resulting damage to the creature making the attack.

Are the ‘special effects’ of an attack referred to limited to things like damage or conditions that affect just the target of the attack, or do they include intangibles like knowledge for all intelligent observers?


A party is traversing wilderness with abundant natural cover as well as opponents who are seeking to ambush them.

A hidden opponent fires a missile weapon at a party spellcaster and hits. In response, the spellcaster uses the shield spell and turns the attack into a miss. However, the ambusher has now revealed their location to the spellcaster and everyone else in the party, since according to the rules of Unseen Attackers and Targets

If you are hidden–both unseen and unheard–when you make an attack, you give away your location when the attack hits or misses.

The party members begin to defend themselves and target the ambusher.

The next round, a second hidden ambusher also fires at the spellcaster, hits, and also reveals their presence to the caster and the rest of the party. The spellcaster again uses shield, and again converts the hit into a miss.

This second ambusher, however, possesses the Skulker Feat (PHB 170)

When you are hidden from a creature and miss it with a ranged weapon attack, making the attack doesn’t reveal your position.

Since the attack was now actually a miss, does the knowledge of ambusher’s location persist as revealed, or is this knowledge undone?

…the shield spell travel back in time, converting the hit to a miss before the party had knowledge of the second ambusher’s location?

…knowledge of the ambusher’s location count as a ‘special effect’ of the attack hitting, that now does not occur since the attack resolved as a miss?

…the ‘special effect’ of the knowledge of the ambusher’s location get removed from only the caster, while their companions still know where the ambusher is?

…the knowledge of the ambusher’s location not count as a ‘special effect’ of the attack, but rather as mundane effect, that is not changed by the shield spell?

A good answer may use the Crawford quote or not. If it does, it should convincingly interpret what is a ‘special effect’ and to whom it applies. If the answer does not use the Crawford tweet, it should explain from where it draws its reasoning.

How to stop WooCommerce from removing link functionality in uploaded PDF products

my site uses WooCommerce to sell downloadable PDFs which should have clickable links, but when these PDFs are downloaded after purchase, the links are no longer clickable. I’ve searched everywhere I can think to try to find a resolution to the problem. Has anyone encountered this before?

I’ve tried downloading with multiple browsers and opening the files in Acrobat and Preview, to no avail, so I think it looks like the links are being removed on upload to the site. I use an image optimiser (Smush) to process images on upload to the site, but this doesn’t affect PDFs.

I’m a little perplexed, any insight would be much appreciated.

Site rankings tanked after removing 1750 Blog tags

I recently removed 1750 tags from my company’s blog. Many of them were irrelevant or synonyms created by someone who didn’t know how to use tags, some were even misspellings. I removed 1730 of them, removing them from the tag section in WordPress, as well as from the actual article in the QuickEdit section.

I was under the impression this would add to SEO efforts, as many articles detail that, such as this one from Yoast. However, rankings for the keyword "recruitment software" dropped from #17 to #30. Other more niched keywords lost rankings for the homepage altogether, and a blog post appeared there instead (albeit a few ranking spots lower).

I’m worried that removing all those tags have produced 404 errors which have caused the nose-dive in rankings :/, should 301 redirects be created for each lost tag webpage? In the WordPress backend, Yoast was suggesting I do that with their app’s premium version as I was deleting. Any ideas would be much appreciated, as you can imagine the fright and dread I got from losing rankings like that overnight.

FYI, it has been a week since the fall in rankings, fluctuations seem to have slowed.

Removing focus ring for non-tab users (vanilla JS to jQuery conversion)

I’m working on an accessibility issue for a client with Genesis Theme on WordPress and some custom jQuery. They need to remove the onFocus indicator border for mouse users, while leaving it intact for tab users. The following JS was suggested on Medium:

function handleFirstTab(e) {          if (e.keyCode === 9) { // the "I am a keyboard user" key         document.body.classList.add('user-is-tabbing');          window.removeEventListener('keydown', handleFirstTab);    }}  window.addEventListener('keydown', handleFirstTab); 

What might this look like if implemented in JQuery instead? For more context see: