Influence of Web Technologies And Mobile Development In 2019

Impact Web Technologies And Mobile Development In 2019

Present day world pushes cutting edge advancement restricts further and further each year and today we propose you consider programming patterns in 2018 dependent on our own examination of the market and the tasks we are working at. A portion of the patterns we notice are relied upon to see the light of open in months and some are as of now executed, however will shock us with new upgrades one year from now. So put off your work for the following ten minutes and submerge yourself in the realm of computer generated reality and the most recent improvements.

Stay up with the latest and look at the 10 most anticipated web innovations and portable advancement patterns for 2018. Make the most of our rundown:

10. CHATBOTS IN ONLINE CUSTOMER SUPPORT

You have in all likelihood seen the ascent of this tech pattern on different locales this year. Chatbots are extremely useful now, yet they are ending up significantly progressively mainstream as each business person needs to make conditions where a client can communicate with an organization and get criticism whenever. Much exertion will be coordinated unequivocally at the improvement of chatbots. It is arranged that chatbots will play out its capacities surprisingly better subsequent to improving: they will enable clients to pick the correct item, answer the most widely recognized inquiries, make an air of “human to human” correspondence – all that without a requirement for a different client bolster division.

9. SINGLE-PAGE WEBSITES

Another web advancement pattern that has been around for quite a while as of now, yet is winding up increasingly more prevalent with every day. Essentially, a one-page site holds the entire interface on one page. Anyway, what makes these destinations so unique?

Straightforwardness. You don’t need to search for a little snippet of data through huge amounts of content or a few dimensions of connections, as everything is composed on one page.

Brevity. On such sites you won’t locate any superfluous data, everything is quickly depicted and obviously organized.

Control. This one is fairly preference for designers as they have authority over the manner in which they offer data to the client, the request of data, etc.

Inexpensiveness. Once more, it is generally an advantage for the engineers. Making a solitary page site is a lot less expensive all around: plan, advancement, facilitating.

Portable kind disposition. Single-page sites are a lot simpler to access through cell phone instead of common pages with complex route.

Without a doubt, this sort of sites can’t be reasonable for everything (you can’t make single-paged web journals, for instance), at the same time, still, they are perceived among the frontend 2018 patterns.

8. Pop-up messages ON WEBSITES

This is an extremely compelling method for correspondence with the client which is ending up increasingly more well known each day. It works really straightforward: when you visit a website page, you are offered to empower pop-up messages. On the off chance that you press “concur” catch, you will get message pop-ups each time there is a report on the site. The advantage of such innovation is very self-evident: client remains drew in with the site even after the tab with the individual website page was shut. Message pop-ups are additionally very client agreeable and simple to utilize.

7. BLOCKCHAIN

Now and then, individuals partner blockchain with bitcoin. This isn’t a totally appropriate affiliation in light of the fact that blockchain is an innovation planned explicitly to give most extreme security amid exchanges in any money (not really bitcoin). Blockchain is a technique for aggregate information stockpiling. All data is kept on many PCs all around the globe as opposed to keeping everything in one spot. The primary in addition to of such a framework is, that there are no go-betweens partaking in exchanges. Each money exchange is checked based on a perplexing calculation and a colossal measure of PCs participate in this procedure. Blockchain has a high level of assurance. Numerous global banks are thinking about executing Blockchain in their work.

6. IOT

IoT arrangements step by step break into everyone’s life. Shrewd gadgets have never been as prominent and as required as now. Also, if quite a long while prior these gadgets were utilized solely for the diversion purposes, presently, IoT is utilized by tremendous global organizations. With brilliant gadgets, we can positively utilize our assets all the more successfully. Boundless open doors for expanding business potential are opened because of this idea.

5. PWA (PROGRESSIVE WEB APPS)

It was year 2015 when we known about Progressive Web Apps out of the blue. We have seen the pioneers in PWA in 2017, yet 2018 is positively going to be the year when Progressive Web Apps become contenders to local versatile applications. Things being what they are, what is so exceptional about this tech pattern? PWA are sites that demonstration like portable applications. They can work disconnected as the majority of data is put away in the money. The most up to date data is gotten the money for each time you interface with the Internet. The capacity to work disconnected is without a doubt the greatest favorable position of this web improvement pattern for 2018.

4. Internet business

Internet business remains consistent with its formative standards and strategies. In 2018, for the most part just a similar surely understood advances and systems are to be utilized. As per our investigation of the best E-trade stages of 2018, engineers will offer inclination to Magento CMS and Shopify facilitating stage. Be that as it may, an ever increasing number of organizations are relied upon to start executing personalization and investigation advancements for social elements. Destinations are going to increase itemized data about clients and their inclinations. Online stores will approach itemized data about clients, just as their wants and inclinations so as to offer the most significant items at the time. Envision going to the shop where assistants definitely know your name and what you are intending to purchase.

3. Movement UI

Perceiving how individuals are getting incredibly tired of being over-burden by insane amounts of GIFs and blazing promotions on the web, increasingly more website specialists begin utilizing movement UI as an approach to recognize their sites from a huge number of others. Movement UI gives you a few different ways of embellishing your website page so as to change it into crafted by craftsmanship.

2. Computerized reasoning

Perhaps the most outstanding case of man-made reasoning is Apple’s Siri. The voice right hand is a coherent consequence of specialized advancement and a genuine assistant. Be that as it may, this is only one precedent. Man-made brainpower is relied upon to be brought into the broadest scope of territories conceivable. By the by, so far just undertaking organizations can bear to create ideas highlighting computerized reasoning abilities.

