add_filter('mod_rewrite_rules', 'fix_rewritebase');
function fix_rewritebase($rules){
$home_root = parse_url(home_url());
if ( isset( $home_root['path'] ) ) {
$home_root = trailingslashit($home_root['path']);
} else {
$home_root = '/';
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Custom WordPress configurations on "wp-config.php" file. | |
| * | |
| * This file has the following configurations: MySQL settings, Table Prefix, Secret Keys, WordPress Language, ABSPATH and more. | |
| * For more information visit {@link https://codex.wordpress.org/Editing_wp-config.php Editing wp-config.php} Codex page. | |
| * Created using {@link http://generatewp.com/wp-config/ wp-config.php File Generator} on GenerateWP.com. | |
| * | |
| * @package WordPress | |
| * @generator GenerateWP.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Go in your kinsta serv with ssh in terminal and make this two steps : | |
| #1: cat ~/.ssh/id_rsa.pub and copy paste in user setting in kinsta and SSH KEY | |
| #2: cat ~/.ssh/id_rsa and copy paste in secret SSH_KEY | |
| name: Deploy to Kinsta | |
| on: | |
| push: | |
| branches: [ main ] | |
| jobs: |
Moved to git repository: https://github.com/denji/nginx-tuning
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select | |
| p.ID as order_id, | |
| p.post_date, | |
| max( CASE WHEN pm.meta_key = '_billing_email' and p.ID = pm.post_id THEN pm.meta_value END ) as billing_email, | |
| max( CASE WHEN pm.meta_key = '_billing_first_name' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_first_name, | |
| max( CASE WHEN pm.meta_key = '_billing_last_name' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_last_name, | |
| max( CASE WHEN pm.meta_key = '_billing_address_1' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_address_1, | |
| max( CASE WHEN pm.meta_key = '_billing_address_2' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_address_2, | |
| max( CASE WHEN pm.meta_key = '_billing_city' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_city, | |
| max( CASE WHEN pm.meta_key = '_billing_state' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_state, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## On you machine run: | |
| docker exec -it devkinsta_fpm bash | |
| ## After you are logged change to /tmp | |
| cd /tmp | |
| ## Install and configure composer | |
| php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
| php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" | |
| php composer-setup.php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # phpstorm, webstorm | |
| .idea/ | |
| /.vscode | |
| /nbproject | |
| /node_modules | |
| # sublime and other ide | |
| .project | |
| *.sublime-project | |
| *.sublime-workspace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # - DISMISS PUBLIC ACCESS; ONLY ALLOW API ACCESS VIA OWN DOMAIN | |
| # - ALLOW ADMIN ACESS FOR ALL | |
| # | |
| # This example is in the "public_html/api/" folder where | |
| # the WP API is installed. | |
| # | |
| RewriteEngine On | |
| # If the referer is not its own domain | |
| RewriteCond %{HTTP_REFERER} !^http?://architectura.com [NC] | |
| # Then make it forbidden if not an admin login th |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "mcguffin/wp-package-security-check", | |
| "type": "wordpress-plugin", | |
| "license": "GPL-2.0-or-later", | |
| "homepage": "https://gist.github.com/mcguffin/255909d4d7fcc241fe63363012553268", | |
| "require": { | |
| "composer/installers": "~1.2" | |
| }, | |
| "require-dev": { | |
| "squizlabs/php_codesniffer": "*", |
If you are using subdirectories on multisite
wp search-replace --network 'example.com' 'example.test' --all-tables --dry-run then
NewerOlder