WordPress adding scaled images that don’t exist

I’m building a theme in _S and using native Gutenberg blocks.

I have the following code via my functions.php file to set my image sizes:

add_theme_support( 'post-thumbnails' ); add_image_size( 'carousel', 1366, 550, true ); add_image_size( 'hero', 1366, 400, true ); add_image_size( 'large-square', 392, 340, true );  add_image_size( 'medium-square', 279, 314, true ); add_image_size( 'small-square', 215, 170, true ); add_image_size( 'diagram', 650 );  add_image_size( 'full-width', 884 );  add_image_size( 'half', 430 );  add_image_size( 'third', 279 );  add_image_size( 'quarter', 203 ); 

I also have this code to remove the default image sizes:

function remove_default_image_sizes( $  sizes) {     unset( $  sizes['thumbnail']);     unset( $  sizes['medium']);     unset( $  sizes['medium_large']);     unset( $  sizes['large']);     return $  sizes; } add_filter('intermediate_image_sizes_advanced', 'remove_default_image_sizes'); 

When regenerating my thumbnails via WP CLI, images are being scaled up to 2048px. This size doesn’t exist.

I’m also noticing a suffix “scaled” being added to each generated image, like so:

image-scaled-2048x600.jpg 

I’ve not seen this suffix before.

Where could WordPress be getting these image sizes from? Does the “scaled” suffix have anything to do with it?

How to migrate production WordPress to Localhost

I am trying to migrate a production WordPress site to a localhost install on MacOS using MAMP pro. What steps do I need to preform to enable this.

I have the data base configured and connecting.

I am able to hit localhost:8888/readme.html and get served the WordPress readme from Apache.

Unfortunately If I hit http://localhost:8888 or http://localhost:8888/index.php I get a 301 redirect to http://localhost The port is dropped and nothing gets served.

I am unsure where this 301 is coming from and currently blocked on this

Free WordPress Hosting – High Resources – No Hidden Charges – Hostbazzar.com!

Are you a WordPress blogger or a WordPress Developer looking for fully loaded Free WordPress hosting service that is isolated from other users on the server, Hostbazzar provides you everything for which you have been waiting for. Our Free WordPress hosting is built on a blazing-fast latest SSD hardware that is highly-tuned for optimum performance. The Free WordPress hosting includes latest WP version, plugins, themes, daily automated backups, dedicated IP, isolated server resources, 24×7 WordPress support, and 99.95% guaranteed up-time.

Free WordPress Hosting Key Features :

• Latest WordPress CMS
• Free web Hosting Control Panel
• Managed WordPress
• Pre-installed Plugins
• Professional Themes
• Daily Automated Backup
• Malware Scan
• Powerful Hardware
• WordPress Experts
• Free WordPress Migration
• Single Click Script Installer
• Email Facility
• Free SSL Cert
• Free SEO Tools
• Easy Upgrades
• Free For Life

Offering services as free is just with the purpose where begineers can utilize the services and can get familier with the features so that can decide if they can afford paid hosting or not.

Hostbazzar.com : Free WordPress Hosting : Order Now:

https://hostbazzar.com/linux_shared_hosting.php

Thank you.

Remove filter from WordPress Plugin

I am using a plugin called that causes all of distributed posts to have a rel=canonical back to the source. I reached out to the developers and they told me the following:

By default, canonical URL of distributed post will point to original content, which corresponds to SEO best practices. This can be overridden by extending Distributor with custom code and removing Distributor’s default front end canonical URL filtering (look for ‘get_canonical_url’ and ‘wpseo_canonical’).

Here is their code:

public static function canonicalize_front_end() {     add_filter( 'get_canonical_url', array( '\Distributor\InternalConnections\NetworkSiteConnection', 'canonical_url' ), 10, 2 );     add_filter( 'wpseo_canonical', array( '\Distributor\InternalConnections\NetworkSiteConnection', 'wpseo_canonical_url' ) );     add_filter( 'wpseo_opengraph_url', array( '\Distributor\InternalConnections\NetworkSiteConnection', 'wpseo_og_url' ) );     add_filter( 'the_author', array( '\Distributor\InternalConnections\NetworkSiteConnection', 'the_author_distributed' ) );     add_filter( 'author_link', array( '\Distributor\InternalConnections\NetworkSiteConnection', 'author_posts_url_distributed' ), 10, 3 ); } 

