Today i want to add on my website the support for webp images, and so i have found a plugin for wordpress that is free WebP Converter for Media
But for this plugin we must to active the support webp on the php module GD. On My VPS i have installed PHP 7.4 on Plesk, the simple way is to change the modulo gd of plesk php version with a custom module in witch the webp support is enabled.
I have find this useful guide that i rewrite with php 7.4 that i have used on my VPS.
I use for a long time CodeAnywhere to develop my application via FTP, or to use shell server console via SSH. Now i want to use the Container and try to create a Laravel PHP application. But i have encountered some errors that i want to report you.
Now start with the creation of the container, with the “Connection Wizard” is very simple:
If we want to run the Laravel php application, we must to use this command, and set the ip 0.0.0.0 to use app from remote container url.
Have you got a wordpress site and you want to optimize it? The simple way to take fast your website is:
Install WPSuper Cache Plugin
Setting Server side Nginx
Install WP Super Cache Plugin
The installation of WPSuper Cache is easy, just download the plugin and then upload it on our wordpress website.
Setting WP Super Cache
Now i show to you how to set wp super cache in “Expert mode”, remember that this mode require the change on the server for nginx configuration.
Enable Caching ON
Then we must to set the Expert Mode, and then suggest some setting:
Settings Server side Nginx
Now we need to set the configuration of nginx on our server, in this case i configure a Plesk Server. We must go in the Domain Setting -> Apache & nginx Settings In the bottom we find “Additional nginx directives“
We must to enable:
GZIP compression for the page that we serve on the client
Header Cache Control to declase a cache browser for the js, css, image etc..
Location to find wpsupercache generated file
Security setting
### WP Super Cache Below ###
set $cache_uri $request_uri;
# POST requests and urls with a query string should always go to PHP
if ($request_method = POST) {
set $cache_uri 'null cache';
}
# GZIP Compression
gzip on;
gzip_disable "MSIE [1-6]\\.(?!.*SV1)";
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_proxied any;
gzip_comp_level 9;
gzip_types text/plain text/css application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript image/x-icon image/bmp image/svg+xml;
gzip_vary on;
# NGINX Caching
location ~* \.(?:ico|css|js|gif|jpe?g|png|svg|woff)$ {
expires 14d;
add_header Cache-Control "public, no-transform";
log_not_found off;
}
location ~* \.(jpg|jpeg|gif|png)$ {
expires 14d;
add_header Cache-Control "public, no-transform";
log_not_found off;
}
location ~* \.(pdf|css|html|js|swf)$ {
expires 14d;
add_header Cache-Control "public, no-transform";
log_not_found off;
}
location ~ \.css {
add_header Content-Type text/css;
}
location ~ \.js {
add_header Content-Type application/x-javascript;
}
if ($query_string != "") {
set $cache_uri 'null cache';
}
# Don't cache uris containing the following segments
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
set $cache_uri 'null cache';
}
# Don't use the cache for logged in users or recent commenters
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") {
set $cache_uri 'null cache';
}
# Use cached or actual file if they exists, otherwise pass request to WordPress
location ~ / {
try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php ;
}
# WORDPRESS PERMALINKS
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}
# SECURITY
location ~* wp-config.php { deny all; }
location ~* "^/wp-content/(?!plugins/).*\.php" { deny all; }
Now you can test your site on pagespeed and see the difference! If you want much performance you can use Autoptimize WordPress plugin to minify js, css and html.
Today I asked myself how to explain to a junior, how to create a wordpress plugin, the simplest way. Without the inclusion of complex structures with public folder, includes, ….., but something very very simple.
Below I will explain how to create a plugin to manage some date, in this example is a Sport Race: – Create Sport Race – Insert members of a Sport Race – Show table with Sport Race, and manage data (bulk delete) – Show table with Sport Race, and manage data (bulk delete) – Upload media using WordPress System (media manager of wordpress)
The structure of the project in the Plugin name directory is:
As you can see, a simple list of file with no directory
My project as two section: Sport Race and Members Each section is composed by two file: _page.php and _table.php And a file of system: plugin_activation.php
For example now analyze two file: sportrace_page.php and sportrace_table.php
For the sportrace_table.php will explain in the next article how to create a table, now take a look at file, is very simple. For now i will explain how to use it in the sportrace_page.php
At top of page we put
<?php
global $wpdb;
// jQuery
wp_enqueue_script('jquery');
// This will enqueue the Media Uploader script
wp_enqueue_media();
?>
Then you must to set your Application on (Sandbox/Test or Production, in this guide i show to you Production procedure) https://developer.ebay.com/my/keys
At first we must to generate the Authorization Code, and for this procedure we must to paste an url on the browser and copy the query string “code”. So click on the “User token link”
Click on “Get a Token from eBay via Your Application”
Then you must to “Add eBay Redirect URL” So you generate your app details, you can see the “Your branded eBay Production Sign In (OAuth)” or if sandbox (test) “Your branded eBay SandboxSign In (OAuth)”
Put this link on your browser, and login with your ebay account, so then you must to redirect on another page that sayd to you that the application has grant, and in the url bar you find your authorization code.
Now with our authorization code, we call this url to take our access and refresh token. For this call we need the authorization header, and create a base64 encode with clientID and certID. And then in the parameter set Authorization code and RuName