1. Augmented REALITY

Because of the improvement of innovation, our cell phones have turned out to be broadly quick and ground-breaking. Increased reality enables us to change our picture of the typical versatile applications and recreations totally. In 2018, the idea is to increase new energy. Organizations like Microsoft will discharge the main world-well known uses of mass fame. New augmented experience patterns, without a doubt, go past the versatile advancement. They will likewise contact visual communication, live events,online deals and a lot more angles. Facebook’s Oculus Rift and HTC Vive made ready for full-control VR frameworks. In 2018, we hope to see substantially more formative whine here.

End
As should be obvious, nothing remains the equivalent for long, the main stable thing is steady difference in our general surroundings. The best thing we can do is remain centered and get familiar with these regularly happening changes. Particularly, about the mechanical advancements and improvements in its region.

Written by Smart Web Care IT Solutions
site : www.smartwebcare.com email : info@smartwebcare.com
Contact Number: +91 9779068220, +1 (347) 802-9495

8 Best PHP Cheat Sheets For Developers

Web development is now getting very much important in these days.Well this is not an easy task to be a web developers.It needs a lots of hard work.For creating a dynamic website PHP is the first choice for the developers. No doubt PHP is beneficial for the developers because it supports them to create attractive web pages.

Here in this article we have put together a list of 8 best PHP cheat sheets for quick development.

Best PHP Cheat Sheets 

PHP Cheat Sheet | OverAPI.com

php-cheat-sheets-1

Source

 

PHP Cheat Sheet | DaveChild

This PHP cheat sheets is a quick reference guide for PHP, with functions references, a regular expression syntax guide and a reference for PHP’s date formating functions. As of 28/6/14, the cheat sheet now includes popup links to the appropriate PHP manual pages.

php-cheat-sheets-2

Source

 

Security Cheat Sheets

php-cheat-sheets-3

Source

 

PHP Variable Cheat Shets

php-cheat-sheets-4

Source

 

PHP Reference Sheets Basics

PHP Reference Sheet Basics can be downloaded for free. This includes syntax and information for commonly used tasks, syntax, and more.

php-cheat-sheets-5

Source

 

PHP: Functions

A function is actually a collection of code that is known from any point in a script after it has been announced. It is actually a compartmentalized PHP script created to complete a single task.

php-cheat-sheets-6

Source

 

PHP PCRE Cheat Sheet

php-cheat-sheets-7

Source

 

PHP & MYSQL For Dummies

php-cheat-sheets-8

Source

 

5 PHP MUST WANTED CODE SNIPPETS FOR EVERY WEB DEVELOPERS NEED

Every web developer should keep useful code snippets in a personal library for future reference.In this post we will show you some useful code snippets of PHP which will help you for your future projects.

TOP 5 PHP MUST WANTED CODE SNIPPETS FOR EVERY WEB DEVELOPERS NEED

Show Number Of People Who Liked Your Facebook Page

function fb_fan_count($facebook_name)
{
    $data = json_decode(file_get_contents("https://graph.facebook.com/".$facebook_name));
    $likes = $data->likes;
    return $likes;
}

SyntaX

<?php
$page = "smartwebcare";
$count = fb_fan_count($page);
echo $count;
?>

Sending an Email With MANDRILL

For the below function you would have to put a file “Mandrill.php” in the same folder as the PHP file you would be using to send emails.

function send_email($to_email,$subject,$message1)
{
	require_once 'Mandrill.php';
$apikey = 'XXXXXXXXXX'; //specify your api key here
$mandrill = new Mandrill($apikey);
 
$message = new stdClass();
$message->html = $message1;
$message->text = $message1;
$message->subject = $subject;
$message->from_email = "blog@smartwebcare.com";//Sender Email
$message->from_name  = "Smart Web Care";//Sender Name
$message->to = array(array("email" => $to_email));
$message->track_opens = true;
 
$response = $mandrill->messages->send($message);
}

In the above code you would have to specify your own api key that you get from your Mandrill account.

Syntax

<?php
$to = "abc@smartwebcare.com";
$subject = "This is a test email";
$message = "Hello World!";
send_email($to,$subject,$message);
?>

Zipping a File

function create_zip($files = array(),$destination = '',$overwrite = false) {  
    //if the zip file already exists and overwrite is false, return false  
    if(file_exists($destination) && !$overwrite) { return false; }  
    //vars  
    $valid_files = array();  
    //if files were passed in...  
    if(is_array($files)) {  
        //cycle through each file  
        foreach($files as $file) {  
            //make sure the file exists  
            if(file_exists($file)) {  
                $valid_files[] = $file;  
            }  
        }  
    }  
    //if we have good files...  
    if(count($valid_files)) {  
        //create the archive  
        $zip = new ZipArchive();  
        if($zip->open($destination,$overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE) !== true) {  
            return false;  
        }  
        //add the files  
        foreach($valid_files as $file) {  
            $zip->addFile($file,$file);  
        }  
        //debug  
        //echo 'The zip archive contains ',$zip->numFiles,' files with a status of ',$zip->status;  
          
        //close the zip -- done!  
        $zip->close();  
          
        //check to make sure the file exists  
        return file_exists($destination);  
    }  
    else  
    {  
        return false;  
    }  
}

Syntax

<?php
$files=array('file1.jpg', 'file2.jpg', 'file3.gif');  
create_zip($files, 'myzipfile.zip', true); 
?>

PHP Snippets For Directory Listing

Using the below PHP code snippet you would be able to list all files and folders in a directory.

function list_files($dir)
{
    if(is_dir($dir))
    {
        if($handle = opendir($dir))
        {
            while(($file = readdir($handle)) !== false)
            {
                if($file != "." &amp;&amp; $file != ".." &amp;&amp; $file != "Thumbs.db"/*pesky windows, images..*/)
                {
                    echo '<a target="_blank" href="'.$dir.$file.'">'.$file.'</a><br>'."n";
                }
            }
            closedir($handle);
        }
    }
}

Syntax

<?php
    list_files("images/"); //This will list all files of images folder
?>

Creating  A CSV File From PHP ARRAY

function generateCsv($data, $delimiter = ',', $enclosure = '"') {
   $handle = fopen('php://temp', 'r+');
   foreach ($data as $line) {
		   fputcsv($handle, $line, $delimiter, $enclosure);
   }
   rewind($handle);
   while (!feof($handle)) {
		   $contents .= fread($handle, 8192);
   }
   fclose($handle);
   return $contents;
}

Syntax

<?php
$data[0] = "apple";
$data[1] = "oranges";
generateCsv($data, $delimiter = ',', $enclosure = '"');
?>

 

ARRAY in PHP Beginners guide

In this article we are going to discuss ARRAY in PHP Beginners guide. Arrays are wonderful ways to organize and use data in PHP. Array is Collection of different variables under the same label to keep values organized and easily accessible for processing. Here’s a quick example of an array of types of transportation:

$transportation = array( ‘Planes’, ‘Trains’, ‘Automobiles’ );

We use $ sign to give an array name like we do for variables. after that an equal sign and then keyword ‘array’ that tells the parser that we are working with arrays and then different values within parenthesis and each value enclosed in double or single quotes separated by comma.

Printing Array Items

$Top3Sites = array ("w3schools.com","smartwebcare.com","google.com");
print_r($Top3Sites);
?>
The output of the above programme will be.
Array
(
[0] => w3schools.com
[1] => smartwebcare.com
[2] => google.com
)

Please note that we use print_r to print an array because you cannot print an array with echo or print function (both are used to display output) though you can use echo or print to display single items from the array e.g.:
echo $Top3Sites[1]; //w3code.in
Remember that the index number starts from 0 and not 1.
Each value of the array get a unique ID which is known as INDEX NUMBER.

Types Of Arrays:

There are three different types of arrays in PHP:
a) Numeric Array: An array with a numeric ID key.
b) Associative Array: An array where each ID key is associated with a value.
c) Multidimensional Array: An array containing one or more arrays.

Numeric Arrays:

Numeric arrays use integer / numbers as their index number to identify each item of the array. The example we discussed above are numeric arrays as they have integer values as index numbers for each item.

Associative Arrays:

Sometimes it’s better to use the index name instead of index number. When you submit a form using POST or GET method you get associative array on the receiving page that contains the name of each form field as array index and its value as index value. Associative Arrays are more easy to handle and to process information especially dealing with complex form submission and dynamic values from database etc.

Multidimensional Arrays:

A multidimensional array is one where the items in an array are themselves arrays. Here’s an example:

$staff = array(
0 => array(
[‘Name’] => ‘Jonney Robot’,
[‘Position’] => ‘Reader’
),
1 => array(
[‘Name’] => ‘Rahul Gambhir’,
[‘Position’] => ‘Writer’
)
);

There we have a $staff array with multiple people in it. We could do multiple foreach functions to iterate over each of those people like this:

foreach( $staff as $key => $person ) {
    echo ‘<ul>’;
        foreach( $person as $attribute => $value ) {
            echo ‘<li>’ . $attribute . ‘:’ . $value . ‘</li>’;
        }
    echo ‘</ul>’;
}

In the above example I looped through each person, and within each person I looped through their attributes and printed them. You can make up whatever variable names you wish, there’s nothing magic about the names. I tried to name mine in a way that made sense according to the contents.

Arrays are a very deep topic and it has a lot more to discuss and even I can easily write a complete book on arrays only. But the aim of this article is to give you very sound understanding of arrays and different methods to store and process information in arrays.

 

Learn Sass In Few Minutes

If you write copious amounts of CSS, a pre-processor can greatly decrease your stress levels and save you a lot of precious time. Using tools such as SassLessStylus or PostCSS makes large and complicated stylesheets clearer to understand and easier to maintain. Thanks to features like variables, functions and mixins the code becomes more organized, allowing developers to work quicker and make less mistakes.

This time we are going to explain Sass and show you some of it’s main features.

1. Getting Started

Sass files cannot be interpreted by the browser, so they need compiling to standard CSS before they are ready to hit the web. That’s why you need some sort of tool to help you translate .scss files into .css. Here you have a couple of options:

  • The simplest solution is a browser tool for writing and compiling Sass right on the spot – SassMeister.
  • Use a 3rd party desktop app. Both free and paid versions are available. You can go here to find out more.
  • If you are a CLI person like we are, you can install Sass on your computer and compile files manually.

If you decide to go with the command line, you can install Sass in it’s original form (written in ruby) or you can try the Node.js port (our choice). There are many other wrappers as well, but since we love Node.js we are going to go with that.

Here is how you can compile .scss files using the node CLI:

node-sass input.scss output.css

Also, here is the time to mention that Sass offers two distinct syntaxes – Sass and SCSS. They both do the same things, just are written in different ways. SCSS is the newer one and is generally considered better, so we are going to go with that. If you want more information on the difference between the two, check out this great article.

2. Variables

Variables in Sass work in a similar fashion to the those in any programming language, including principals such as data types and scope. When defining a variable we store inside it a certain value, which usually is something that will often reoccur in the CSS like a palette color, a font stack or the whole specs for a cool box-shadow.