I went into my child theme functions.php file and added the following:

  remove_filter( 'get_canonical_url', array( '\Distributor\InternalConnections\NetworkSiteConnection', 'canonical_url' ), 10, 2 );   remove_filter( 'wpseo_canonical', array( '\Distributor\InternalConnections\NetworkSiteConnection', 'wpseo_canonical_url' ) ); 

It doesn’t seem to work for me. Any thoughts?

WordPress database problem wp_posts, primary key

Repende my website in wordpress did not let me work properly, did not let me publish an article and showed me a problem in the editor show the message: “You are editing the page that shows your latest posts.”

Searching on the Internet seems to be a problem of the database, when entering the wp_post phpmyadmin table I get this message “The current selection does not contain a single column. The grid edition and the copy, delete and edit links do not are available “I can not modify the data in the table, I also see that the structure is different from any other database in wordpress, the wp_posts table for example the ID has no auto increment and has no primary key when it should have it. I try to assign it but I get this error:

ALTER TABLE `wp_posts` ADD PRIMARY KEY (` ID`);  MySQL said: Documentation  # 1062 - Duplicate entry '0' for the key 'PRIMARY' 

enter image description here

Any way to solve this problem? I have already updated the wordpress, used plugin to “repair” database but nothing worked for me

I appreciate your help

Slow queries constantly getting stuck on WordPress database of ~100,000 posts

I am constantly getting stuck SELECT queries on my wordpress databases like the following:

enter image description here

Many of the SELECT queries that get stuck are fairly ordinary, such as pulling the last 10 posts of an author or pulling 10 posts in a category – these are normal WordPress core queries, not from any plugin. My WordPress databases that get afflicted with this have around 100,000 rows in the wp_posts table, with a size of around 1GB. This is an example of the largest tables from one of the databases:

enter image description here

My dedicated server is has 4 CPU cores @ 3.4 GHz and 8 GB DDR4 RAM. For this server and these databases, should these kinds of issues be happening? What can I do to make normal WordPress queries always run without getting stuck? I have tried changing from MyISAM to InnoDB with no effect, as well as changing different settings in my.cnf – here it is currently:

[mysqld] pid-file = /var/run/mysqld/mysqld.pid log-error=/var/lib/mysql/errorlog.err performance-schema=0 default-storage-engine=MyISAM max_allowed_packet=268435456 open_files_limit=10000 slow_query_log=ON log_slow_verbosity=1 innodb_buffer_pool_size=1G aria_pagecache_buffer_size=512M query_cache_size=0 query_cache_type=0 query_cache_limit=0 join_buffer_size=512K tmp_table_size=32M max_heap_table_size=32M table_definition_cache=1200 

And the result of running https://github.com/major/MySQLTuner-perl:

[root@hostname ~]# perl mysqltuner.pl --host 127.0.0.1  >>  MySQLTuner 1.7.19 - Major Hayden <major@mhtx.net>  >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/  >>  Run with '--help' for additional options and output filtering  [--] Skipped version check for MySQLTuner script [--] Performing tests on 127.0.0.1:3306 [OK] Currently running supported MySQL version 10.3.20-MariaDB-log [OK] Operating on 64-bit architecture  -------- Log file Recommendations ------------------------------------------------------------------ [OK] Log file /var/lib/mysql/errorlog.err exists [--] Log file: /var/lib/mysql/errorlog.err(764K) [OK] Log file /var/lib/mysql/errorlog.err is readable. [OK] Log file /var/lib/mysql/errorlog.err is not empty [OK] Log file /var/lib/mysql/errorlog.err is smaller than 32 Mb [!!] /var/lib/mysql/errorlog.err contains 1571 warning(s). [!!] /var/lib/mysql/errorlog.err contains 1424 error(s). [--] 124 start(s) detected in /var/lib/mysql/errorlog.err [--] 1) 2019-11-25  6:31:15 0 [Note] /usr/sbin/mysqld: ready for connections. [--] 2) 2019-11-25  6:08:45 0 [Note] /usr/sbin/mysqld: ready for connections. [--] 3) 2019-11-25  5:47:35 0 [Note] /usr/sbin/mysqld: ready for connections. [--] 4) 2019-11-25  5:34:11 0 [Note] /usr/sbin/mysqld: ready for connections. [--] 5) 2019-11-25  5:22:58 0 [Note] /usr/sbin/mysqld: ready for connections. [--] 6) 2019-11-25  5:02:11 0 [Note] /usr/sbin/mysqld: ready for connections. [--] 7) 2019-11-25  4:33:46 0 [Note] /usr/sbin/mysqld: ready for connections. [--] 8) 2019-11-25  4:27:54 0 [Note] /usr/sbin/mysqld: ready for connections. [--] 9) 2019-11-25  4:21:59 0 [Note] /usr/sbin/mysqld: ready for connections. [--] 10) 2019-11-25  4:21:52 0 [Note] /usr/sbin/mysqld: ready for connections. [--] 123 shutdown(s) detected in /var/lib/mysql/errorlog.err [--] 1) 2019-11-25  6:31:08 0 [Note] /usr/sbin/mysqld: Shutdown complete [--] 2) 2019-11-25  6:08:26 0 [Note] /usr/sbin/mysqld: Shutdown complete [--] 3) 2019-11-25  5:47:27 0 [Note] /usr/sbin/mysqld: Shutdown complete [--] 4) 2019-11-25  5:33:59 0 [Note] /usr/sbin/mysqld: Shutdown complete [--] 5) 2019-11-25  5:22:55 0 [Note] /usr/sbin/mysqld: Shutdown complete [--] 6) 2019-11-25  5:02:05 0 [Note] /usr/sbin/mysqld: Shutdown complete [--] 7) 2019-11-25  4:33:42 0 [Note] /usr/sbin/mysqld: Shutdown complete [--] 8) 2019-11-25  4:27:47 0 [Note] /usr/sbin/mysqld: Shutdown complete [--] 9) 2019-11-25  4:21:58 0 [Note] /usr/sbin/mysqld: Shutdown complete [--] 10) 2019-11-25  4:21:48 0 [Note] /usr/sbin/mysqld: Shutdown complete  -------- Storage Engine Statistics ----------------------------------------------------------------- [--] Status: +Aria +CSV +InnoDB +MEMORY +MRG_MyISAM +MyISAM +PERFORMANCE_SCHEMA +SEQUENCE  [--] Data in MyISAM tables: 2.3G (Tables: 1379) [--] Data in InnoDB tables: 2.7G (Tables: 284) [OK] Total fragmented tables: 0  -------- Analysis Performance Metrics -------------------------------------------------------------- [--] innodb_stats_on_metadata: OFF [OK] No stat updates during querying INFORMATION_SCHEMA.  -------- Security Recommendations ------------------------------------------------------------------ [OK] There are no anonymous accounts for any database users [OK] All database users have passwords assigned [--] There are 620 basic passwords in the list.  -------- CVE Security Recommendations -------------------------------------------------------------- [OK] NO SECURITY CVE FOUND FOR YOUR VERSION  -------- Performance Metrics ----------------------------------------------------------------------- [--] Up for: 3m 3s (36K q [199.732 qps], 1K conn, TX: 222M, RX: 33M) [--] Reads / Writes: 96% / 4% [--] Binary logging is disabled [--] Physical Memory     : 7.6G [--] Max MySQL memory    : 2.1G [--] Other process memory: 0B [--] Total buffers: 1.7G global + 3.2M per thread (151 max threads) [--] P_S Max memory usage: 0B [--] Galera GCache Max memory usage: 0B [OK] Maximum reached memory usage: 1.7G (22.90% of installed RAM) [OK] Maximum possible memory usage: 2.1G (28.14% of installed RAM) [OK] Overall possible memory usage with other process is compatible with memory available [OK] Slow queries: 0% (11/36K) [OK] Highest usage of available connections: 14% (22/151) [OK] Aborted connections: 0.00%  (0/1174) [!!] name resolution is active : a reverse name resolution is made for each new connection and can reduce performance [OK] Query cache is disabled by default due to mutex contention on multiprocessor machines. [OK] Sorts requiring temporary tables: 0% (0 temp sorts / 6K sorts) [!!] Joins performed without indexes: 50 [!!] Temporary tables created on disk: 70% (1K on disk / 2K total) [OK] Thread cache hit rate: 98% (22 created / 1K connections) [OK] Table cache hit rate: 98% (444 open / 450 opened) [!!] table_definition_cache(1200) is lower than number of tables(1928) [OK] Open file limit used: 5% (580/10K) [OK] Table locks acquired immediately: 99% (25K immediate / 25K locks)  -------- Performance schema ------------------------------------------------------------------------ [--] Performance schema is disabled. [--] Memory used by P_S: 0B [--] Sys schema is installed.  -------- ThreadPool Metrics ------------------------------------------------------------------------ [--] ThreadPool stat is enabled. [--] Thread Pool Size: 8 thread(s). [--] Using default value is good enough for your version (10.3.20-MariaDB-log)  -------- MyISAM Metrics ---------------------------------------------------------------------------- [!!] Key buffer used: 35.6% (47M used / 134M cache) [OK] Key buffer size / total MyISAM indexes: 128.0M/170.4M [OK] Read Key buffer hit rate: 99.9% (22M cached / 22K reads) [OK] Write Key buffer hit rate: 99.3% (824 cached / 818 writes)  -------- InnoDB Metrics ---------------------------------------------------------------------------- [--] InnoDB is enabled. [--] InnoDB Thread Concurrency: 0 [OK] InnoDB File per table is activated [!!] InnoDB buffer pool / data size: 1.0G/2.7G [!!] Ratio InnoDB log file size / InnoDB Buffer pool size (9.375 %): 48.0M * 2/1.0G should be equal to 25% [!!] InnoDB buffer pool <= 1G and Innodb_buffer_pool_instances(!=1). [--] Number of InnoDB Buffer Pool Chunk : 8 for 8 Buffer Pool Instance(s) [OK] Innodb_buffer_pool_size aligned with Innodb_buffer_pool_chunk_size & Innodb_buffer_pool_instances [OK] InnoDB Read buffer efficiency: 99.71% (10795186 hits/ 10826096 total) [OK] InnoDB Write log efficiency: 98.51% (39722 hits/ 40324 total) [OK] InnoDB log waits: 0.00% (0 waits / 602 writes)  -------- AriaDB Metrics ---------------------------------------------------------------------------- [--] AriaDB is enabled. [OK] Aria pagecache size / total Aria indexes: 512.0M/1B [OK] Aria pagecache hit rate: 98.7% (130K cached / 1K reads)  -------- TokuDB Metrics ---------------------------------------------------------------------------- [--] TokuDB is disabled.  -------- XtraDB Metrics ---------------------------------------------------------------------------- [--] XtraDB is disabled.  -------- Galera Metrics ---------------------------------------------------------------------------- [--] Galera is disabled.  -------- Replication Metrics ----------------------------------------------------------------------- [--] Galera Synchronous replication: NO [--] No replication slave(s) for this server. [--] Binlog format: MIXED [--] XA support enabled: ON [--] Semi synchronous replication Master: OFF [--] Semi synchronous replication Slave: OFF [--] This is a standalone server  -------- Recommendations --------------------------------------------------------------------------- General recommendations:     Control warning line(s) into /var/lib/mysql/errorlog.err file     Control error line(s) into /var/lib/mysql/errorlog.err file     MySQL was started within the last 24 hours - recommendations may be inaccurate     Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1     We will suggest raising the 'join_buffer_size' until JOINs not using indexes are found.              See https://dev.mysql.com/doc/internals/en/join-buffer-size.html              (specially the conclusions at the bottom of the page).     When making adjustments, make tmp_table_size/max_heap_table_size equal     Reduce your SELECT DISTINCT queries which have no LIMIT clause     Performance schema should be activated for better diagnostics Variables to adjust:     join_buffer_size (> 512.0K, or always use indexes with JOINs)     tmp_table_size (> 32M)     max_heap_table_size (> 32M)     table_definition_cache(1200) > 1928 or -1 (autosizing if supported)     performance_schema = ON enable PFS     innodb_buffer_pool_size (>= 2.7G) if possible.     innodb_log_file_size should be (=128M) if possible, so InnoDB total log files size equals to 25% of buffer pool size.     innodb_buffer_pool_instances (=1) 

I’ve tried these suggestions along with every other possible thing it feels like (caching, optimizing tables etc) and still queries get stuck over and over, causing connections to be stuck in apache with a ‘sending reply’ status and causing websites not to load. What else can I try? Should I upgrade to a more powerful server?

Why isn’t my code working for WordPress adding different image sizes?

// Theme Setup

function custom_theme_setup() {

// Navigation Menus register_nav_menus(array( ‘primary’ => __(‘Primary Menu’), ‘footer’ => __(‘Footer Menu’), ));

// Add featured image support add_theme_support(‘post-thumbnails’); add_image_size(‘small-thumbnail’, 180, 120, true); add_image_size(‘banner-image’, 920, 210, true); }

add_action(‘after_setup_theme’, ‘custom_theme_setup’);

WordPress plugins always deactivates by itself after “Database is required” loop

After updating the latest update in wordpress, this “Database is required” loop keeps going and it deactivates the plugins. I already tried the solution that the other sites/forums gave which is to have the same db_version in my version.php and wp-options. Up until now, it doesn’t work. Any available solutions?

How to create a WordPress PAGE in another folder?

I have a URL Shortening script running on the homepage while there is a WordPress installation on another folder named blog. So that would look like this https://homepage.com/blog

The problem is that I need to be able to create “PAGES” for terms, about, FAQ, private policy, etc. Whenever a page is created in WordPress for let’s say “terms” then a page like this is created: https://homepage.com/blog/terms

What the URL really should be is https://homepage.com/page/terms. The reasoning is because the homepage’s script has it’s own links pointing to it’s own pages and blog.

So far since I have successfully managed to create the WordPress blog in https://homepage.com/blog then this overwrites the links in the homepage’s own blog so that they point to the actual WordPress blog.

So I am thinking that if that is possible then it should be possible to have the links in the homepage point to “Pages”, which I want to be “Pages” that were actually created in WordPress.

In other words, how can I create, move, recreate, or duplicate https://homepage.com/blog/terms which I actually want to be located at https://homepage.com/page/terms so that the homepage links can point to that instead?

I only have limited knowledge on php scripts and none as far as database tables are concerned. If I could create a php file for this then that would be so greatly appreciated.

I have a child-theme for the WordPress installation that php files can be placed in. The homepage’s script is all in php and MySQL.

WordPress search not able to find the category

I have 3 to 4 categories on my website. I am using WordPress search but when I am searching my category then I am getting

Nothing Found

also, I tried to search the subcategory then also I am getting the same message.

Would you help me out with this issue?

search.php

 <section id="primary" class="content-area mainSearch">     <main id="main" class="site-main">       <div class="equalPadding">         <div class="cp-seeWrapper">     <?php if ( have_posts() ) :            get_search_form();//search form           ?>           <div class="resultCount"><?php           global $  wp_query;           echo $  wp_query->found_posts.' RESULTS';             ?></div>          <div class="row">       <?php          while (have_posts()){the_post();?>         //displaying result here         <?php } ?>        <?php      else :       get_template_part( 'template-parts/content', 'none' );      endif;     ?>           </div>     </div>     </div>     </main><!-- #main -->   </section><!-- #primary -->