Improve the execution efficiency of wordpress, record the secondary development, and optimize the speed of wordpress

6 minutes
three hundred and fifty-one
zero

Wordpress adds ad configuration function to classification

Wp_terms Add admaster field varchar 200

wp-admin/edit-tag-form.php 

Open Phoenix News to view more HD pictures

Small information:

wordpress 

The three forms of wp_terms classification table wp_term_taxonomy classification type table and wp_term_relationships classification association table are interrelated

Wordpress optimization efficiency

When the execution efficiency of wordpress is too slow, consider SQL optimization

The execution mechanism of wordpress is to query the top articles, and execute a very time-consuming sql statement in the original topic and most topics

SELECT wp_posts. * FROM wp_posts WHERE ID IN (tens of thousands of article IDs)

Wordpress has no mechanism to eliminate the time of top articles, so when you have hundreds of thousands of articles, there will be thousands of top articles,

Select in tens of thousands of IDs Imagine how long this SQL needs to be executed

It is tested that the execution time of select in for tens of thousands of IDs is 16 seconds, that is, 16 seconds. This method is a public method. It is called in many places, so this sql is very common

The sticky_posts of the top article under option_name in the wp options table. The data is stored serially

In wp-includes/option.php

Get_option//method

Wordpress has a mechanism called revision record, which is absolutely good from the perspective of editing, but for developers, it needs to deal with the generation of big data,

On average, each article will have about ten revisions, which means that the data volume will increase ten times. The wp posts table has the guid field, which records

The original address is used, but there is a problem in this place, that is, it is not indexed. In WordPress, many users will query the guid when they need to query data,

Without an index, a large number of slow SQL logs will be generated. The solution is simple: add an index to it, that is, the NORMAL common index btree index method

Wordpress can open the web page in the browser to view the suffix of the imported css when the style.css modification cannot take effect immediately. The suffix needs to be updated. For the time being, I use

The laziest method is to find functions.php or functions_xxx.php in the template folder selected by wp content/themes/

define( THEME_VERSION , 7.1 );

Change the version number at will to make the css style take effect immediately

Supplementary information

Most wordpress development is in the template folder The template folder is in the wp content/themes/template folder

Index.php homepage

Page.php page

Single.php Content Page

Category. php category page

Header.php header

Footer.php bottom

Style.css control global style (foreground)

Sidebar.php The content of sidebar gadgets will be mostly here

Search.php Search Page

Tag. php tag page

Functions. php public methods He will reference various public methods

Comments.php comments

Author. php Author Page

This article is written by: Chief Editor Published on Software Development of Little Turkey , please indicate the source for reprinting: //hongchengtech.cn/blog/769.html
Kuke_WP editor
author

Related recommendations

One year ago (2023-11-27)

12 WordPress enterprise theme templates are recommended! WordPress can be built without writing code!, Wordpress setup

When many companies choose WordPress to build their websites, they often don't know which theme is easy to use. There are too many WordPress corporate themes in the market for everyone to choose, but they always hesitate to make a decision. Here we have carefully sorted out 12 WordPress corporate themes, covering all walks of life
four hundred and forty-eight
zero
One year ago (2023-11-27)

Inventory of WordPress themes on online course website (updated in 2020), free WordPress themes

To build an online education platform using the WordPress website building program, it is not only necessary to choose a better virtual host provider, but also the most important thing is to use a core online course plug-in, and a powerful WordPress theme can also improve students' learning experience. Learn more about WordPre
four hundred and forty-eight
zero
One year ago (2023-11-27)

Count the domestic excellent WordPress themes and wordpress excellent themes

WordPress originates from abroad, is easy to use, and is very popular, making more and more websites in China start to use WordPress website building programs. There are also many powerful experts or teams in China who have developed WordPress Chinese themes. This article details the outstanding WordPress themes in China. I Begin Theme
six hundred and thirty-eight
zero
One year ago (2023-11-27)

Best WordPress theme list in 2022 (free and paid), Wordpress resource network theme

When building a WordPress website, should you use a free theme or an advanced theme? What types of functions do you need, and how advanced do you want your website to be? These are all good questions. You need to explain before you spend money on WordPress topics. This is why we need to know all the details of the selected theme, and cover the topics from several
three hundred and ninety-three
zero

comment

0 people have participated in the review

Scan code to add WeChat

contact us

WeChat: Kuzhuti
Online consultation: