Grunt

Introduction Grunt is a tool written in Node.js, therefore before installing Grunt it is necessary to install Node.js and its package manager npm. If they are already installed, it is necessary to check whether they are up-to-date versions and, if necessary, do their update. Since one of Grunt’s frequent tasks is to compile SASS to … Read more

JSON (Data Interchange Format)

JSON general

JSON (JavaScript Object Notation) is one of the lighter text-based open standards designed for readable data exchange. The data file extension in JSON format is .json, while the meta tag (MIME format) is application/json.

JSON is a format that is slowly replacing XML because it has several advantages over XML. JSON does not use tags and therefore has shorter code that is easier to write and more understandable to read. Although the most important advantage of JSON over XML is that JSON is parsed through a standard JavaScript function while XML is parsed through an XML parser.

Read more

Web Services (Basics)

What are web services?

Web service is an application located on a server, which, in addition to its basic purpose, is designed to support interaction between two machines over the network and enable the exchange of information between them. Any service is considered to be a web service if:

  • Available via the Internet or (internal network)
  • Uses a standardized message system
  • It is recognized by the search engine
  • It is not tied to an operating system or programming language
Web service search

Web Services are published in a unique location where they are offered as services. UDDI (Universal Description, Discovery and Integration) is a centralized location that provides a mechanism for registering and finding Web services. UDDI uses SOAP for communication and allows clients to find a service as well as a server to publish it.

Services can be closed (private) but also publicly available. You can view the list of publicly available services on several websites:

Web service description

Web services have the ability to describe themselves, and WSDL (Web Service Description Language) is used to describe the service. WSDL is written in XML and contains information about where the web service is located and what communication protocol it uses.

Cooperation with GUI application

Web services in cooperation with a GUI application are something between a web and a desktop application. The web service on the server provides functionality and data, while the desktop application only provides a customizable graphical interface that it fills with the data received from the service. A web service in cooperation with a GUI application is more flexible than a web application because the user can adjust the appearance of the application on the client, while the user of the web application must use a web browser and has no influence on how the application will look on the screen.

Advantages compared to the web application:
  • They are more economical in terms of network and server resource load because during communication they only send a response, while web applications send HTML with a form and a description of how the comment should be displayed in addition to the response. Web services are ideal for “small” devices that are not PCs, ie. mobile Pocet PC… because only the front-end application is installed on such a device, and the hard part is done on the server.
  • They are easier to develop, test and maintain. With a web application, in addition to the necessary functionality, it is also necessary to test the design on all browsers and platforms, while with a web service, the author only cares about the function, while the client application cares about the display.

client server

At the service, communication takes placebetween the client and the server by the client sending a request to the server which then the server receives the request and processes it, then forms a response based on it and then sends it back to the client. The client-server architecture style separates the problems of the two sides of the communication channel, which means that the client side is not at all interested in the way information is stored on the server because there is always a uniform way of accessing those resources. On the other hand, the server is independent of the client and doesn’t care how the user interface is implemented or what state a particular client is in, which greatly simplifies the server side. With this, their independence was achieved and the development of both sides was more easily separated, i.e. it is possible, for example, improve the server side or completely change its logic without the client noticing at all as long as the way of accessing the resources is the same.

What is an API?

In order to achieve communication between two systems, they need to have a “point” of contact, the so-called. interface. An interface is an intermediary (connection) in communication between two separate systems that work together and can be:

  • Hardware interface (e.g. the steering wheel, throttle and gearbox are “vehicle access points” and represent an intermediary between the car and the person driving it)
  • Program interface so called. “API” which represents “access points” for communication between two programs

Working with services implies that resources are accessed on a remote server (access is through the Internet), this kind of network communication brings with it the problem of accessing and transferring complex data structures as well as the organization of resources on the server itself. Over time, programmers have created communication between the two programs in various ways, ie. made different types of APIs, but at one point they standardized the way of communication, i.e. they created a set of rules that network applications should follow when communicating with each other (eg one such standardized api is “REST API”).
What we must pay attention to is that once the API is defined and put into “traffic”, in case changes need to be made after some time, it is not wise to change the “end points” that have been set so far, because it would be at least rude to force API consumers to change already created programs in order to adapt to the change. When a change is made, you should always strive to continue support for existing properties (end points), and for changes, add new properties instead of changing existing ones.

Read more

Network Protocols (Basics)

OSI reference model

OSI reference model (eng. Open Systems Interconnection Basic Reference Model) is an abstract description of network architecture. The OSI reference model consists of seven different levels of abstraction.

Layers Unit Protocols Application
Network processes related to the application Data HTTP, HTTPS, FTP, SSH, DNS, SMTP Presentation
Data encryption and coding Data MIME SSL TLS Session
End user session establishment Data RPC, PAP, SCP Transportation
Connection, reliability, transportation Segment
Datagram TCP, UDP Network
Logical addressing and routing Package IP, ICMP, ARP, RARP Link layer
Physical addressing, media access Frame PPP, HDLC, Frame Relay Physical layer
Signal transmission Bit Token Ring
IEEE 802.11

Read more

Emmet plugin

Introduction

Emmet is a great plugin for accelerated code writing that can be added to many well-known text editors and IDEs. It has certain abbreviations that, when combined, give a finished code that is much longer and more complex. It is installed as a plugin, and the installation depends on the IDE application in which it is implemented. I described how the Emmet plugin is installed as part of PHP Storm on the page “Installation of tools for web development”. It is used by typing the abbreviation in the editor and then pressing the “trigger button”, the default button is TAB.

Read more

Git basics and installation

Introduction to code tracking systems

There are two types of version tracking and control systems:

  • Centralized Version Control System (CVCS)

    This is where tools like SVN, Perforce and CVS belong. With the CVC system, all version data is located on the central server, while users only have access to the current version they are working on. This principle of operation enables easier maintenance and administration, but data security is problematic if the system fails, all information is lost.

  • Decentralized Version Control System (DVCS)

    to which belong: Mercurial, Bazaar, Darcs and Git. With the DVC system, in addition to the latest version, users also download a complete database of all versions in that repository. In case of system failure, it is sufficient for only one of the clients to upload data to the server.

Read more

Translating a theme or plugin

Introduction

WordPress translations can be divided into:

  1. Translation of the entered content so called. frontend (translated by the user using plugins: Polylang or WPML…)
  2. Translating the backend:
    • WordPress core (already translated during installation)
    • Themes or plugins (prepared and translated by the developer)

Read more

PHP Storm

Introduction

PHP Storm is one of the best IDEs (eng. Integrated development environment) that provides a large number of work conveniences:

  • Code Completion
  • Refractoring code
  • Integration version control (Git)
  • Integration of Command Prompt
  • Integration of Sass compiler and Typscript transpiler
  • WordPress integration
  • Debugging…

Read more

WordPress Shortcode (Basics)

Introduction

WordPress shortcode on a page or post will be replaced with some content, and the process that happened in the background is as follows:

When WordPress “runs into” a shortcode it is instructed to look for a macro inside the brackets [ ], then the macro calls a callback function that will replace the shortcode with some dynamic content.

Enable shortcode everywhere

By default, WordPress ignores the shortcode if it finds it somewhere other than the part where the content of the post or page is entered. In order to activate shortcodes in other areas as well, it is necessary to add an appropriate filter to functions.php

Shortcode in widget

Now it is enough to put the shortcode in a regular Text widget and it in the area you want to display the content of the shortcode.

Shortcode in comments

Shortcode in excerpt

Shortcode in topic header

If for some reason we want to insert a shortcode inside a template or plugin, e.g. “custom page template” we use the function do_shortcode( $content )

Read more