Below you can see a simple example. Switch between the tabs to see the SCSS code and it’s CSS translation.

$title-font: normal 24px/1.5 'Open Sans', sans-serif;
$cool-red: #F44336;
$box-shadow-bottom-only: 0 2px 1px 0 rgba(0, 0, 0, 0.2);

h1.title {
  font: $title-font;
  color: $cool-red;
}

div.container {
  color: $cool-red;
  background: #fff;
  width: 100%;
  box-shadow: $box-shadow-bottom-only;
}
h1.title {
  font: normal 24px/1.5 "Open Sans", sans-serif;
  color: #F44336; 
}

div.container {
  color: #F44336;
  background: #fff;
  width: 100%;
  box-shadow: 0 2px 1px 0 rgba(0, 0, 0, 0.2);
}

 

The idea behind all this is that we can later on reuse the same values more quickly, or if a change is needed, we can provide the new value in just one place (the definition of the variable), instead of applying it manually everywhere we’re using that property.

3. Mixins

You can think of mixins as a simplified version of constructor classes in programming languages – you can grab a whole group of CSS declarations and re-use it wherever you want to give and element a specific set of styles.

Mixins can even accept arguments with the option to set default values. In the below example we define a square mixin, and then use it to create squares of varying sizes and colors.

@mixin square($size, $color) {
  width: $size;
  height: $size;
  background-color: $color;
}

.small-blue-square {
  @include square(20px, rgb(0,0,255));
}

.big-red-square {
  @include square(300px, rgb(255,0,0));
}
.small-blue-square {
  width: 20px;
  height: 20px;
  background-color: blue; 
}

.big-red-square {
  width: 300px;
  height: 300px;
  background-color: red;
}

 

Another efficient way to use mixins is when a property requires prefixes to work in all browsers.

@mixin transform-tilt() {
  $tilt: rotate(15deg);

  -webkit-transform: $tilt; /* Ch <36, Saf 5.1+, iOS, An =<4.4.4 */
      -ms-transform: $tilt; /* IE 9 */
          transform: $tilt; /* IE 10, Fx 16+, Op 12.1+ */
}

.frame:hover { 
  @include transform-tilt; 
}
.frame:hover {
  -webkit-transform: rotate(15deg);  /* Ch <36, Saf 5.1+, iOS, An =<4.4.4 */
  -ms-transform: rotate(15deg);  /* IE 9 */
  transform: rotate(15deg);  /* IE 10, Fx 16+, Op 12.1+ */ 
}

 

4. Extend

The next feature we will look at is @extend, which allows you to inherit the CSS properties of one selector to another. This works similarly to the mixins system, but is preferred when we want to create a logical connection between the elements on a page.

Extending should be used when we need similarly styled elements, which still differ in some detail. For example, let’s make two dialog buttons – one for agreeing and one for canceling the dialog.

.dialog-button {
  box-sizing: border-box;
  color: #ffffff;
  box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.12);
  padding: 12px 40px;
  cursor: pointer;
}

.confirm {
  @extend .dialog-button;
  background-color: #87bae1;
  float: left;
}

.cancel {
  @extend .dialog-button;
  background-color: #e4749e;
  float: right;
}
.dialog-button, .confirm, .cancel {
  box-sizing: border-box;
  color: #ffffff;
  box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.12);
  padding: 12px 40px;
  cursor: pointer; 
}

.confirm {
  background-color: #87bae1;
  float: left; 
}

.cancel {
  background-color: #e4749e;
  float: right; 
}

 

If you check out the CSS version of the code, you will see that Sass combined the selectors instead of repeating the same declarations over and over, saving us precious memory.

5. Nesting

HTML follows a strict nesting structure whereas in CSS it’s usually total chaos. With Sass nesting you can organize your stylesheet in a way that resembles the HTML more closely, thus reducing the chance of CSS conflicts.

For a quick example, lets style a list containing a number of links:

ul {
  list-style: none;

  li {
    padding: 15px;
    display: inline-block;

    a {
      text-decoration: none;
      font-size: 16px;
      color: #444;
    }

  }

}
ul {
  list-style: none; 
}

ul li {
  padding: 15px;
  display: inline-block; 
}

ul li a {
  text-decoration: none;
  font-size: 16px;
  color: #444; 
}

 

Very neat and conflict proof.

6.Operations

With Sass you can do basic mathematical operation right in the stylesheet and it is as simple as applying the appropriate arithmetic symbol.

$width: 800px;

.container { 
  width: $width;
}

.column-half {
  width: $width / 2;
}

.column-fifth {
  width: $width / 5;
}
.container {
  width: 800px; 
}

.column-half {
  width: 400px; 
}

.column-fifth {
  width: 160px; 
}

 

Although vanilla CSS now also offers this feature in the form of calc(), the Sass alternative is quicker to write, has the modulo % operation, and can be applied to a wider range of data-types (e.g. colors and strings).

7. Functions

Sass offers a long list of built-in functions. They serve all kinds of purposes including string manipulation, color related operations, and some handy math methods such as random() and round().

To exhibit one of the more simple Sass functions, we will create a quick snippet that utilizes darken($color, $amount) to make an on-hover effect.

$awesome-blue: #2196F3;

a {
  padding: 10 15px;
  background-color: $awesome-blue;
}

a:hover {
  background-color: darken($awesome-blue,10%);
}
a {
  padding: 10 15px;
  background-color: #2196F3; 
}

a:hover {
  background-color: #0c7cd5; 
}

 

Except the huge list of available functions, there is also the options to define your own. Sass supports flow control as well, so if you want to, you can create quite complex behaviors.

Conclusion

Some of the above features are coming to standard CSS in the future, but they are not quite here yet. In the meantime, pre-processors are a great way improve the CSS writing experience and Sass is a solid option when choosing one.

We only covered the surface here, but there is a lot more to Sass than this. If you want to get more familiar with everything it has to offer, follow these links:

Optimize WordPress – Seven Ways to Optimization your WordPress Site for Speedup

Having a website is no laughing matter. It requires knowledge, hard work, efforts and of course, patience. In order to convert your website into an online business, you need to improve your website’s visitor count. However, the ever-growing competition in the market makes it quite hard for websites to keep up with the latest trend of the web industry and soon fall out.

There are various things that play an important role in optimizing your website for search engine and thus, drive traffic to your website including on-page SEO, easy user navigation, SEO-friendly URLs and much more. However, speed is one of the most important things that determine the success of your online business. As a matter of fact, a web user tends to navigate away from a website if it does not load in less than 5 seconds.

Being a webmaster, you usually install many plugins and widgets in order to make your WordPress website stand out. Although you often forget that these plugins are quite heavy and take a lot of space on your hosting server while making your website slow.

Website speed is a crucial point and thus, should be well taken care of.

Therefore, we have compiled a list of 7 most effective ways to optimize your WordPress website for speed.

WordPress Optimization

1. Use a caching plugin

There is no denying in the fact that WordPress plugins are extremely beneficial. However, the best plugins by far are certainly caching ones. These plugins automatically improve the speed of your website by 90%.

One of the best caching plugins is W3 Total Cache. Simply install and activate and you are all set to run a fast loading website.

2. Optimize images

As a matter of fact, images are quite heavy and they apparently make your website slow. In addition, using more than 3 images per blog posts makes your website heavy to load. Therefore, it becomes all the more important to compress your images to improve the speed of the site. However, compressing each image is definitely one heck of a job, and significantly time-consuming. Fortunately, WordPress offers one free plugin to optimize your images automatically – WP-SmushIt.

3. Optimize your homepage

The homepage is one of the most important pages of any website. This is the first page that a user usually sees. In fact, for a majority of websites, the homepage is usually their landing page which drives a large number of visitors to the website. Therefore, it is important to put all of your efforts in improvising the speed of your homepage. There are a lot of things that you can do to optimize the speed of your homepage including reducing the number of posts on the homepage, showing excerpts instead of full posts, removing unnecessary widgets and uninstalling inactive plugins. The bottom line is that you should keep your homepage as focused and clean as possible.

4. Adding Expires header

The whole concept of expires header is introduced to reduce server load and consequently increase page load time. These headers notify the browser whether they must ask a specific file from the server or they should just load it from the browser’s cache. This also reduces the number of HTTP requests from the server.

The best way to make it work is to copy and paste this below mentioned lines of code in your .htaccess file.

ExpiresActive On

ExpiresByType image/gif A2592000

ExpiresByType image/png A2592000

ExpiresByType image/jpg A2592000

ExpiresByType image/jpeg A2592000

The above code sets the expires header for a month which can be changed according to your preferences and needs.

5. Turn off Trackbacks and Pingbacks:

Trackbacks and pingbacks are a great way to know that a blog or website is linked to your site. Whenever a blog mentions you, it automatically indicates you about the activity with the help of trackback. Since it informs about every backlink related activity, it saves the data on the server which increases a lot of work for your website. Turning trackbacks and pingbacks off reduces the workload and thus improving the load speed of the site.

Note: Turning this off does not devastate your back-linking. It only reduces your website’s workload.

6. Minify JavaScript, CSS and HTML

Minification is basically a process of removing all the unnecessary characters and spaces from the code without making any modification in the functionality. Though tabs and whitespaces usually make code understandable and readable for servers and humans, it increases the page load time. Therefore, minifying your JavaScript, CSS and HTML files can improve the load time significantly. Instead of scanning your files one by one, you can make use of various useful plugins such as W3 Total Cache and WP Minify to make the process of minification easier and convenient.

7. Make use of CloudFlare

CloudFlare is one of the best and free ways to improve the security of your website. It is basically a content delivery network that sits between your hosting server and visitors. You can not only protect your site from unwanted visitors but also improves the speed of your site. The combination of CloudFlare and W3 Total Cache works wonders to a website performance.

Wrapping up:

These are some of the tested and proven ways to effectively speed up your website. If you have any other way to improve WordPress website’s speed, don’t forget to share with us.

Develop Desktop Application Within HTML, CSS, JS and Electron

Web applications become more and more powerful every year, but there is still room for desktop apps with full access to the hardware of your computer. Today you can create desktop apps using the already familiar HTML, JS and Node.js, then package it into an executable file and distribute it accordingly across Windows, OS X and Linux.

There are two popular open source projects which make this possible. These are NW.js, which we covered a few months ago, and the newer Electron, which we are going to use today (see the differences between them here). We are going to rewrite the older NW.js version to use Electron, so you can easily compare them.

Getting Started With Electron

Apps built with Electron are just web sites which are opened in an embedded Chromium web browser. In addition to the regular HTML5 APIs, these websites can use the full suite of Node.js modules and special Electron modules which give access to the operating system.

For the sake of this tutorial, we will be building a simple app that fetches the most recent Tutorialzine articles via our RSS feed and displays them in a cool looking carousel. All the files needed for the app to work are available in an archive which you can get from the Download button near the top of the page.

