Wordpress
Install and maintain
Composer
"extra": {
"webroot-dir": "www",
"webroot-package": "wordpress",
"installer-paths": {
"app/plugins/{$name}/": ["type:wordpress-plugin"],
"app/mu-plugins/{$name}/": ["type:wordpress-muplugin"],
"app/themes/{$name}/": ["type:wordpress-theme"]
}
}Docker
Config
Update site URL
WP Migrate DB – WordPress plugin | WordPress.org - Free version handle metadata PHP serialization trouble
Plugins
Jekyll Exporter – WordPress plugin | WordPress.org - "One-click WordPress plugin that converts all posts, pages, taxonomies, metadata, and settings to Markdown and YAML which can be dropped into Jekyll (or Hugo or any other Markdown and YAML based site engine)"
Rest API
Themes
Simple/cleared theme: BlankSlate — Free WordPress Themes
https://github.com/WordPress/WordPress/blob/master/wp-content/themes/twentyfourteen
Block theme
Aka theme.json
Template hierarchy
Theme development
Nav menu
Aka navigation menu
Performance and optimisation
Use OPcache
Tools:
P3 (Plugin Performance Profiler) — WordPress Plugins - Works only with PHP ≤ 5
Plugins:
SAVEQUERIES should be false
Custom fields
Fields starts with _ are not visible defaut meta box for custom field
Gutenberg editor plugins can be written with JSX/ES6 or ES5 (without compilation)
Validation / sanitization / authorization:
sanitize_callbackandauth_callbackarguments are depreciated
Some:
See also:
Custom post types
Custom plugins
mu-plugins aka multi user plugins, must-use plugins
Taxonomy
Aka categories, tags
Rewrite
call
flush_rewrite_rules()Settings > Permalinks > Save changes
Regenerate thumbnails
Responsive images
Update URL and media filename
Backup and migration
AJAX
http://code.tutsplus.com/articles/getting-started-with-ajax-wordpress-pagination--wp-23099
http://codex.wordpress.org/AJAX_in_Plugins
http://www.smashingmagazine.com/2011/10/18/how-to-use-ajax-in-wordpress/
https://wordpress.org/plugins/rest-api/
Captcha
http://wordpress.org/plugins/really-simple-captcha/
Form
WordPress Forms - Gravity Forms Contact Form Builder and Lead Data Management Plugin For WordPress - emailing + Gravity Flow - Automate your business processes with Gravity Forms. (request and approval process)
User feedback
http://wordpress.org/plugins/get-satisfaction-for-wordpress/
http://wordpress.org/plugins/user-voice/
http://www.onfry.com/projects/voteitup/
https://getsatisfaction.com/getsatisfaction/topics/pulling_back_support_for_wordpress_integration
https://developer.uservoice.com/docs/api/getting-started/
http://feedback.uservoice.com/forums/1-general-feedback
http://wordpress.org/plugins/uservoice-idea-list-widget/
http://feedback.uservoice.com/knowledgebase/articles/56243-use-a-link-custom-trigger-to-open-the-uservoice
http://feedback.uservoice.com/knowledgebase/articles/276635-use-just-smartvote-the-contact-form-or-satisfacti
GetSatisfaction
Zendesk
Desk
Job manager
http://wordpress.org/plugins/job-manager/
http://wordpress.org/plugins/wp-job-manager/
http://premium.wpmudev.org/blog/6-wordpress-job-board-solutions/
Social integration Twitter / Facebook
http://wordpress.org/plugins/facebook/
https://wordpress.org/plugins/twitter/
http://wordpress.org/plugins/recent-facebook-posts/
http://wordpress.org/plugins/custom-facebook-feed/
http://wordpress.org/plugins/fb-wallpost-widget/screenshots/
FB as RSS
Multilingual
Note: Has a performance impact
WPML - quite slow and could break things (remove translations when save, etc.)
Localization
Aka translation
Use full locale name in .mo filenames For mu-plugins (see load_muplugin_textdomain()):
For plugins (see load_plugin_textdomain()):
For theme (see load_theme_textdomain()):
See also _get_plugin_data_markup_translate(), for a plugin with meta comment Domain Path: /languages (default to empty) and Text Domain: text-domain (require, or no text domain will be (auto-)loaded) will load wp-content/plugin/<pluginslug><domainpath>/<textdomain>-<locale>.mo.
To debug which .mo files are loaded:
wp i18n make-pot | WP-CLI Command | WordPress Developer Resources - "Create a POT file for a WordPress project."
Plurals
SVG
Improving SVG Display in the Media Library WordPress SVG Support: How to Enable SVGs in WordPress
Security
See Wordpress
File permissions for automatic update
Apache use a different group than FTP users. It's a safe measure, but updates can't be automatic (require SSH or FTP credentials). Ex: FTP: user 522/538; Apache/PHP: 48/48 (www-data)
The Code is in
get_filesystem_method(). Wordpress tries to create a file'wp-content/temp-write-test-'.time()
Minify
Autoptimize
Merge + Minify + Refresh (doesn’t include an option to optimize your HTML)
Fast Velocity Minify
Test
From westonruter/amp-wp-theme-compat-analysis/start.sh:
OOP
In wp-content/themes/<themeslug>/functions.php:
Code
External script use WordPress functions
Aka headless, api
Last updated
Was this helpful?