10

Meanwhile, I found some plugins and tools that can help with this: Query Monitor Laps Debug Bar with some add-ons(Slow Actions, Rewrite Rules, etc.) If you really wanna go deep, try using Webgrind. Not the most friendly tool, but it'll do the job. Be aware that some of this tools will also have an impact on performance.


9

wp_localize_script() calls the method localize() on the global variable $wp_scripts. We can set this variable to an instance of a child class of WP_Scripts: class Filterable_Scripts extends WP_Scripts { function localize( $handle, $object_name, $l10n ) { $l10n = apply_filters( 'script_l10n', $l10n, $handle, $object_name ); return ...


9

The best way to do it is to use URL Rewrites. This way you'll not have to do any change before uploading CODE to your server back again. Try the following CODE in your .htaccess file: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / # custom rules for loading server images or any other uploaded media files RewriteCond %{REQUEST_FILENAME} !-f ...


8

Warning: This is just a test for dev installs and not production sites I was curious to see if there was a workaround, for those who want to develope multisites on their dev installs but on different ports than :80 and :443, e.g. :8080. I only found this blog post by Henri Benoit. There he gives examples how to modify the 3.9.1 core, to get around the ...


6

When WP_DEBUG is set, WordPress sets (via wp_debug_mode() call early in core load process) the error reporting level to E_ALL & ~E_DEPRECATED & ~E_STRICT. This means all warnings and errors except strict errors and PHP deprecated functions (not WordPress ones). You can define your own level in a custom mu-plugin (the override needs to be called as ...


5

You can't use port 8080. I have no idea why as that is a fairly common port for a web server. However, you can't: 121 if ( ( false !== $has_ports && ! in_array( $has_ports, array( ':80', ':443' ) ) ) ) { 122 echo '<div class="error"><p><strong>' . __( 'ERROR:') . '</strong> ' . __( 'You cannot install ...


5

From the WordPress Codex: The secret key is located in two places: the database in case the secret key isn't defined in the second place, which is in the wp-config.php file. If you are going to set the secret key, then you must do so in the wp-config.php file. The secret key in the database is randomly generated and will be appended to the ...


4

@toscho great implementation. Tested and true. Here is a slightly modified version, which also passes the $handle and $object_name so you can filter only when needed. class Filterable_Scripts extends WP_Scripts {     function localize( $handle, $object_name, $l10n )     {         $l10n = apply_filters( 'script_l10n', $l10n, $handle, $object_name );         ...


4

I use Dropbox as well, but not directly linked as the Dropbox folder path could differ from install to install. My Dropbox just is the root of my bare git repository. Simplified... When I start coding, I just add a new folder to my Dropbox and --bare init it. // Inside your Dropbox/webdev/themes folder for e.g. git --bare init Then inside your new Theme ...


4

You must export all table beginning with your WordPress prefix. Open your phpmyadmin panel. Then open your wordpress database. Click "export" from top menu. Select "Export Method:" as custom. Select your all tables beginning your prefix. Then go to bottom of page click "go". You got your SQL file. Move all files to new directory. If you create a new ...


4

It's best to just log errors to the server and then use bash or a server script that supports email and error analysis (instead of PHP). There are lots of log file tools out there, simple ones like Logwatch, Swatch, Octopussy, or more complex ones like Nagios. For errors which are triggered using WP_Error you can write an email alert or log function right ...


4

You can change that in wp-config (https://codex.wordpress.org/Editing_wp-config.php#Empty_Trash): define( 'EMPTY_TRASH_DAYS', 1 ); // Integer is the amount of days


3

If you want sections in a subdomain and in subdirectories, use a multi-site installation. See Create a Network and our tag multi-site. Then you set the the blog and the shop as separate sites, and the portfolio as a custom post type or as a regular page in the main blog.


3

I created a symbolic link in the /var/www/ directory. ln -s /srv/www/wp-uploads/ wp-uploads and then (in settings-> media) set up the upload folder: wp-uploads and url path: http://<my-ip>/wp-uploads


3

I prefer separete all my front-end assets from the back-end, so I use Gulp to manage (compile, mifify etc..) all my assets. But if you want to use Wordpress I found this article. I did not test the code, but by just reading and seeing the comment section I think that will work for you. But I really recommend you to use something Like Gulp, Webpack or Yarn ...


3

to allow this IP as safe, use this filter add_filter("http_request_host_is_external", function ($is, $host, $url) { if ("192.168.0.2" === $host) { $is = TRUE; } return $is; }, 10, 3);


2

The problem was that somewhere AllowOverride was set to None, but I don't know where that httpd.conf file was. I set it through some GUI tool that comes on the Mac. Apparently the file I was trying to edit was not the one that was being used. Thanks for your help, Pothi and JMa.


2

You can adapt the site url which is stored in the database based on what domain you are viewing the site from. Add the following to wp-config.php: define( 'WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/yourwebsitename' ); define( 'WP_SITEURL', WP_HOME ); If you use a subdirectory install (ie: you view the site from http://192.168.0.2/yourwebstename but ...


2

Heavily edited from the above link How to Harden your Word Press if you're a server admin Bear in mind I am not an expert on Word Press nor even a user of it: you will probably not be able to automatically self update word press (which is by default a massive security issue since vulnerabilities today are published in the future by the open source ...


2

In admin under Settings > Permalinks, select Custom Structure and enter /blog/%postname%/. This will prepend /blog/ to categories and tags by default, and any custom post types and taxonomies where you have not registered them with the with_front argument set to false. you can remove it from the built-in category and tag taxonomies by setting category ...


2

Here are few ideas how to deal with the neutralization of the Send Password part on the /wp-admin/user-new.php page: Idea 1: We can overwrite the wp_new_user_notification() function, because it's pluggable: Try for example: if ( ! function_exists( 'wp_new_user_notification' ) ): function wp_new_user_notification($user_id, $plaintext_pass = '') { ...


2

After more fruitless searching, I stumbled across this article from WP Tavern which mentioned a plugin then called "WP Local Dev Environment," now called Airplane Mode. The plugin blocks a long list of things that WordPress does which require checking something from the Internet. While it is intended to be toggled on or off depending on whether you have a ...


2

The true maximum is ultimately up to the host - they can impose whatever limits they wish. But even so, you can try with WP_MEMORY_LIMIT, which is the memory limit WordPress sets at runtime for any given request. WP_MAX_MEMORY_LIMIT is only applied in certain situations, either for administrators in the backend (users with the capability manage_options), or ...


2

Please take a look at Administation Over SSL, particularly the "Using a Reverse Proxy" section.


1

You need to create wp-config.php file. This new file is copy of wp-config-sample.php find it in root directory. After creating this copy name it wp-config.php and set up database setting into it. Also give access permission to it. Let me know if above wording is not used to for you.


1

Create a new file names wp-config.php and paste all the code than enter your db credentials it will solve your wp-config issue. <?php /** * The base configurations of the WordPress. * * This file has the following configurations: MySQL settings, Table Prefix, * Secret Keys, WordPress Language, and ABSPATH. You can find more information * by visiting ...


1

WordPress uses the wp_mail() function to send mail. It says on the Codex article there that: For this function to work, the settings SMTP and smtp_port (default: 25) need to be set in your php.ini file. Also be sure to check that your contact form is sending the required parameters to the wp_mail() function. The required parameters are included on the ...


1

Use Database Search and Replace and replace the IP 192.168.33.21 with the domain name project.dev.


1

I don't have enough reputation for comments and hope I don't get down voted here. I also use Nginx. Although my set up is a little different to yours the principal should be the same. In your nginx.conf you need to identify the domain names Nginx will handle. For example; http { include /etc/nginx/sites-enabled/*.conf; server { ...


1

Stupid me... the root folder had an empty default.html file and that's what it was rendering... removed teh file and it works now


Only top voted, non community-wiki answers of a minimum length are eligible