Extract its contents in a directory of your choice. Judging by the file structure, you would never guess this is a desktop application and not just a simple website.

Directory Structure

Directory Structure

We will take a closer look at the more interesting files and how it all works in a minute, but first, let’s take the app for a spin.

Running the App

Since an Electron app is just a fancy Node.js app, you will need to have npm installed. You can learn how to do it here, it’s pretty straightforward.

Once you’ve got that covered, open a new cmd or terminal in the directory with the extracted files and run this command:

npm install

This will create a node_modules folder containing all the Node.js dependencies required for the app to work. Everything should be good to go now, in the same terminal as before enter the following:

npm start

The app should open up in it’s own window. Notice it has a top menu bar and everything!

Electron App In Action

Electron App In Action

You’ve probably noticed that starting the app isn’t too user friendly. However, this is just the developer’s way of running an Electron app. When packaged for the public, the it will be installed like a normal program and opened like one, just by double clicking on its icon.

How it’s made

Here, we will talk about the most essential files in any electron app. Let’s start with package.json, which holds various information about the project, such as the version, npm dependencies and other important settings.

package.json

{
  "name": "electron-app",
  "version": "1.0.0",
  "description": "",
  "main": "main.js",
  "dependencies": {
    "pretty-bytes": "^2.0.1"
  },
  "devDependencies": {
    "electron-prebuilt": "^0.35.2"
  },
  "scripts": {
    "start": "electron main.js"
  },
  "author": "",
  "license": "ISC"
}

If you’ve worked with node.js before, you already know how this works. The most significant thing to note here is the scripts property, where we’ve defined the npm start command, allowing us to run the app like we did earlier. When we call it, we ask electron to run the main.js file. This JS file contains a short script that opens the app window, and defines some options and event handlers.

main.js

var app = require('app');  // Module to control application life.
var BrowserWindow = require('browser-window');  // Module to create native browser window.

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
var mainWindow = null;

// Quit when all windows are closed.
app.on('window-all-closed', function() {
    // On OS X it is common for applications and their menu bar
    // to stay active until the user quits explicitly with Cmd + Q
    if (process.platform != 'darwin') {
        app.quit();
    }
});

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
app.on('ready', function() {
    // Create the browser window.
    mainWindow = new BrowserWindow({width: 900, height: 600});

    // and load the index.html of the app.
    mainWindow.loadURL('file://' + __dirname + '/index.html');

    // Emitted when the window is closed.
    mainWindow.on('closed', function() {
        // Dereference the window object, usually you would store windows
        // in an array if your app supports multi windows, this is the time
        // when you should delete the corresponding element.
        mainWindow = null;
    });
});

Take a look at what we do in the ‘ready’ method. First we define a browser window and set it’s initial size. Then, we load the index.html file in it, which works similarly to opening a HTML file in your browser.

As you will see, the HTML file itself is nothing special – a container for the carousel and a paragraph were CPU and RAM stats are displayed.

index.html

<!DOCTYPE html>
<html>
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Tutorialzine Electron Experiment</title>

    <link rel="stylesheet" href="./css/jquery.flipster.min.css">
    <link rel="stylesheet" href="./css/styles.css">

</head>
<body>

<div class="flipster">
    <ul>
    </ul>
</div>

<p class="stats"></p>

<!-->In Electron, this is the correct way to include jQuery<-->
<script>window.$ = window.jQuery = require('./js/jquery.min.js');</script>
<script src="./js/jquery.flipster.min.js"></script>
<script src="./js/script.js"></script>
</body>
</html>

The HTML also links to the needed stylesheets, JS libraries and scripts. Notice that jQuery is included in a weird way. See this issue for more information about that.

Finally, here is the actual JavaScript for the app. In it we access Tutorialzine’s RSS feed, fetch recent articles and display them. If we try to do this in a browser environment, it won’t work, because the RSS feed is located on a different domain and fetching from it is forbidden. In Electron, however, this limitation doesn’t apply and we can simply get the needed information with an AJAX request.

$(function(){

    // Display some statistics about this computer, using node's os module.

    var os = require('os');
    var prettyBytes = require('pretty-bytes');

    $('.stats').append('Number of cpu cores: <span>' + os.cpus().length + '</span>');
    $('.stats').append('Free memory: <span>' + prettyBytes(os.freemem())+ '</span>');

    // Electron's UI library. We will need it for later.

    var shell = require('shell');


    // Fetch the recent posts on Tutorialzine.

    var ul = $('.flipster ul');

    // The same-origin security policy doesn't apply to electron, so we can
    // send ajax request to other sites. Let's fetch Tutorialzine's rss feed:

    $.get('http://feeds.feedburner.com/Tutorialzine', function(response){

        var rss = $(response);

        // Find all articles in the RSS feed:

        rss.find('item').each(function(){
            var item = $(this);

            var content = item.find('encoded').html().split('</a></div>')[0]+'</a></div>';
            var urlRegex = /(http|ftp|https)://[w-_]+(.[w-_]+)+([w-.,@?^=%&amp;:/~+#]*[w-@?^=%&amp;/~+#])?/g;

            // Fetch the first image of the article.
            var imageSource = content.match(urlRegex)[1];


            // Create a li item for every article, and append it to the unordered list.

            var li = $('<li><img /><a target="_blank"></a></li>');

            li.find('a')
                .attr('href', item.find('link').text())
                .text(item.find("title").text());

            li.find('img').attr('src', imageSource);

            li.appendTo(ul);

        });

        // Initialize the flipster plugin.

        $('.flipster').flipster({
            style: 'carousel'
        });

        // When an article is clicked, open the page in the system default browser.
        // Otherwise it would open it in the electron window which is not what we want.

        $('.flipster').on('click', 'a', function (e) {

            e.preventDefault();

            // Open URL with default browser.

            shell.openExternal(e.target.href);

        });

    });

});

