6/8/2023 0 Comments Phpstorm wordpress![]() ![]() It’s autocomplete for wordpress functions and hooks should really speed things up or avoid unnecessary trips to the codex. With wordpress integration enabled PHPStorm really is a dream to work with. You should now have an exact copy of your live site on your local machine with your own admin user. INSERT INTO 'databasename'.'wp_usermeta' ('umeta_id', 'user_id', 'meta_key', 'meta_value') VALUES (NULL, '1', 'wp_user_level', '10') INSERT INTO 'databasename'.'wp_usermeta' ('umeta_id', 'user_id', 'meta_key', 'meta_value') VALUES (NULL, '1', 'wp_capabilities', 'a:1:') To do this I visit the database in sequel pro (link found in Local) and run the following (replacing databasename with the database name and checking the wp_users table for the next available user ID) I also run a query to add a new admin user for myself as I like all my local installs to use the same login details (it makes things simple!).This is simply a case of navigating to the sites wp-content directory and dropping in all that is required from the live site (be careful of mu-plugins as some hosts like WPEngine use certain plugins that won’t play nice on a local setup). Now the database is in place we need the content pulled in.To do this you can run wp db drop, wp db import path/to/db.sql, wp search-replace old-url new-url From here I can utilise wp-cli to drop the default database (avoid any conflicts on import), import the live database and run a search and replace to convert all URLs over. I then SSH into the install (right click the site in Local and click open site SSH) and navigate to the wordpress install directory (cd app/public).I name this something obvious (usually the url of the live site so becomes v). (I would like to utilise blueprints here as I like to use certain plugins when developing, like debug bar and query monitor, but unfortunately these do not currently work on my system). Firstly, add a site in local by clicking on the + icon located at the bottom left corner of the interface.This is assuming you have the content directory for the wordpress site you wish to setup and a database copy. I allow Local to create the site first and organise my sites within the default “Local sites” directory but I have a particular method of setting up a site which keeps things simple and fast. Whenever I setup a new local site I stick to the same pattern. ![]() Note: before even starting to work in wordpress using PHPStorm make sure wordpress integration is enabled! Detailed below are a few of the ways I do things to make my workflow a little smoother using these amazing tools. With Local, the complicated stuff is all hidden away and I can focus on my work and leave the environment setup alone. This usually resulted in a fresh install of VVV rather than ever finding where I had messed up. I loved VVV but without prior knowledge of any of it’s inner workings it was a rather steep learning curve that caused plenty of frustration when things didn’t work as expected. Choose to enable/disable two reload options based on preference.I recently switched from VVV ( Varying Vagrant Vagrants) to Local by FlyWheel (formerly Pressmatic). I set mine to 1s so the updates are immediate.ĩ. Decide how many seconds the extension should wait before checking for updated source files. There may be other admin areas to ignore, but this setup works for me.Ĩ. Note: This allows your website to use Live Reload without reloading WordPress admin areas. Instead, you refer to the root folder by using your source URL followed by a forward slash (/) and asterisk (*) to monitor ALL files Source file URL's: Note: you cannot technically monitor changes in local folders/files (on your comp). Host URL: (don't forget the forward slash at the end)Ħ. Add Title of rule (can be your website name)ĥ. Click on your extension icon -> click " Create a new reload rule."Ĥ. Run localhost ( XAMPP) for a live server.ģ. My 2-minute setup as a WordPress developer:ġ. This is particularly useful for WordPress developers! Hard to believe it took installing/uninstalling several extensions to get to this PERFECTLY working extension. It works like a charm! So simple to set up. The best option for auto-reload Chrome browser which I found is: Live Reload:
0 Comments
Leave a Reply. |