A cool thing about the above code, is that in one file we simultaneously use:

  • JavaScript libraries – jQuery and jQuery Flipster to make the carousel.
  • Electron native modules – Shell which provides APIs for desktop related tasks, in our case opening a URL in the default web browser.
  • Node.js modules – OS for accessing system memory information, Pretty Bytes for formatting.

And with this our app is ready!

Packaging and Distribution

There is one other important thing to do to make your app ready for end users. You need to package it into an executable that can be started with a double click on users’ machines. Since Electron apps can work on multiple operating systems and every OS is different, there need to be separate distributions for Windows, for OS X and for Linux. Tools such as this npm module are a good place to start – Electron Packager.

Take into consideration that the packaging takes all your assets, all the required node.js modules, plus a minified WebKit browser and places them together in a single executable file. All these things sum up and the final result is an app that is roughly 50mb in size. This is quite a lot and isn’t practical for a simple app like our example here, but this becomes irrelevant when we work with big, complex applications.

Conclusion

The only major difference with NW.js that you will see in our example is that NW.js opens an HTML page directly, whereas Electron starts up by executing a JavaScript file and you create an application window through code. Electron’s way gives you more control, as you can easily build multi-window applications and organize the communication between them.

Overall Electron is an exciting way to build desktop web applications using web technologies. Here is what you should read next:

How to Use Git for WordPress – WordPress Git

Git is one kind of version control tool. It is also an open source system. It trails files and directories. Using git you can store your project online. As it is an open source system your project will be available to reach publicly. However, it is very useful tool to run your project smoothly involving multiple developers.

The contents are stored in Git in Binary Large Objects which is known as BLOBS. The folders are defined as trees. Every tree has other trees (e.g. subfolders) as well as BLOBS including a general text file which contains the type, mode, name and Secure Hash Algorithm (SHA). At the time of transferring repository, though there are various files with the similar content and a diverse name, Git transfers the BLOB one time and eventually spread it out to various files.

Projects’ histories are saved as a commit object. You must have to commit each time you make any modifications in your projects. The commit files record the committer, author, comment and parent commits.
If you intend to make your project successful, then Git is one of the best version control system for you. It obviously makes your project development smoothly. There are other version control systems also.

 

Why Git is the best VCS?

Here are some reasons for you:

  • World’s top projects such as Jquery, Ruby and Linux Kernel utilize Git as the best choice for VCS (Version Control system). From small team to large team Git is an wonderful VC tool.
  • Sometimes workflow in your project gets violated due to multiple developers in a project. Then it is difficult to trace out the wrong with the project. If you used Git then you could find the culprit from commit history. As a result your project workflow would be increased. Actually developers like to use Git as it assists them to get productive outcomes within a short period of time. And collaboration in a project is done comfortably. Moreover Git is the life saver for a developer at the time of losing something from the projects.
  • One of the important points to utilize Git is that you can use it without having technical expertness. If you have some primary programming knowledge then it’s ok to go ahead with Git. You can smoothly handle Git, because it extreme user friendly.

 

WordPress Git Tips

Is it Good to use Git for WordPress?

If you intend to install some previously built themes and plugins then yes, Git surely would be the best option for your project. It is necessary for a team to utilize VC (Version Control) for editing any codes. Even if you edit the CSS of child themes you must do it using VC. At the first time of using Git it might be difficult for you to understand what is happening. But when you would get used to using Git you will be stuck with it surely and you will suggest others to use Git for their projects.

Using git, you will get the chance of changing each line of codes you coded previously. If there is any mistakes happened then Git will give you the opportunity to undo the change. You will enjoy the real application of Git when you develop any wordpress theme employing multiple web developers in the same project. Imagine that conditions like you are in bad dreams where you have got yourself working with wrong files or somebody has uploaded useless files! Git is there to help you getting back from that kinds of bad situations.

WordPress projects contain thousands of codes in different files. It is surely hard to handle all the codes without using version control. Because, if you lost any files once, then it will damage your projects that you have been developing since last couple of months. Therefore, use Git VC to overcome likely risks. It is also recommended to change child themes using Git.

 

Let’s Start! GUI or Command Line?

There are two ways available for you to work using Git and these are-

  • Command Line Interface
  • Graphical User Interface (GUI) Application

Both of the above are useful. GUI application can you help you more effectively. It has advanced features available for you. On the other hand using command line is comparatively difficult to use normally for using advanced features.

Nevertheless, the true thing is that using Command Line is always better for the new learners. Command line will make it easier to learn GIt for beginner. Beginners will be able to learn Git deeply as well as they will understand the total procedures within a short time. You will get command line in more independent form than GUI in case of some specific applications.

You can handle Git operation entirely using command line. Besides, GUI can make your work easier. It may assist you to imagine the condition of Git tree and merges. GUI is also useful to setup remotes, pushing and pulling from themes. It is also possible the conflict in merging by means of GUI.

There are several useful GUI tools which are free to use. You can try these tools. The most popular GUI tools are- Git Tower, SourceTree, GitHub’s app and Git Cola.
GiHub’s app is the most popular tool and extremely useful for new learners, because it’s very simple to use. There are some latest features associated with GithHub’s app. SourceTree will let you visualize Git tree. SourceTree can work smoothly with both GitHub and BitBucket.

Once you learn the primary applications of Git, you are recommended to utilize GUI. Because GUI makes your project works easier and productive. Tortoise Git is another powerful tool for users who use windows. Mac OS users can use Tower.

 

In Case of WordPress Database

We have learned many things about Git already, but the database section has not been discussed yet. But it is not a matter to worry about, because it is completely different matter. It’s also a difficult section of Version Control. WordPress has a wonderful feature that enables you to revise the posts, for example, VC for content. Perhaps you have to divide VC for your WordPress Database. Practically it is really difficult to execute

WordPress has an effective solution regarding this issue. There is a plugin named Revisr. It is an well known WordPress plugin. Normally it is tool of Git GUI. Using this tool you can handle WordPress dashboard. It has a lot of amazing features and it is one of the suggested options for you to improve Git Workflow.
There is a unique feature in Revisr. This feature enables you to keep backup of database for every commit. So, it is possible to get back the earlier commit. In additions, you will get database in earlier stage also. It is an incredible feature to save your life.
In conclusion, Git is useful in WordPress that is beyond of description.

You can continue experiment with codes using Git. You will get freedom, because you can remove your changes if you want. You need not commit them and it is also not needed to regress commits in next time. VC system has made it possible for the developers to work simultaneously in a project. It is really best tool for team work. Any member of the team can contribute from any parts of the world. This is the best advantage of utilizing VC as a WordPress developer.

 

10 PHP Events And Calendar Scripts

If you are looking to accomplish some tasks like schedule or book your own appointments, schedule usage of resources such as rooms, vehicles etc then PHP events and calendar scripts will help you to do your task easily.So here in post we have showcasing 10 PHP scripts for setting up online events calendar on your site.

PHP Events And Calendar Scripts

PHP LBEvents – Events Calendar

PHP LBEvents is a php script that allow you to create and manage events to display on a calendar. You can creates unlimited calendars with their settings and let user select it to display the events you want to show on it.

 

php-scripts-1

View Demo     View Details

 

Promoter

Promoter is a calendar based PHP script that allows you to create events listings websites.Your visitors will be able to browse the events by category, using the calendar or subscribing to the RSS feed, there’s also a search box which allows to search for specific events. The script is SEO friendly as it uses user-friendly URLs and automatically generates a sitemap.xml for search engines.

php-scripts-2

View Demo     View Details

 

PHP Event Calendar

PHP Event Calendar is a MySQL Database driven script that displays events on your website quickly and easily through a traditional calendar UI. It can be integrated into any existing PHP page within minutes using a simple file include.

php-scripts-3

View Demo     View Details

 

Caledonian PHP Event Calendar

Caledonian PHP Calendar is a user friendly, php based and multi-user calendar/scheduling script. It has so many great features like timeline, multiple calendars, shared calendars, event reminder, multiple language support and so on. You can customize it easily and use as a standalone scheduling application or integrate into your own application.

php-scripts-4

View Demo     View Details

 

Live Events

Live Events is a PHP, mySql, ajax(jQuery) script where you can stream events in real time. You can stream sports, concerts and any kind of events. Your visitors can add their comments (if this is enable) and you can as admin (or writer) add comments, images and videos (from Youtube.com or Vimeo.com).

php-scripts-5

View Demo     View Details

 

Employee Work Schedule / Multi-calendar

This calendar is for scheduling employees and/or spaces or you can use it as amulti-calendar to add events in several calendars.. In the dashboard there are many settings with which you can customize the calendar, like views, date/time formats, am/pm, (non) alterable days etc. etc.

 

 

php-scripts-6

View Demo     View Details

 

CIFullCalendar v3

CIFullCalendar+ is a server-side dynamic web application that is responsive to any layout of a viewing screen. The “Super Saiyan Fusion” power of CIFullCalendar allows users to organize, plan and share events to everyone.

php-scripts-7

View Demo     View Details

 

Eventer

Eventer, a PHP and jQuery based interactive events calendar, is a highly interactive calendar for presenting your events in a very highly interactive format.

php-scripts-8

View Demo     View Details

 

Booking System

Booking system is a powerful easy to use and easy to setup booking script which will help you to setup a reservation system for any of your websites in minutes.

php-scripts-9

View Demo     View Details

 

Multipurpose Responsive PHP Ajax Calendar

This multipurpose AJAX Calendar can be used as event manager, reminder, planner, affiche, to-do list etc and will save You a lot of time for client-side scripting. It can be integrated in any type of Content Management Systems such as WordPress, Joomla, Drupal etc.

php-scripts-10

View Demo     View Details

 

The post 10 PHP Events And Calendar Scripts appeared first on DevsTrend.

Constructor of Classes and Objects in OOP PHP

A constructor is a special functions which are automatically called when an object is created . The constructor is the most useful , especially because it allows you to send parameters along when creating a new object, which can then be used to initialize variables on the object. Constructor is nothing but a function defined in your PHP class. Constructor function automatically called when you will create object of the class. As soon as you will write $object = new yourClass() your constructor function of the class will be executed. you can create constructor by defining magic function __construct.

Example:

class MyClass 
{
        public $var;

    // Class constructor
    public function __construct($var)
    {
        echo 'Created an object of MyClass';
        $this->var = $var;
    }

}
// Make an object
$objA = new MyClass('A');

// Call an object method to show the object’s property

If you have created parameter in the constructor you need to pass value for them on the time of object creation.
$objCls = new MyClass(‘A’). If you will not send value PHP will throw error.

Read more OOP in PHP

I hope its helpful for every one, contact & ask any question on http://fb.com/smartwebcareindia